Skip to content

Commit b43c1b2

Browse files
committed
fix: test
1 parent 12f0bd7 commit b43c1b2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/verify-devpack-scripts.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,16 @@ jobs:
296296
}
297297
Write-Host "ARP: $($entry.DisplayName) $($entry.DisplayVersion)"
298298
299-
if ($env:INSTALL_SOURCE -eq 'winget') {
299+
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
300+
$principal = [Security.Principal.WindowsPrincipal]::new($identity)
301+
$isElevated = $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
302+
if ($env:INSTALL_SOURCE -eq 'winget' -and -not $isElevated) {
300303
winget uninstall --exact --id Microsoft.FoundryDevPack --source winget `
301304
--silent --disable-interactivity --accept-source-agreements
302305
} else {
306+
if ($env:INSTALL_SOURCE -eq 'winget') {
307+
Write-Host 'Runner is elevated; using the persisted uninstaller for this user-scope package.'
308+
}
303309
& $entry.DisplayIcon uninstall
304310
}
305311
if ($LASTEXITCODE -ne 0) { throw "uninstall exited $LASTEXITCODE" }

0 commit comments

Comments
 (0)