Add Powershell support as a bundle action

Idea ID 2790514

Add Powershell support as a bundle action

We can do bat, vbscript, perl etc as a run script action but if you want to run a PowerShell script then you need to run one action to create the script, one to run PowerShell then another to cleanup the script you copied down.

Powershell has become so prevalent on Windows devices that a specific bundle action type seems justified. Or extend the run script action...
10 Comments
Absent Member.
Absent Member.
I couldn't agree more!!
Absent Member.
Absent Member.
A Powershell support would be nice. Chad: We are using powershell a lot but we don't create script files. What we are doing in bundles is: Add a "Run Script". The script is a normal .bat where we put the word "powershell" in the front of every powershell command. For example: powershell Set-ExecutionPolicy Bypass powershell .... powershell Set-ExecutionPolicy Restricted This works fine with Windows 10...
Absent Member.
Absent Member.
What I do for my powershell scripts that I deploy via ZENworks is I create an (install/launch) action of type Run Script. I define my own script, paste in my powershell script into the script contents, and give it an extension of .ps1. The tricks I use to get it to run on every machine, regardless of the execution policy, is this: I set the Path to Script Engine to "${WINDIR}\System32\WindowsPowerShell\v1.0\powershell.exe" and then parameters for the script engine to "-ExecutionPolicy Bypass"
New Member.
Also make all ZMAN functions available via powershell natively and support Windows Server Core.
Absent Member.
Absent Member.
This is how I run Powershell from ZENworks :- Action Type : Run Script Script Content : Your PS Script. Script file extention : .ps1 (NOTE:You just type this in.) Path to script Engine : %comspec% Script Engine Parameters: /c C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -executionpolicy unrestricted (NOTE : Script Engine Parameters MUST HAVE a space at the end.) https://shaundunmall.wordpress.com/to-run-a-powershell-script-from-zenworks/
Absent Member.
Absent Member.
+1 for embracing Powershell. Not only on Windows, but on Linux and Mac too.
Absent Member.
Absent Member.
I agree. And add network credentials option to launch script action in bundles as it is in launch executable
Absent Member.
Absent Member.
Please add this!!! I'm now using powershell quite heavily on Windows and Mac.
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor
Status changed to: Delivered

This idea has been delivered as part of ZENworks 2020 Update 1. ZENworks always supported Powershell. However, now a .ps option is available when defining your own script option

Trusted Contributor.
Trusted Contributor.

Some powershell users make use of a powershell profile. The default settings load the powershell profile each time a powershell process starts. Sometimes the powershell profile of a user interfer with the powershell script being run as a script action which gives rise to unexpected behavior.

Much more often than not (I think) it's not necessary or wanted to load the users powershell profile when running a script action.

The powershell script action should therefore include the -noprofile parameter as a default parameter which is prefilled in the parameters box.

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.