Created
October 21, 2018 21:45
-
-
Save smaglio81/b41e2a678546b470e22cd0c142fbab0d to your computer and use it in GitHub Desktop.
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
$organizationName = "{your vsts org name}" | |
$rootDirectoryForSourceControlProjectsOnDisk = "C:\Root\Source-Code\Workspace\Path" | |
$slns = dir -Path $everything -Filter "*.sln" -Recurse -File | |
$changedSlns = @() | |
foreach($sln in $slns) { | |
$fullname = $sln.FullName | |
$c = Get-Content -Path $fullname | |
$updated = @() | |
$changed = $false | |
foreach($line in $c) { | |
if($line -match "SccTeamFoundationServer") { | |
if($line -match "https:\/\/$($organizationName).visualstudio.com\/") { | |
Write-Host "Matched: $fullname" | |
Write-Host "Found: $line" | |
$line = $line -replace "https:\/\/$($organizationName).visualstudio.com\/", "https://dev.azure.com/$($organizationName)" | |
$changed = $true | |
Write-Host "Replaced: $line" | |
} | |
} | |
$updated += @($line) | |
} | |
if($changed) { | |
Write-Host "Updating: $fullname" | |
$updated | Set-Content -Path $fullname | |
$changedSlns += @($fullname) | |
} | |
} | |
Write-Host "Count: $($changedSlns.Count)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment