PowerShell Script (.PS1) Deployment through EM module

Modified on Sun, 16 Mar at 5:32 PM

Solution:

To deploy a PowerShell script using SecPod, you can leverage software deployment through the Endpoint Management (EM) module. Follow the steps below for a successful deployment:

Steps to Deploy a PowerShell Script:

  1. Prepare the Script for Deployment:
    • Create a ZIP file containing the .PS1 script.
  2. Upload the Script to SecPod:
    • Navigate to EM -> Actions -> Software Deployment.

A screenshot of a computer

AI-generated content may be incorrect.

    • Click on the Upload button.

A screenshot of a computer

AI-generated content may be incorrect.

    • Select the option Compressed (ZIP/GZIP/TAR) Installer Package.

A screenshot of a computer

AI-generated content may be incorrect.

    • Upload the ZIP file.
  1. Edit the Uploaded Package:
    • Locate the uploaded script under the User Uploaded section.
    • Click on the Exclamatory icon to edit the package. (Refer to the screenshot for details.)

A screenshot of a computer

AI-generated content may be incorrect.

  1. Update the Required Fields:
    • Ensure the following fields are configured correctly:
      • Silent Option: Not required for PS1 scripts.
      • Extract Location: Specify where the script should be extracted.
      • Run File Name: Enter the name of the PowerShell script file.
  2. Install the Script:
    • Select the ZIP file and click on the Install icon.

A screenshot of a computer

AI-generated content may be incorrect.

    • Choose the target devices for installation and click Next.

A screenshot of a computer

AI-generated content may be incorrect.

    • Provide task details such as Task Name, Schedule, etc., and click on Create Installation Task.

A screenshot of a computer

AI-generated content may be incorrect.

 

Handling PowerShell Execution Policy:

By default, PowerShell scripts may be restricted from running due to execution policies. To address this, you have two options:

  1. Run the following command on the target device manually:

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force

  1. Include the following line within the script to bypass execution restrictions:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force

 

Conclusion:

By following these steps, you can successfully deploy a PowerShell script using EM module.

 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article