# This script recurses from the given directory to find all # .sln files and upgrade them to VS 2013. $search_path = "." $client_profile = [bool] 0 if($args.Length -ge 1) { if(($args[0] -eq "--help") -or ($args[0] -eq "-h") -or ($args[0] -eq "/?")) { echo "upgrade_dotnet" echo "usage: upgrade_dotnet (--client) (path)" $format = @(Expression={$_.Name}; Label="Argument"; width=10), @(Expression={$_.Value}; Label="Description";) $arguments = @{"path"="The start of the search path for .csproj files to convert."} echo $arguments | Format-Table $format } else { $search_path = $args[0] } if($args.Length -ge 2) { $search_path = $args[1] } } $projects = ls -recurse -Filter "*.sln" $search_path foreach ($p in $projects) { $path = $p.FullName (Get-Content $path) | Foreach-Object {$_ -replace "Microsoft Visual Studio Solution File, Format Version 11.00", "Microsoft Visual Studio Solution File, Format Version 12.00"} | Set-Content $path (Get-Content $path) | Foreach-Object {$_ -replace "# Visual Studio 2010", "# Visual Studio 2013`nVisualStudioVersion = 12.0.21005.1`nMinimumVisualStudioVersion = 10.0.40219.1"} | Set-Content $path }