I'm trying to figure out the correct way to call a PowerShell script outside of Opalis. I've had soOo much trouble trying to run PowerShell scripts within the Opalis "Run .Net Code" object (scripts that otherwise work fine outside of Opalis) that I figured it would just be easier to write my PoSH script and run it by passing some parameters from Opalis. Turns out even THIS is not as easy as I would expect. :)
Here is what I have tried (all using the "Run Program" object):
Computer: localhost Program path: C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe "E:\OpalisScripts\recycle_app_pools.ps1 -Computer {NetbiosComputerName from Monitor SCOM Alert} -BadPool {MonitoringObjectName from Monitor SCOM Alert}" Parameters: Working Folder: E:\OpalisScripts Computer: localhost Program path: C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe "E:\OpalisScripts\recycle_app_pools.ps1" Parameters: - Computer {NetbiosComputerName from Monitor SCOM Alert} - BadPool {MonitoringObjectName from Monitor SCOM Alert} Working Folder: E:\OpalisScripts Computer: localhost Program path: C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe E:\OpalisScripts\recycle_app_pools.ps1 Parameters: - Computer {NetbiosComputerName from Monitor SCOM Alert} - BadPool {MonitoringObjectName from Monitor SCOM Alert} Working Folder: E:\OpalisScripts Computer: localhost Program path: powershell.exe E:\OpalisScripts\recycle_app_pools.ps1 Parameters: - Computer {NetbiosComputerName from Monitor SCOM Alert} - BadPool {MonitoringObjectName from Monitor SCOM Alert} Working Folder: E:\OpalisScripts
None of these work, I have no idea what it wants... any suggestions? :(
- Edited by Reza.Rezilient Monday, November 22, 2010 11:28 PM typo