Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- param(
- [string] $ParamExePath
- )
- function Run-CallThisExe {
- param(
- [string] $ThisExePath
- )
- Write-Host "ThisExePath: " "$ThisExePath"
- start-process -FilePath $ThisExePath
- }
- write-host "ParamExePath: " $ParamExePath
- Run-CallThisExe -ThisExePath "$ParamExePath"
- powershell -command .Untitled1.ps1 -NonInteractive -ParamExePath "C:path with spacesmyapp.exe"
- powershell -command .Untitled1.ps1 -NonInteractive -ParamExePath "C:path with spacesmyapp.exe"
- powershell -file .Untitled1.ps1 -NonInteractive -ParamExePath "C:path with spacesmyapp.exe"
- -Command
- Executes the specified commands (and any parameters) as though they were
- typed at the Windows PowerShell command prompt, and then exits, unless
- NoExit is specified. The value of Command can be "-", a string. or a
- script block.
- -File
- Runs the specified script in the local scope ("dot-sourced"), so that the
- functions and variables that the script creates are available in the
- current session. Enter the script file path and any parameters.
- File must be the last parameter in the command, because all characters
- typed after the File parameter name are interpreted
- as the script file path followed by the script parameters.
- powershell -command .Untitled1.ps1 -NonInteractive "-ParamExePath 'C:path with spacesmyapp.exe'"
- powershell -command ".Untitled1.ps1 -ParamExePath 'C:path with spacesmyapp.exe'" -NonInteractive
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement