# Recursively sets all the projects in a directory to target the .NET client framework. $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 "UpgradeDotNet.ps1" echo "usage: UpgradeDotNet (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 "*.csproj" $search_path foreach ($p in $projects) { $path = $p.FullName type $path | out-file -filepath "$env:temp\deleteme.tmp" -encoding UTF8 type "$env:temp\deleteme.tmp" | out-file -filepath $path -encoding UTF8 }