Skip to content

Instantly share code, notes, and snippets.

@omidkrad
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omidkrad/4b6933fac239221fc012 to your computer and use it in GitHub Desktop.
Save omidkrad/4b6933fac239221fc012 to your computer and use it in GitHub Desktop.
Script to remove nuget.targets import from all .csproj files
# Migrating MSBuild-Integrated solutions to use Automatic Package Restore
# http://docs.nuget.org/docs/workflows/migrating-to-automatic-package-restore
# See also: http://weblogs.asp.net/jongalloway/scripting-net-project-migration-to-automatic-nuget-package-restore
# and: https://github.com/owen2/AutomaticPackageRestoreMigrationScript
findstr /s /m /i NuGet.targets *.*proj | % {$file = get-item $_; $txt = Get-Content $file | Select-String "nuget`.targets" -NotMatch; $txt | Set-Content $file -Encoding UTF8 }
findstr /s /m /i RestorePackages *.*proj | % {$file = get-item $_; $txt = Get-Content $file | Select-String "RestorePackages" -NotMatch; $txt | Set-Content $file -Encoding UTF8 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment