- #Powershell script to install msi software how to#
- #Powershell script to install msi software windows#
I only need to do this once, and I will have the three pieces of information. The easy way to get this information is to use the Get-WmiObject cmdlet to query for the information. The Key property for Win32_Product is a composite key comprised of IdentifyingNumber, Name, and Version. The commands and the output from the commands are shown here. In the following code, I first import my HSGWMImoduleV6 module, and then I use the Get-WMIKey function to return the key to the Win32_Product WMI class. I can use the Get-WMIKey function from my HSGWMImoduleV6 module.
To connect to a specific instance, I must use the Key property of a WMI class. The problem is that the type accelerator returns a specific instance of a WMI class. It relies on using the type accelerator, instead of doing a generic WMI query. I immediately encouraged him to write a guest blog about this issue.īT, there is a way to use the Win32_Product WMI class in a more efficient manner.
#Powershell script to install msi software windows#
The Scripting Wife and I were in Texas for the Corpus Christi Windows PowerShell User Group meeting when Marc Carter told me about the problem with the MSI installer reconfiguring applications when the Win32_Product WMI class is queried. Microsoft Scripting Guy, Ed Wilson, is here. Is there any way to speed this thing up? I have to query over a thousand computers, and in our testing, this query takes nearly five minutes to complete-that would be three and a half days for only one query. I read the guest blog written by Marc Carter about problems using the Win32_Product WMI class, but it looks like I am going to be stuck using this anyway. Like I said, this is a really dumb application. I tried looking in the registry, but the install key is empty…figures. The company has released a new version of this application, and I am trying to write a Windows PowerShell script to uninstall the old application-the problem is that I need to find the application first. Hey, Scripting Guy! We have a dumb application that we have to use at work.
#Powershell script to install msi software how to#
Summary: Learn how to use Windows PowerShell to get software installation locations, and to uninstall software from remote computers.