-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
@danhellem I recommned updating teh sxcruipt to use:
$witAdmin = $null
try {
$cmd = Get-Command witadmin.exe -ErrorAction SilentlyContinue
if ($cmd) { $witAdmin = $cmd.Source }
} catch {}
if (-not $witAdmin) {
$vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe'
if (Test-Path $vswhere) {
$found = & $vswhere -latest -prerelease -requires Microsoft.VisualStudio.TeamExplorer -find **\witadmin.exe
if ($found) { $witAdmin = $found }
}
}
if (-not $witAdmin) {
$searchRoot = "${env:ProgramFiles(x86)}\Microsoft Visual Studio"
if (Test-Path $searchRoot) {
$match = Get-ChildItem -Path $searchRoot -Filter witadmin.exe -Recurse -ErrorAction SilentlyContinue |
Sort-Object LastWriteTime -Descending |
Select-Object -First 1
if ($match) { $witAdmin = $match.FullName }
}
}
if (-not $witAdmin) { throw 'witadmin.exe not found. Install Visual Studio Team Explorer components or add witadmin.exe to PATH.' }
Write-Host "Using witadmin: $witAdmin" -ForegroundColor Cyan
Metadata
Metadata
Assignees
Labels
No labels