Result Back from PowerShell Script

Got a problem you cannot solve? Try here.
Post Reply
msandford
Posts: 4
Joined: Sat Nov 21, 2020 7:22 pm

Result Back from PowerShell Script

Post by msandford »

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
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Result Back from PowerShell Script

Post by FrancescoT »

I think that the only possible approach is with implementing something similar to this:https://stackoverflow.com/questions/624 ... from-c-app
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Steve
Posts: 117
Joined: Fri Jun 16, 2006 9:51 pm
Location: Canada eh

Re: Result Back from PowerShell Script

Post by Steve »

Msandford,
'Sysnative' is not a folder within WINDIR and is not a variable within InstallAware...
Sysnative is terminology used within 'ActualInstaller' and means nothing to Installaware
Post Reply