類似rpm包管理器的Windows Installer PowerShell Module簡介
一、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.安裝,修復和卸載產(chǎn)品和補丁
4.驗證產(chǎn)品和補丁
下載與詳細文檔,可以參考項目主頁:http://psmsi.codeplex.com/
相關文章
PowerShell中的特殊變量$null介紹和創(chuàng)建多行注釋小技巧
這篇文章主要介紹了PowerShell中的特殊變量$null介紹和創(chuàng)建多行注釋小技巧,需要的朋友可以參考下2014-08-08PowerShell中使用Like運算符配合通配符查找字符串例子
這篇文章主要介紹了PowerShell中使用Like運算符配合通配符查找字符串例子,Like的返值為TRUE和FALSE,需要的朋友可以參考下2014-08-08PowerShell使用Remove-Item命令刪除文件、注冊表項介紹
這篇文章主要介紹了PowerShell使用Remove-Item命令刪除文件、注冊表項介紹,另外Remove-Item的別名也有很多,需要的朋友可以參考下2014-08-08PowerShell中查找字符串位置的IndexOf函數(shù)使用實例
這篇文章主要介紹了PowerShell中查找字符串位置的IndexOf函數(shù)使用實例,例子簡單明了,容易看懂,需要的朋友可以參考下2014-08-08PowerShell中使用Get-Alias命令獲取cmdlet別名例子
這篇文章主要介紹了PowerShell中使用Get-Alias命令獲取cmdlet別名的例子,PowerShell中兼容DOS下和Linux下的很多命令,這些都是靠別名來實現(xiàn)的,需要的朋友可以參考下2014-08-08Powershell使用WPF技術實現(xiàn)彈窗提示實例
這篇文章主要介紹了Powershell使用WPF技術實現(xiàn)彈窗提示實例,需要的朋友可以參考下2014-05-05PowerShell中運行CMD命令的技巧總結(jié)(解決名稱沖突和特殊字符等問題)
這篇文章主要介紹了PowerShell中運行CMD命令的技巧總結(jié)(解決名稱沖突和特殊字符等問題),需要的朋友可以參考下2014-05-05