Worklet - Uninstall Notepad++

  • 22 April 2021
  • 0 replies
  • 107 views

Userlevel 4

Hi all, here’s a Worklet to uninstall Notepad++ (we now use Visual Studio Code)


Evaluation:


if (Test-Path -Path "C:\Program Files\Notepad++") 
{
Write-Output "Notepad++ not installed, skipping"
exit 0
}
else
{
Write-Output "Notepad++ installed, we will uninstall"
Exit 1
}

Remediation:


Write-Output "Notepad++ installed, now removing" 
Start-Process -FilePath "C:\program files\notepad++\uninstall.exe" -ArgumentList "/S" -WindowStyle Hidden -Verbose
Remove-Item "C:\program files\notepad++" -Confirm:$false -Verbose
Write-Output "Notepad++ uninstalled"

0 replies

Be the first to reply!

Reply