Created
June 1, 2012 09:58
-
-
Save CaptainJiNX/2850888 to your computer and use it in GitHub Desktop.
Copy a VS project folder to an *Old folder, and rename files and content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $original = 'TeamJinx' | |
| $copyTo = $original + 'Old' | |
| # Copy all files... | |
| ROBOCOPY $original\ $copyTo\ /MIR | |
| # Rename all files containing original name | |
| Get-ChildItem .\$copyTo -Recurse -Include *$original*.* | % { Rename-Item $_.FullName $_.Name.Replace($original, $copyTo) } | |
| # Replace text (i.e. namespaces, classes and file references) | |
| Get-ChildItem .\$copyTo -Recurse -Include *.cs,*.csproj | % { | |
| (Get-Content $_.FullName) | % { $_ -replace $original, $copyTo } | Set-Content -path $_.FullName | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment