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

所属分类: 脚本专栏 / PowerShell 阅读数: 864
收藏 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隐藏不显示窗口的多种方法

这篇文章主要介绍了PowerShell隐藏不显示窗口的多种方法,本文讲解了启动PowerShell时隐藏自己的窗口、在PowerShell启动其它进程时隐藏窗口、使用PowerShell隐藏其它进程的窗口三种方法,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell启用winrm失败:拒绝访问 0x80070005 -2147024891

这篇文章主要介绍了PowerShell启用winrm失败:拒绝访问 0x80070005 -2147024891,本文给出了详细的排查步骤和解决方法,需要的朋友可以参考下
收藏 0 赞 0 分享

Powershell目录文件夹管理权限的继承和指定方法

这篇文章主要介绍了Powershell目录文件夹管理权限的继承和指定方法,本文给出了创建文件夹、获取当前权限、添加新的权限、添加管理员权限等,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell查看本机文件关联程序和默认打开程序的方法

这篇文章主要介绍了PowerShell查看本机文件关联程序和默认打开程序的方法,本文给出了查看方法,同时给出了一份读取结果,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell脚本反引号用法实例:随时随地给代码换行

这篇文章主要介绍了PowerShell脚本反引号用法实例:随时随地给代码换行,在遇到一些超长代码行时非常有用,一般编程代码一行的字符数不超过80个哦,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell 数组的多种录入方法

这篇文章主要介绍了PowerShell 数组的多种录入方法,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell String对象方法小结

这篇文章主要介绍了PowerShell String对象方法,需要的朋友可以参考下
收藏 0 赞 0 分享

使用PowerShell获取当前主机内存使用量和总量的方法

这篇文章主要介绍了使用PowerShell获取当前主机内存使用量和总量的方法,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell批量修改AD用户密码属性的代码

这篇文章主要介绍了PowerShell批量修改AD用户密码属性的代码,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell 自动备份oracle并上传到ftp

我这里有这样一个需求:有一个数据库,每天使用SQL Server Agent自动生成备份文件。然后,这个数据库非常重要,需要把每天的备份上传一个远程的FTP服务器上去。下面我们来看看如何使用Powershell来实现吧
收藏 0 赞 0 分享
查看更多