title: PS1 uninstallation script in SCCM
body: <p>I'm a nub scripter and am trying to write a really simple script to taskkill 2 programs and then uninstall 1 of them. </p>
  
  <p>I wrote it in Powershell and stuck it in SCCM for deployment...however every time I deploy it, it's not running the last line to uninstall the program. </p>
  
  <p>Here's the code: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code># Closing Outlook instance
  #
  taskkill /IM outlook.exe /F
  #
  # Closing Linkpoint instance
  #
  taskkill /IM LinkPointAssist.exe /F
  #
  # Uninstalling Linkpoint via uninstall string if in Program Files
  #
  MsiExec.exe /X {DECDCD14-DEF6-49ED-9440-CC5E562FDC41} /qn
  #
  # Uninstalling Linkpoint via WmiObject if installed manually in AppData
  Get-WmiObject -class win32_product -Filter "Name like '%Linkpoint%'" | ForEach-Object { $_.Uninstall()}
  #
  Exit</code></pre>
  </div>
  </div>
  </p>
  
  <p>Can someone help? SCCM says the script completes with no error and I know it's able to execute it since the taskkills work...but it's not uninstalling the program.</p>
  
  <p>Thanks in advance for any input.</p>