early-access version 2853
This commit is contained in:
27
externals/vcpkg/scripts/azure-pipelines/windows/drop-to-admin-user-prefix.ps1
vendored
Executable file
27
externals/vcpkg/scripts/azure-pipelines/windows/drop-to-admin-user-prefix.ps1
vendored
Executable file
@@ -0,0 +1,27 @@
|
||||
param(
|
||||
[string]$AdminUserPassword = $null
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
if (-Not [string]::IsNullOrEmpty($AdminUserPassword)) {
|
||||
$PsExecPath = 'C:\PsExec64.exe'
|
||||
$PsExecArgs = @(
|
||||
'-u',
|
||||
'AdminUser',
|
||||
'-p',
|
||||
$AdminUserPassword,
|
||||
'-accepteula',
|
||||
'-i',
|
||||
'-h',
|
||||
'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe',
|
||||
'-ExecutionPolicy',
|
||||
'Unrestricted',
|
||||
'-File',
|
||||
$PSCommandPath
|
||||
)
|
||||
|
||||
Write-Host "Executing: $PsExecPath $PsExecArgs"
|
||||
$proc = Start-Process -FilePath $PsExecPath -ArgumentList $PsExecArgs -Wait -PassThru
|
||||
exit $proc.ExitCode
|
||||
}
|
Reference in New Issue
Block a user