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:
- Prepare the Script for Deployment:
- Create a ZIP file containing the .PS1 script.
- Upload the Script to SecPod:
- Navigate to EM -> Actions -> Software Deployment.
- Click on the Upload button.
- Select the option Compressed (ZIP/GZIP/TAR) Installer Package.
- Upload the ZIP file.
- 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.)
- 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.
- Ensure the following fields are configured correctly:
- Install the Script:
- Select the ZIP file and click on the Install icon.
- Choose the target devices for installation and click Next.
- Provide task details such as Task Name, Schedule, etc., and click on Create Installation Task.
Handling PowerShell Execution Policy:
By default, PowerShell scripts may be restricted from running due to execution policies. To address this, you have two options:
- Run the following command on the target device manually:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force
- 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
Feedback sent
We appreciate your effort and will try to fix the article