类似rpm包管理器的Windows Installer PowerShell Module简介

所属分类: 脚本专栏 / PowerShell 阅读数: 779
收藏 0 赞 0 分享

一、Windows Installer PowerShell Module简介

Windows Installer PowerShell Module是一个开源项目,存放在微软的开源项目网站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.查询系统已经安装的产品和补丁
2.查询源安装包信息
3.安装,修复和卸载产品和补丁
4.验证产品和补丁

下载与详细文档,可以参考项目主页:http://psmsi.codeplex.com/

更多精彩内容其他人还在看

PowerShell操作Excel、CSV详细介绍

这篇文章主要介绍了PowerShell操作Excel、CSV详解,本文比较深入的探讨了PowerShell中如何操作Excel及CSV,需要的朋友可以参考下
收藏 0 赞 0 分享

Powershell中显示隐藏文件的方法

这篇文章主要介绍了Powershell中显示隐藏文件的方法,本文使用是是Get-ChildItem检索文件,加上-Hidden参数就可以显示隐藏文件了,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell中iso8601格式日期和DateTime对象互转实例

这篇文章主要介绍了PowerShell中iso8601格式日期和DateTime对象互转实例,本文讲解了iso8601格式转换成DateTime对象、日期时间转换成iso8601格式两个方法,需要的朋友可以参考下
收藏 0 赞 0 分享

Powershell使用C#实现缩写路径

这篇文章主要介绍了Powershell使用C#实现缩写路径,缩写路径有时候是非常有用的,比如某些报表的路径太长会很难看,缩写后就会好看许多,需要的朋友可以参考下
收藏 0 赞 0 分享

Powershell截取字符串并添加省略号的例子

这篇文章主要介绍了Powershell截取字符串并添加省略号的例子,本文直接给出代码实例,需要的朋友可以参考下
收藏 0 赞 0 分享

Powershell读取本机注册表中的所有软件关联扩展名

这篇文章主要介绍了Powershell读取本机注册表中的所有软件关联扩展名,本文直接给出实现代码,需要的朋友可以参考下
收藏 0 赞 0 分享

Powershell实现按类型排序

这篇文章主要介绍了Powershell实现按类型排序,本文直接给出实现代码,需要的朋友可以参考下
收藏 0 赞 0 分享

Powershell中打开网页实例

这篇文章主要介绍了Powershell中打开网页实例,本文直接给出实现代码,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell实现获取进程所有者

这篇文章主要介绍了PowerShell实现获取进程所有者,本文直接给出实现代码,需要的朋友可以参考下
收藏 0 赞 0 分享

Windows Powershell Foreach 循环

Foreach-object 为cmdlet命令,使用在管道中,对管道结果逐个处理,foreach为遍历集合的关键字。
收藏 0 赞 0 分享
查看更多