From ced6cb9a4000d5c7d980da426bdff5053fde9c6e Mon Sep 17 00:00:00 2001 From: Carl Chang Date: Tue, 30 Jul 2019 14:22:35 +0800 Subject: [PATCH] fix arguments not passed properly it appears that $Args will only work when passed with at least one leading white space. --- Invoke-Runas.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Invoke-Runas.ps1 b/Invoke-Runas.ps1 index f9631d0..cbb0395 100644 --- a/Invoke-Runas.ps1 +++ b/Invoke-Runas.ps1 @@ -140,7 +140,7 @@ function Invoke-Runas { echo "`n[>] Calling Advapi32::CreateProcessWithLogonW" $CallResult = [Advapi32]::CreateProcessWithLogonW( $User, $Domain, $Password, $LogonType, $Binary, - $Args, 0x04000000, $null, $GetCurrentPath, + " " + $Args, 0x04000000, $null, $GetCurrentPath, [ref]$StartupInfo, [ref]$ProcessInfo) if (!$CallResult) {