Skip to content

PS_ExecuteScript

Executes a PowerShell script with Windows PowerShell
The output of the script is written to PSOut.log in gsTempDir (for computer jobs <gsWorkstationPath>Logs\Temp\PSOut.log)
If the script returns an exit code other than 0, the function fails the job

PS_ExecuteScript(sScript, sScriptArguments, bSigned, bRunUnrestricted) As Boolean

Full path to and name of Powershell script that should be executed

Script arguments

Is the script signed. Set it to TRUE if the script is signed and the execution policy is AllSigned.

Should the script be executed even though the execution policy prevents it. If TRUE, the script runs with -ExecutionPolicy Unrestricted.

If the execution policy is AllSigned and both bSigned and bRunUnrestricted are FALSE, the script isn’t run and the function fails the job.

Boolean, TRUE if the script ran and returned exit code 0.

If bStatus Then bStatus = PS_ExecuteScript(gsPackageRoot & "\Kit\CapaInstaller.ps1", "", False, True)

Scripting Guidelines

Constants Package Property Variables