Deploying Powershell Script to uninstall application RRS feed

  • Question

  • Basically I want to deploy a powershell script that uninstalls an application in a computer lab. The problem is that the script will successfully deploy and software center will show the status as "installed" but program would still be installed on the machine. After doing some testing it seems that only the first line of the script is being executed but not the second line. I confirmed this by watching the script run in realtime on the machine I deployed it to. I know for a fact that the powershell script works fine as it sucessfully uninstalls the program when I run it locally on a machine without using sccm. Below is the powershell script that i am using and the command that I use in sccm when deploying the script. Is anybody else having this problem or know a solution?

    The powershell script (UninstallApp.ps1) that I would like to use is below:

    $app = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -match "Vision" }

    The command that I use in the command line is below:

    powershell.exe -executionpolicy bypass -file .\UninstallApp.ps1

    Wednesday, July 25, 2012 5:20 PM


All replies