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

    Uninstalling Programs (Windows 10) Using Powershell

    Scheduled Pinned Locked Moved Solved Water Closet
    powershellwindows10virtualbox
    27 Posts 5 Posters 2.8k Views
    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.
    • scottalanmillerS
      scottalanmiller @WrCombs
      last edited by

      @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

      @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

      @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

      $app uninstall() is not an expression

      You are missing the period.

      $app.Uninstall()
      

      It's a method.

      0o8165E.png

      That's a totally different error. This is that your Get-WmiObject call is incorrect.

      WrCombsW 1 Reply Last reply Reply Quote 0
      • WrCombsW
        WrCombs @scottalanmiller
        last edited by

        @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

        @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

        @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

        @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

        $app uninstall() is not an expression

        You are missing the period.

        $app.Uninstall()
        

        It's a method.

        0o8165E.png

        That's a totally different error. This is that your Get-WmiObject call is incorrect.

        I noticed that as well

        1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller
          last edited by

          Try this instead:

          (Get-WmiObject -Class Win32_Product -Filter "Name='Oracle VM VirtualBox'" -ComputerName . ).Uninstall()
          
          1 Reply Last reply Reply Quote 0
          • scottalanmillerS
            scottalanmiller
            last edited by

            Now, I thought that you had installed this via Chocolatey, not the Windows installer, though. Based on other threads.

            WrCombsW 1 Reply Last reply Reply Quote 0
            • WrCombsW
              WrCombs @scottalanmiller
              last edited by

              @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

              Now, I thought that you had installed this via Chocolatey, not the Windows installer, though. Based on other threads.

              I did install via Chocolatey does that have something to do with it?

              scottalanmillerS 1 Reply Last reply Reply Quote 0
              • scottalanmillerS
                scottalanmiller @WrCombs
                last edited by

                @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

                @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                Now, I thought that you had installed this via Chocolatey, not the Windows installer, though. Based on other threads.

                I did install via Chocolatey does that have something to do with it?

                Yes, a lot. Chocolatey is its own package management system. So Get-WmiObject knows nothing about it and can't interact with it. It's not "installed" in Windows terms, it's just "sitting there."

                To uninstall something managed with Chocolatey you just do...

                choco uninstall packagename
                
                WrCombsW JaredBuschJ 2 Replies Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller
                  last edited by

                  Remember, Chocolatey brings simple package management to Windows via repos the way that all of the non-Windows world has worked for decades. None of that bizarre, complicated need to script basic tasks, it's just a trivial command away to install, update, uninstall, etc.

                  WrCombsW 1 Reply Last reply Reply Quote 0
                  • WrCombsW
                    WrCombs @scottalanmiller
                    last edited by

                    @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                    @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

                    @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                    Now, I thought that you had installed this via Chocolatey, not the Windows installer, though. Based on other threads.

                    I did install via Chocolatey does that have something to do with it?

                    Yes, a lot. Chocolatey is its own package management system. So Get-WmiObject knows nothing about it and can't interact with it. It's not "installed" in Windows terms, it's just "sitting there."

                    To uninstall something managed with Chocolatey you just do...

                    choco uninstall packagename
                    

                    That would make a whole lot of sense.

                    1 Reply Last reply Reply Quote 0
                    • WrCombsW
                      WrCombs @scottalanmiller
                      last edited by

                      @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                      Remember, Chocolatey brings simple package management to Windows via repos the way that all of the non-Windows world has worked for decades. None of that bizarre, complicated need to script basic tasks, it's just a trivial command away to install, update, uninstall, etc.

                      And now that you say something I remember there being a time I had to unistall... I over complicated that.

                      1 Reply Last reply Reply Quote 0
                      • JaredBuschJ
                        JaredBusch @scottalanmiller
                        last edited by

                        @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                        @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

                        @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                        Now, I thought that you had installed this via Chocolatey, not the Windows installer, though. Based on other threads.

                        I did install via Chocolatey does that have something to do with it?

                        Yes, a lot. Chocolatey is its own package management system. So Get-WmiObject knows nothing about it and can't interact with it. It's not "installed" in Windows terms, it's just "sitting there."

                        Actually, no. It is almost always there for windows to see. Because most chocolatey installs actually use the default windows installer. Just with a /silent switch (or whatever is appropriate).

                        scottalanmillerS WrCombsW 2 Replies Last reply Reply Quote 0
                        • scottalanmillerS
                          scottalanmiller @JaredBusch
                          last edited by

                          @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                          @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                          @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

                          @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                          Now, I thought that you had installed this via Chocolatey, not the Windows installer, though. Based on other threads.

                          I did install via Chocolatey does that have something to do with it?

                          Yes, a lot. Chocolatey is its own package management system. So Get-WmiObject knows nothing about it and can't interact with it. It's not "installed" in Windows terms, it's just "sitting there."

                          Actually, no. It is almost always there for windows to see. Because most chocolatey installs actually use the default windows installer. Just with a /silent switch (or whatever is appropriate).

                          Oh, I thought it never did that. I must have just worked with a few that didn't.

                          JaredBuschJ 1 Reply Last reply Reply Quote 0
                          • JaredBuschJ
                            JaredBusch @scottalanmiller
                            last edited by

                            @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                            @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                            @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                            @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

                            @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                            Now, I thought that you had installed this via Chocolatey, not the Windows installer, though. Based on other threads.

                            I did install via Chocolatey does that have something to do with it?

                            Yes, a lot. Chocolatey is its own package management system. So Get-WmiObject knows nothing about it and can't interact with it. It's not "installed" in Windows terms, it's just "sitting there."

                            Actually, no. It is almost always there for windows to see. Because most chocolatey installs actually use the default windows installer. Just with a /silent switch (or whatever is appropriate).

                            Oh, I thought it never did that. I must have just worked with a few that didn't.

                            Chocolatey does not put anything in there. But since most packages are just using the normal installer in silent mode, it is generally there.

                            scottalanmillerS 1 Reply Last reply Reply Quote 1
                            • scottalanmillerS
                              scottalanmiller @JaredBusch
                              last edited by

                              @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                              @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                              @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                              @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                              @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

                              @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                              Now, I thought that you had installed this via Chocolatey, not the Windows installer, though. Based on other threads.

                              I did install via Chocolatey does that have something to do with it?

                              Yes, a lot. Chocolatey is its own package management system. So Get-WmiObject knows nothing about it and can't interact with it. It's not "installed" in Windows terms, it's just "sitting there."

                              Actually, no. It is almost always there for windows to see. Because most chocolatey installs actually use the default windows installer. Just with a /silent switch (or whatever is appropriate).

                              Oh, I thought it never did that. I must have just worked with a few that didn't.

                              Chocolatey does not put anything in there. But since most packages are just using the normal installer in silent mode, it is generally there.

                              Makes sense.

                              ObsolesceO 1 Reply Last reply Reply Quote 0
                              • ObsolesceO
                                Obsolesce @scottalanmiller
                                last edited by

                                @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                                @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                                @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

                                @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                Now, I thought that you had installed this via Chocolatey, not the Windows installer, though. Based on other threads.

                                I did install via Chocolatey does that have something to do with it?

                                Yes, a lot. Chocolatey is its own package management system. So Get-WmiObject knows nothing about it and can't interact with it. It's not "installed" in Windows terms, it's just "sitting there."

                                Actually, no. It is almost always there for windows to see. Because most chocolatey installs actually use the default windows installer. Just with a /silent switch (or whatever is appropriate).

                                Oh, I thought it never did that. I must have just worked with a few that didn't.

                                Chocolatey does not put anything in there. But since most packages are just using the normal installer in silent mode, it is generally there.

                                Makes sense.

                                It's like that with every package I've installed. One example is salt minion. If you install that with chocolatey, then uninstall it via Windows control panel, then try installing it again with Chocolatey, Chocolatey thinks it's still installed because doing it through Windows never tells Chocolatey it was installed. You have to use the force switch to install it again with Chocolatey.

                                The same goes for all Chocolatey packages I've used... 7zip, Firefox, Chrome, etc.

                                scottalanmillerS black3dynamiteB 2 Replies Last reply Reply Quote 0
                                • scottalanmillerS
                                  scottalanmiller @Obsolesce
                                  last edited by

                                  @obsolesce said in Uninstalling Programs (Windows 10) Using Powershell:

                                  @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                  @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                                  @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                  @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                                  @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                  @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

                                  @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                  Now, I thought that you had installed this via Chocolatey, not the Windows installer, though. Based on other threads.

                                  I did install via Chocolatey does that have something to do with it?

                                  Yes, a lot. Chocolatey is its own package management system. So Get-WmiObject knows nothing about it and can't interact with it. It's not "installed" in Windows terms, it's just "sitting there."

                                  Actually, no. It is almost always there for windows to see. Because most chocolatey installs actually use the default windows installer. Just with a /silent switch (or whatever is appropriate).

                                  Oh, I thought it never did that. I must have just worked with a few that didn't.

                                  Chocolatey does not put anything in there. But since most packages are just using the normal installer in silent mode, it is generally there.

                                  Makes sense.

                                  It's like that with every package I've installed. One example is salt minion. If you install that with chocolatey, then uninstall it via Windows control panel, then try installing it again with Chocolatey, Chocolatey thinks it's still installed because doing it through Windows never tells Chocolatey it was installed. You have to use the force switch to install it again with Chocolatey.

                                  The same goes for all Chocolatey packages I've used... 7zip, Firefox, Chrome, etc.

                                  A bit like deleting files and then the RPM database has no idea what has happened.

                                  1 Reply Last reply Reply Quote 0
                                  • black3dynamiteB
                                    black3dynamite @Obsolesce
                                    last edited by black3dynamite

                                    @obsolesce said in Uninstalling Programs (Windows 10) Using Powershell:

                                    @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                    @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                                    @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                    @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                                    @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                    @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

                                    @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                    Now, I thought that you had installed this via Chocolatey, not the Windows installer, though. Based on other threads.

                                    I did install via Chocolatey does that have something to do with it?

                                    Yes, a lot. Chocolatey is its own package management system. So Get-WmiObject knows nothing about it and can't interact with it. It's not "installed" in Windows terms, it's just "sitting there."

                                    Actually, no. It is almost always there for windows to see. Because most chocolatey installs actually use the default windows installer. Just with a /silent switch (or whatever is appropriate).

                                    Oh, I thought it never did that. I must have just worked with a few that didn't.

                                    Chocolatey does not put anything in there. But since most packages are just using the normal installer in silent mode, it is generally there.

                                    Makes sense.

                                    It's like that with every package I've installed. One example is salt minion. If you install that with chocolatey, then uninstall it via Windows control panel, then try installing it again with Chocolatey, Chocolatey thinks it's still installed because doing it through Windows never tells Chocolatey it was installed. You have to use the force switch to install it again with Chocolatey.

                                    The same goes for all Chocolatey packages I've used... 7zip, Firefox, Chrome, etc.

                                    We would have to purchase Pro or Business license for Chocolatey in order for it to know if packages was removed.

                                    Package Synchronizer - Automatic Sync - keep installed packages synced up with software they are tracking when upgrades and uninstalls are performed outside of Chocolatey!

                                    ObsolesceO 1 Reply Last reply Reply Quote 0
                                    • ObsolesceO
                                      Obsolesce @black3dynamite
                                      last edited by

                                      @black3dynamite said in Uninstalling Programs (Windows 10) Using Powershell:

                                      @obsolesce said in Uninstalling Programs (Windows 10) Using Powershell:

                                      @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                      @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                                      @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                      @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                                      @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                      @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

                                      @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                      Now, I thought that you had installed this via Chocolatey, not the Windows installer, though. Based on other threads.

                                      I did install via Chocolatey does that have something to do with it?

                                      Yes, a lot. Chocolatey is its own package management system. So Get-WmiObject knows nothing about it and can't interact with it. It's not "installed" in Windows terms, it's just "sitting there."

                                      Actually, no. It is almost always there for windows to see. Because most chocolatey installs actually use the default windows installer. Just with a /silent switch (or whatever is appropriate).

                                      Oh, I thought it never did that. I must have just worked with a few that didn't.

                                      Chocolatey does not put anything in there. But since most packages are just using the normal installer in silent mode, it is generally there.

                                      Makes sense.

                                      It's like that with every package I've installed. One example is salt minion. If you install that with chocolatey, then uninstall it via Windows control panel, then try installing it again with Chocolatey, Chocolatey thinks it's still installed because doing it through Windows never tells Chocolatey it was installed. You have to use the force switch to install it again with Chocolatey.

                                      The same goes for all Chocolatey packages I've used... 7zip, Firefox, Chrome, etc.

                                      We would have to purchase Pro or Business license for Chocolatey in order for it to know if packages was removed.

                                      Package Synchronizer - Automatic Sync - keep installed packages synced up with software they are tracking when upgrades and uninstalls are performed outside of Chocolatey!

                                      That would be handy. Do they have a trial for testing?

                                      black3dynamiteB 1 Reply Last reply Reply Quote 0
                                      • black3dynamiteB
                                        black3dynamite @Obsolesce
                                        last edited by black3dynamite

                                        @obsolesce said in Uninstalling Programs (Windows 10) Using Powershell:

                                        @black3dynamite said in Uninstalling Programs (Windows 10) Using Powershell:

                                        @obsolesce said in Uninstalling Programs (Windows 10) Using Powershell:

                                        @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                        @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                                        @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                        @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                                        @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                        @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

                                        @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                        Now, I thought that you had installed this via Chocolatey, not the Windows installer, though. Based on other threads.

                                        I did install via Chocolatey does that have something to do with it?

                                        Yes, a lot. Chocolatey is its own package management system. So Get-WmiObject knows nothing about it and can't interact with it. It's not "installed" in Windows terms, it's just "sitting there."

                                        Actually, no. It is almost always there for windows to see. Because most chocolatey installs actually use the default windows installer. Just with a /silent switch (or whatever is appropriate).

                                        Oh, I thought it never did that. I must have just worked with a few that didn't.

                                        Chocolatey does not put anything in there. But since most packages are just using the normal installer in silent mode, it is generally there.

                                        Makes sense.

                                        It's like that with every package I've installed. One example is salt minion. If you install that with chocolatey, then uninstall it via Windows control panel, then try installing it again with Chocolatey, Chocolatey thinks it's still installed because doing it through Windows never tells Chocolatey it was installed. You have to use the force switch to install it again with Chocolatey.

                                        The same goes for all Chocolatey packages I've used... 7zip, Firefox, Chrome, etc.

                                        We would have to purchase Pro or Business license for Chocolatey in order for it to know if packages was removed.

                                        Package Synchronizer - Automatic Sync - keep installed packages synced up with software they are tracking when upgrades and uninstalls are performed outside of Chocolatey!

                                        That would be handy. Do they have a trial for testing?

                                        https://chocolatey.org/contact
                                        Select Sales / Demo / Trial in Send message to

                                        1 Reply Last reply Reply Quote 0
                                        • WrCombsW
                                          WrCombs @JaredBusch
                                          last edited by

                                          @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                                          @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                          @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

                                          @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                          Now, I thought that you had installed this via Chocolatey, not the Windows installer, though. Based on other threads.

                                          I did install via Chocolatey does that have something to do with it?

                                          Yes, a lot. Chocolatey is its own package management system. So Get-WmiObject knows nothing about it and can't interact with it. It's not "installed" in Windows terms, it's just "sitting there."

                                          Actually, no. It is almost always there for windows to see. Because most chocolatey installs actually use the default windows installer. Just with a /silent switch (or whatever is appropriate).

                                          so by this information, one of the above commands should have worked?

                                          JaredBuschJ scottalanmillerS 2 Replies Last reply Reply Quote 0
                                          • JaredBuschJ
                                            JaredBusch @WrCombs
                                            last edited by

                                            @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

                                            @jaredbusch said in Uninstalling Programs (Windows 10) Using Powershell:

                                            @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                            @wrcombs said in Uninstalling Programs (Windows 10) Using Powershell:

                                            @scottalanmiller said in Uninstalling Programs (Windows 10) Using Powershell:

                                            Now, I thought that you had installed this via Chocolatey, not the Windows installer, though. Based on other threads.

                                            I did install via Chocolatey does that have something to do with it?

                                            Yes, a lot. Chocolatey is its own package management system. So Get-WmiObject knows nothing about it and can't interact with it. It's not "installed" in Windows terms, it's just "sitting there."

                                            Actually, no. It is almost always there for windows to see. Because most chocolatey installs actually use the default windows installer. Just with a /silent switch (or whatever is appropriate).

                                            so by this information, one of the above commands should have worked?

                                            Generally speaking, yes. But as noted, you should never have been doing it that way. You should always use the package manager that you used to install it in the first place. That is the point of using a package manager.

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