this is command /script line which runs the script, located on a remote share, on the BSA server.
Powershell.exe -ExecutionPolicy ByPass -InputFormat None -OutputFormat Text -NoLogo -NonInteractive -Command "//SERVER//SHARE//SCRIPTNAME.ps1 ??TARGET.NAME??"
put the scripts on some system.
write a wrapper in nsh that takes the args your powershell script needs and nexec's the powershell script on the server where you have powershell setup
use that wrapper script in your EO.
Now theirs an Idea Bill. Let me give it a go and get back to you.
That works! Thanks Bill. I now need to work on how I output the results from the script and the Grammar file to use.
I'm doing a simple write-host in in the powershell script with Grammar file /etc/auto_* file grammer (auto.gm) i.e:
write-host Name $var
So this works fine unless there is a space in the variable and then it sets multiple values i.e if variable contains 'Marks and Spence' i get
white-host Shop $var
Name Value 1 Value 2 Value 3
Shop Marks & Spence
anyone have a suggestion?
Most of my scripts output lists so I generally do something like:
$output | ConvertTo-Csv -NoTypeInformation | Select-Object -Skip 1
and just use the CSV grammar file. I use the Select-Object cmdlet to remove the header from the CSV output...
Thanks Greg, got that working now.