Your method is probably the simplest way to handle Powershell scripts. You can then push the script down as part of the package and then run it immediately afterwards. If you so wish, you can also use an NSH script that runs and creates the Powershell script on the fly before running it, but it depends what you are trying to achieve.
Your problem with th script hanging is due to an API issue with Powershell, which means that it does not always handle input correctly when called via an API (as BSA does). To fix this, try adding the argument "-InputFormat none" to your powershell command. This should help.
If you search for this on the forums, there is another posting somewhere that links to an article explaining why this is the case, but I don't have it to hand at the moment.Regards,
1 of 1 people found this helpful
you should not need to use the job post- command here - you can create an 'external command' in the blpackage and put your commands in there as if you were running from the cmd prompt, w/ the -inputformat NONE that paul mentions.
you can also use a nsh script job, but that would mean echoing the powershell script contents into a file, and then calling nexec, then removing the file.
Thank you guys, -InputFormat None solved the problem. I tried looking thru the forums for some time, but couldn't find a solution.