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

所属分类: 脚本专栏 / PowerShell 阅读数: 841
收藏 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 Out-File禁止覆盖文件的方法

这篇文章主要介绍了PowerShell Out-File禁止覆盖文件的方法,只要加一个NoClobber参数即可,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell Out-File向只读文件写入内容的方法

这篇文章主要介绍了PowerShell Out-File向只读文件写入内容的方法,只需要加一个-Force参数即可,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell Out-File指定文件编码的方法

这篇文章主要介绍了PowerShell Out-File指定文件编码的方法,例如怎样创建一个UTF-8编码的文件,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell Out-File追加字符串到文件末尾的方法

这篇文章主要介绍了PowerShell Out-File追加字符串到文件末尾的方法,只要加一个-Append参数即可实现追加内容需求,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell中使用Out-File把字符串或运行结果保存到文件的方法

这篇文章主要介绍了PowerShell中使用Out-File把字符串或运行结果保存到文件的方法,重点在于Out-File命令的使用方法上,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell面向对象编程基础知识总结

这篇文章主要介绍了PowerShell面向对象编程基础知识总结,本文着重讲解面向对象的一些概念,又给出了Get-Member命令输出类的属性和方法的例子,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell中调用.NET对象的静态方法、静态属性和类方法、类属性例子

这篇文章主要介绍了PowerShell中调用.NET对象的静态方法、静态属性和类方法、类属性例子,即PowerShell中如何使用.NET对象的一些方法,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell中的变量基础知识介绍

这篇文章主要介绍了PowerShell中的变量基础知识介绍,本文的知识点是需要牢记的,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell获取系统环境变量的方法

这篇文章主要介绍了PowerShell获取系统环境变量的方法,本文讲解了列出所有的环境变量的方法和获取环境变量的值的方法,需要的朋友可以参考下
收藏 0 赞 0 分享

PowerShell中定义多行字符串变量的方法

这篇文章主要介绍了PowerShell中定义多行字符串变量的方法,本文介绍PowerShell中如何定义一个跨多行的字符串变量,需要的朋友可以参考下
收藏 0 赞 0 分享
查看更多