mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
Create new process with all command-line parameters when UAC is enabled
This commit is contained in:
parent
4387dfd260
commit
e209b259d2
1 changed files with 4 additions and 6 deletions
|
@ -133,13 +133,11 @@ If (!(Get-IsAdministrator)) {
|
||||||
|
|
||||||
# Specify the current script path and name as a parameter`
|
# Specify the current script path and name as a parameter`
|
||||||
$parameters = ""
|
$parameters = ""
|
||||||
If($minion -ne "not-specified") {$parameters = "-minion $minion"}
|
foreach ($boundParam in $PSBoundParameters.GetEnumerator())
|
||||||
If($master -ne "not-specified") {$parameters = "$parameters -master $master"}
|
{
|
||||||
If($runservice -eq $false) {$parameters = "$parameters -runservice false"}
|
$parameters = "$parameters -{0} '{1}'" -f $boundParam.Key, $boundParam.Value
|
||||||
If($version -ne '') {$parameters = "$parameters -version $version"}
|
}
|
||||||
If($pythonVersion -ne "") {$parameters = "$parameters -pythonVersion $pythonVersion"}
|
|
||||||
$newProcess.Arguments = $myInvocation.MyCommand.Definition, $parameters
|
$newProcess.Arguments = $myInvocation.MyCommand.Definition, $parameters
|
||||||
|
|
||||||
# Specify the current working directory
|
# Specify the current working directory
|
||||||
$newProcess.WorkingDirectory = "$script_path"
|
$newProcess.WorkingDirectory = "$script_path"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue