Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save smaglio81/b41e2a678546b470e22cd0c142fbab0d to your computer and use it in GitHub Desktop.
Save smaglio81/b41e2a678546b470e22cd0c142fbab0d to your computer and use it in GitHub Desktop.
$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