Update RunAs.ps1

This commit is contained in:
Steve Borosh
2017-06-24 05:56:12 -04:00
committed by GitHub
parent 8ce2aadf33
commit 7a29e91212
+9 -2
View File
@@ -33,7 +33,11 @@ Invoke-RunAs -username administrator -password "P@$$word!" -domain CORPA
[Parameter(
ValueFromPipeline=$True,
Mandatory=$False)]
[String]$cmd
[String]$command,
[Parameter(
ValueFromPipeline=$True,
Mandatory=$False)]
[String]$arguments
)
PROCESS {
$sec_password = convertto-securestring $password -asplaintext -force
@@ -41,7 +45,10 @@ Invoke-RunAs -username administrator -password "P@$$word!" -domain CORPA
$startinfo.UserName = $username
$startinfo.Password = $sec_password
$startinfo.Domain = $domain
$startinfo.FileName = $cmd
$startinfo.FileName = $command
$startinfo.Arguments = $arguments
$startinfo.CreateNoWindow = $true
$startinfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::hidden
$startinfo.UseShellExecute = $false
[System.Diagnostics.Process]::Start($startinfo)
}