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

所属分类: 脚本专栏 / PowerShell 阅读数: 889
收藏 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遍历文件、文件夹的方法,本文使用Get-ChildItem命令实现,需要的朋友可以参考下
收藏 0 赞 0 分享

使用PowerShell操作Windows服务的命令小结

这篇文章主要介绍了使用PowerShell操作Windows服务的命令小结,本文只是做了一个命令列表,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell中调用外部程序和进程操作命令例子

这篇文章主要介绍了PowerShell中调用外部程序和进程操作命令例子,给出了进程操作的一些命令和调用外部应用程序的方法,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell中正则表达式使用例子

这篇文章主要介绍了PowerShell中正则表达式使用例子,本文用实例来说明如何使用正则匹配到想要的内容,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell是什么?

这篇文章主要介绍了PowerShell是什么?本文解读了PowerShell的一些术语,对PowerShell做了一个完全介绍,需要的朋友可以参考下
收藏 0 赞 0 分享

Powershell直接脚本时出现无法加载文件因为禁止执行脚本

Powershell直接脚本时出现无法加载文件因为在此系统中禁止执行脚本,有关此问题的解决方法如下
收藏 0 赞 0 分享

Tornado中database模块被取消的替代方法

这篇文章主要介绍了Tornado中database模块被取消的替代方法,新的方法是使用torndb模块,需要的朋友可以参考下
收藏 0 赞 0 分享

Powershell学习笔记--使用正则表达式查找文件

本文介绍PowerShell中使用正则表达式的查找文件的方法,PowerShell的正则表达式与微软其它语言的正则表达式是一样的,使用非常方便。
收藏 0 赞 0 分享

Windows Powershell 介绍和安装

Powershell 是运行在windows机器上实现系统和应用程序管理自动化的命令行脚本环境。微软之所以将Powershell 定位为Power,并不是夸大其词,因为它完全支持对象。其可读性,易用性,可以位居当前所有shell之首。
收藏 0 赞 0 分享

Windows Powershell 自定义控制台

这篇文章主要介绍了Windows Powershell 自定义控制台,包括选项、字体、布局和颜色四个方面的自定义风格,希望对大家有所帮助
收藏 0 赞 0 分享
查看更多