ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Removing Windows Installed Packages with Powershell

    IT Discussion
    powershell uninstall windows application management bloat how to
    3
    8
    933
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DustinB3403D
      DustinB3403
      last edited by DustinB3403

      From time to time you'll want to remove an application from your system (say from the Windows App Store) that has appeared on your system without you knowing why, when or how.

      You could of course use the Microsoft App store to do this, but who wants to open that nightmare....

      Here's how you can find and remove an application (package) from Windows using PowerShell.

      $Bloat = Read-Host -Prompt "Supply at least a partial name of the app to remove"
      Get-AppxPackage -AllUsers | Where-Object {$_.name -Like "*$Bloat*"} | Select Name, InstallLocation 
      Get-AppxPackage -AllUsers | Where-Object {$_.name -Like "*$Bloat*"} | Remove-AppxPackage
      

      In my case I wanted to remove some new HP Application called JumpStarts which installed over the evening hours.

      Using the above, you'll be prompted for the App name (title bar) or some portion of it so you can search for it, and then PowerShell will remove the application.

      This will remove things that don't appear in Add and Remove Programs (Appwiz.cpl).

      If you want to uninstall applications that are in Add and Remove Programs you can use this (I haven't refined it as much yet as I was just getting it sorted out)

      $SEARCH = 'Advanced IP Scanner 2.5'
      $RESULT =$INSTALLED | ?{ $_.DisplayName -ne $null } | Where-Object {$_.DisplayName -match $search } 
      $RESULT
      
      if ($RESULT.uninstallstring -like "msiexec*") {
      $ARGS=(($RESULT.UninstallString -split ' ')[1] -replace '/I','/X ') + ' /q'
      Start-Process msiexec.exe -ArgumentList $ARGS -Wait
      } else {
      Start-Process $RESULT.UninstallString -Wait
      }
      
      1 Reply Last reply Reply Quote 1
      • DustinB3403D
        DustinB3403
        last edited by

        Of course with Chocolatey installation of and removal of applications is much easier, and applications installed through Chocolatey do not apply to the above.

        Since it's a customer Package Manager that doesn't tie in with the above processes.

        DashrenderD 1 Reply Last reply Reply Quote 0
        • DashrenderD
          Dashrender @DustinB3403
          last edited by

          I don't see the first post having much to do with the second... Assuming you're using Cholocately, you likely need to know both of these things, because you likely want to remove that Window Store crap regardless.
          😉

          DustinB3403D 1 Reply Last reply Reply Quote 0
          • DustinB3403D
            DustinB3403 @Dashrender
            last edited by

            @dashrender Except the two are completely unrelated and you can't uninstall an app that was installed with Chocolatey with the original post.

            Hence the second post helping to make that distinction.

            gjacobseG 1 Reply Last reply Reply Quote 0
            • gjacobseG
              gjacobse @DustinB3403
              last edited by

              @dustinb3403 said in Removing Windows Installed Packages with Powershell:

              @dashrender Except the two are completely unrelated and you can't uninstall an app that was installed with Chocolatey with the original post.

              Hence the second post helping to make that distinction.

              Please don't take this the wrong way - I think you walked into this one. From your initial post / statement I would never have put Bloat in with Chocolatey. Chocolatey is completely separate and unrelated to Bloat.

              While I'm curious to see what MS Crapware it'll remove, But I install / Uninstall Chocolatey with Chocolatey...

              Sorry - I don't intend to 'join' the wagon and begin the hashing out of things... just a thought.

              DustinB3403D 1 Reply Last reply Reply Quote 0
              • DustinB3403D
                DustinB3403 @gjacobse
                last edited by DustinB3403

                @gjacobse said in Removing Windows Installed Packages with Powershell:

                @dustinb3403 said in Removing Windows Installed Packages with Powershell:

                @dashrender Except the two are completely unrelated and you can't uninstall an app that was installed with Chocolatey with the original post.

                Hence the second post helping to make that distinction.

                Please don't take this the wrong way - I think you walked into this one. From your initial post / statement I would never have put Bloat in with Chocolatey. Chocolatey is completely separate and unrelated to Bloat.

                While I'm curious to see what MS Crapware it'll remove, But I install / Uninstall Chocolatey with Chocolatey...

                Sorry - I don't intend to 'join' the wagon and begin the hashing out of things... just a thought.

                I'm not offended at all, what I don't see is how @Dashrender and @travisdh1 don't see what I'm specifically addressing here, with the original post.

                This is different ways to manage different package management tools on Windows. The Windows App Store, the classic Add and Remove (Appwiz.cpl) and then of course Chocolatey.

                If you attempt to remove an application that was installed with Chocolatey with the OP's top method, the application won't be removed. Hence me calling it out.

                Edit: Or attempt to remove an AppWiz.cpl application with the Top OP method that won't work either.

                Each of the two solutions are for different package management systems within the Windows environment.

                DashrenderD 1 Reply Last reply Reply Quote 0
                • DashrenderD
                  Dashrender @DustinB3403
                  last edited by

                  @dustinb3403

                  Sure, but to Gene's point - you're not going to be installing crapware with Chocolatey - but the MS Store pre-loads your machine with a shit ton, and really, the only way to get rid of if all is using PowerShell.

                  I love the first post for info sake itself... I just don't see the need to mention Choco in the same thread - it serves an entirely different purpose - not to mention the fact that it isn't even loaded by default, so if it's there - YOU know it's there.

                  DustinB3403D 1 Reply Last reply Reply Quote 0
                  • DustinB3403D
                    DustinB3403 @Dashrender
                    last edited by

                    @dashrender said in Removing Windows Installed Packages with Powershell:

                    @dustinb3403

                    Sure, but to Gene's point - you're not going to be installing crapware with Chocolatey - but the MS Store pre-loads your machine with a shit ton, and really, the only way to get rid of if all is using PowerShell.

                    I love the first post for info sake itself... I just don't see the need to mention Choco in the same thread - it serves an entirely different purpose - not to mention the fact that it isn't even loaded by default, so if it's there - YOU know it's there.

                    And again, you know how to install and uninstall applications with Chocolatey.

                    But you may not know (or want to know how to learn to use Microsoft's App Store) and maybe you prefer to use a shell to remove applications from add and remove.

                    While you know what you've installed with Choco, doesn't mean you know how to remove programs like in the OP which, again installed during the evening hours without me having installed it.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post