Delivering a package to run a Powershell script. The delivery stops asking for permission to run the script showing a Security Warning

book

Article ID: 18465

calendar_today

Updated On:

Products

CA Client Automation - IT Client Manager CA Client Automation CA Client Automation - Software Delivery

Issue/Introduction

Delivering a package to run a Powershell script. The delivery stops asking for permission to run the script showing a Security Warning:

Security Warning
Run only scripts that you trust. While scripts from the Internet can be useful, this script can potentially harm your computer.
Do you want to run Z:\activate\B0E40622-CA09-444C-A51D-2C148E0F2214.itm\1.vol\myscript.ps1?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"):

Environment

Client Automation - All Versions.

Resolution

When the Software Delivery agent is configured to run procedures from the Software Library share (Internal NOS download method), the script is stored on the mapped drive (in this example Z:). Powershell does not allow the execution of the script from the mapped drive and the security warning is displayed.

Modify the procedure script to copy the Powershell script from the package to a local directory like %Temp% and execute it. Example:

copy .\myscript.ps1 %Temp%
powershell %Temp%\myscript.ps1