Cannot get 64 bit PS to run from ShellScript.

When you post information about some problem, please include the following details: - OS version (e.g. Windows 2000 Professional SP3); HostMonitor version; problem description.
Post Reply
stephan88
Posts: 2
Joined: Mon Dec 05, 2011 12:10 pm

Cannot get 64 bit PS to run from ShellScript.

Post by stephan88 »

Running from a RMA Active Agent (4.12) on Win2k8r2 I want to execute a 64 bit powershell (to use modules not available in the 32 bit version of PS):
So instead of calling (from HM 8.82):
powershell %schript% %params%
(which glues the .PS1 extension to the scriptname OK)
I have to call it like this:
c:\windows\sysnative\windowspowershell\v1.0\powershell.exe -file %Script% %Params%
Now HM stops adding the required .PS1 extension to the script and creates the scriptname ending in .BAT which give me the error:
error: invalid result (Processing file '....\temp\xxx.bat' failed because the file does not have a '.ps1' extension. Specify a valid powershell file script name and try again.)

Can I somehow manipulate what extension is given to the script in Hostmonitor ?
KS-Soft
Posts: 12903
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

If you copy powershell.exe to some other location or create link to it, everything should work fine.
E.g. if you link powershell and specify command line like
c:\win64tools\powershell.exe -file %Script% %Params%
it will work fine

Regards
Alex
stephan88
Posts: 2
Joined: Mon Dec 05, 2011 12:10 pm

Post by stephan88 »

Thanks... that worked.
Post Reply