码迷,mamicode.com
首页 > 其他好文 > 详细

sharepoint 版本信息查看

时间:2015-04-24 12:19:03      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:

#检查版本:
# PowerShell script to display SharePoint products from the registry.

Param(
# decide on whether all the sub-components belonging to the product should be shown as well
[switch]$ShowComponents
)

# location in registry to get info about installed software

$RegLoc = Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall

# Get SharePoint Products and language packs

write-host "Products and Language Packs"
write-host "-------------------------------------------"

$Programs = $RegLoc |
where-object { $_.PsPath -like "*\Office*" } |
foreach {Get-ItemProperty $_.PsPath}
$Components = $RegLoc |
where-object { $_.PsPath -like "*1000-0000000FF1CE}" } |
foreach {Get-ItemProperty $_.PsPath}

# output either just the info about Products and Language Packs
# or also for sub components

if ($ShowComponents.IsPresent)
{
$Programs | foreach {
$_ | fl DisplayName, DisplayVersion;

$productCodes = $_.ProductCodes;
$Comp = @() + ($Components |
where-object { $_.PSChildName -in $productCodes } |
foreach {Get-ItemProperty $_.PsPath});
$Comp | Sort-Object DisplayName | ft DisplayName, DisplayVersion -Autosize
}
}
else
{
$Programs | fl DisplayName, DisplayVersion
}

sharepoint 版本信息查看

标签:

原文地址:http://www.cnblogs.com/hqbird/p/4452753.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!