Just getting started with Powershell scripts in HM.
Running v9.38 and RMA v4.54
Trying to run a simple Powershell script.
powershell.exe -file c:\tools\getec2status.ps1 i-356a3b44
where i-356a3b44 is a parameter I'm passing.
The script exits and sets the DOS %errorlevel% to a numeric.
I run this from a DOS prompt on HM server and on RMA, and it works.
I can run it in HM as a local test, (I see the DOS window open and close) and the %errorlevel% is shown as the reply.
Running via an RMA agent it fails to bring back the %errorlevel%, only a 0. I am almost certain the DOS window is not opening on the RMA because I don't see it show up in task manager on the RMA.
These are 2 brand newly built Windows 2008 servers. The HM server is plain Windows 2008, the RMA is R2.
Advice?
Running a Powershell Script via RMA
ok I feel kinda silly now for posting so many replies and finally figured it out.
I failed to run the following command in the 32bit version of powershell.
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine
this fixed it.
Can the 64bit version be forced on an RMA if it's a 64bit OS?
Just curious.
I failed to run the following command in the 32bit version of powershell.
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine
this fixed it.
Can the 64bit version be forced on an RMA if it's a 64bit OS?
Just curious.
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact: