locked
Another Powershell question (Script Run vs Package Deployment) RRS feed

  • Question

  • Hi Gurus,

    I've been searching for a couple of weeks now, across as many posts as i can find online, but i still cannot find a solution to this.

    Basically we have a PS Script to uninstall Firefox below specific versions covering CVE work. When i add the script into SCCM as a script approver, i can deploy that script to a collection live and the outcome works as expected. Firefox is removed on my test system without any issue.

    When i attempt to deploy the same script as a package to a collection, it fails to uninstall firefox. Either i get the script was successful or there is a failure/retry message.

    When i run the PS script directly from the CCMCache folder, it works as expected.

    I've made a basic powershell script package beforehand that created a folder in the root of C: and that worked. Was just testing my theories before trying something more advanced.

    Here is the package command line syntax i have tried:

    powershell.exe -executionpolicy bypass ".\uninstallfirefox.ps1"

    powershell.exe -executionpolicy bypass -file ".\uninstallfirefox.ps1"

    powershell.exe -executionpolicy bypass -command ".\uninstallfirefox.ps1"

    I've used various combinations with ' and " characters and also without any quotes and i am getting no where lol

    Any help on where i can start looking or checking would be great.

    NOTE: when using powershell.exe -executionpolicy bypass -file ".\uninstallfirefox.ps1" i see the powershell terminal launch on my test laptop, it appears to be running based on the task manager cpu usage for a few seconds and then vanishes.

    I am trying to understand the differences between the script being deployed directly from the site server on a collection versus the package deployment process. They should both be working in the same manner i guess?

    Thanks for you help and guidance in advance!

    Saturday, July 11, 2020 5:54 PM

All replies

  • Just looked at an existing deployment where the content of the source is a powershell script, and 1 file referenced by that script.

    Here's what is in the Deployment Type, Install line:

    Powershell.exe -ExecutionPolicy Bypass -File "Install.ps1"



    Standardize. Simplify. Automate.

    Monday, July 13, 2020 12:52 PM