Result Back from PowerShell Script
Posted: Tue May 18, 2021 1:01 am
Hello,
Does anyone know if it's possible to return a value back from the execution of a PowerShell script? Below is the command I'm executing, and it always seems to return a value of 0 (zero). I've tried returning values with Write-Host and Write-Output, but I'm not sure if executing a script in this manner would send results back like this.
Run Program $WINDIR$\\Sysnative\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy ByPass -file "$SUPPORTDIR$\myfile.ps1" (WAIT, get result into variable PSScriptResults)
Thanks very much.
Regards
Mark
Does anyone know if it's possible to return a value back from the execution of a PowerShell script? Below is the command I'm executing, and it always seems to return a value of 0 (zero). I've tried returning values with Write-Host and Write-Output, but I'm not sure if executing a script in this manner would send results back like this.
Run Program $WINDIR$\\Sysnative\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy ByPass -file "$SUPPORTDIR$\myfile.ps1" (WAIT, get result into variable PSScriptResults)
Thanks very much.
Regards
Mark