TechGenix’s PowerShell Basic Commands Blog $MyProgram = Get-WmiObject -Class Win32_Product | Where-Object'” Resources If you use “Microsoft”, you can end up with a bigger list! In general, make sure you pick the expressions and words that have the best chance to help you find the program you want. In the above example, you can ask PowerShell to narrow the list to programs that contain the word “Outlook” as this is a unique word. You can narrow it down using filters and regular expressions if you have an idea of your program’s name. The programs’ list above can look overwhelming, even on devices with just a few installed programs. PowerShell’s Get-WmiObject command returning a complete list of installed programs. Here is an example, the image below shows how Get-WmiObject displays the installed programs’ list. Avoid any confusion and see how PowerShell reads a software’s name and then, use this name exactly in your code to uninstall. What if it’s called “Microsoft Outlook 2019”? This mismatch will either throw an error message or the command will simply not execute. For example, you may use the words “Microsoft Outlook” in your code to uninstall Outlook from a computer. The catch is you must know the application’s exact name as PowerShell reads and displays it. Now, you may wonder what’s the need to get the list of installed applications ? After all, you only need to remove one application from the computer. Get-WmiObject -Class Win32_Product | Select-Object -Property Name Step 1: Get the List of Installed ApplicationsĪs a first step, get the list of applications installed on a computer. You can always use a For-each loop to extend it to a collection or array of PCs to iterate through every computer in the array and perform the same action. In this step-by-step guide, you’ll learn the commands to uninstall a software from a single computer. The second option is the Uninstall-Package, it’s a good choice for hidden programs and ones PowerShell doesn’t identify. Out of the two, the Uninstall() method is the most popular and the easiest option to remove well-known programs from a device. You can uninstall software using PowerShell in 2 ways, the Uninstall() method and the Uninstall-Package command. 2 Ways to Uninstall Software Using PowerShell You can combine these cmdlets into a custom script to perform the desired task – automating complex or time-consuming tasks. It comes with many built-in commands called cmdlets that perform a specific function or task. Microsoft PowerShell is a task automation and configuration manager consisting of a scripting language and a command-line prompt. Sounds simple, right? Let’s jump in and see how to uninstall software using PowerShell. This way, you can uninstall a program from thousands of PCs with just one script. The advantage is you can send any number of networked PCs an uninstall command. Thankfully, you can use PowerShell scripts to uninstall software. Logging into each device and uninstalling a program isn’t the most productive option. Imagine for a moment you’re an IT admin and want to remove programs from multiple computers. These options are convenient to remove a single program, they’re not scalable. We’ve done it mostly using the Control Panel or in some cases, if dealing with more complex suites, their own uninstall process. Most of us have uninstalled programs from our PCs. PowerShell can help you uninstall programs quickly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |