Skip to content

Instantly share code, notes, and snippets.

View MattJeanes's full-sized avatar
🏳️‍🌈

Matt Jeanes MattJeanes

🏳️‍🌈
View GitHub Profile
@MattJeanes
MattJeanes / DeleteExcludedFiles.ps1
Last active September 6, 2018 17:21 — forked from mikesigs/DeleteExcludedFiles.ps1
PowerShell Script to Find (and delete) all excluded files in a Visual Studio Solution
$Solution = "C:\_git\Mercury\Mercury.sln"
[switch]$DeleteFromDisk = $true
$ErrorActionPreference = "Stop"
$solutionDir = Split-Path $Solution | % { (Resolve-Path $_).Path }
cd $solutionDir
$projects = Select-String -Path $Solution -Pattern 'Project.*"(?<file>.*\.csproj)".*' `
| % { $_.Matches[0].Groups[1].Value } `