一、Windows Installer PowerShell Module簡介
Windows Installer PowerShell Module是一個開源項目,存放在微軟的開源項目網(wǎng)站CodePlex上,下面是其主頁上項目描述。
代碼如下:
Project Description
Exposes Windows Installer functionality to PowerShell, providing means to query installed product and patch information and to query views on packages.
PowerShell is a powerful command shell that pipes objects - not just text. Because of this ability, you can string practically unrelated commands together in many different ways to work on different types of objects, all built on .NET. You can use all the properties and methods of those objects passed through the pipeline instead of being limited by the text sent to you as with traditional command shells.
This Windows Installer module for PowerShell provides cmdlets ("command-lets") - similar to functions - to query package states, patches registered and applied to products, and more. You can use it to query Windows Installer products and patches installed on your system.
get-msiproductinfo | where { $_.Name -like '*Visual Studio*' }
You can even use it to determine which products installed a particular file on your system.
get-msicomponentinfo `
| where { $_.Path -like 'C:/Program Files/*/Common7/IDE/devenv.exe'} `
| get-msiproductinfo
And with new cmdlets in 2.2.0 you can also install, repair, and uninstall products and patches complete with progress information, and warnings and errors direct to the pipeline.
install-msiproduct ./example.msi -destination (join-path $env:ProgramFiles Example)
You can find more Examples and usage in the Documentation.
二、Windows Installer PowerShell Module主要功能:
1.查詢系統(tǒng)已經(jīng)安裝的產(chǎn)品和補丁
2.查詢源安裝包信息
3.安裝,修復(fù)和卸載產(chǎn)品和補丁
4.驗證產(chǎn)品和補丁
下載與詳細文檔,可以參考項目主頁:http://psmsi.codeplex.com/
新聞熱點
疑難解答
圖片精選