Replace whoami subprocess with .NET API in diag

whoami.exe isn't on PATH for pwsh under the gitea-runner SYSTEM
context (or pwsh's strict mode treats the lookup as fatal), so the
previous diagnostic line aborted the script before any of the cwd /
ISCC-dir output was printed. Use WindowsIdentity.GetCurrent().Name
which is in-process and always works.
This commit is contained in:
2026-05-08 13:41:01 -04:00
parent 1229c52ecf
commit a026fb361d
+1 -1
View File
@@ -119,7 +119,7 @@ foreach ($ref in $issRefs) {
Write-Host "" Write-Host ""
Write-Host "--- runtime context ---" -ForegroundColor Cyan Write-Host "--- runtime context ---" -ForegroundColor Cyan
Write-Host " whoami: $(whoami)" Write-Host " identity: $([Security.Principal.WindowsIdentity]::GetCurrent().Name)"
Write-Host " USERPROFILE: $env:USERPROFILE" Write-Host " USERPROFILE: $env:USERPROFILE"
Write-Host " APPDATA: $env:APPDATA" Write-Host " APPDATA: $env:APPDATA"
Write-Host " LOCALAPPDATA: $env:LOCALAPPDATA" Write-Host " LOCALAPPDATA: $env:LOCALAPPDATA"