一个csv文件
"Released","Name","Version"
"November 2009","SP2010 Public Beta 2","14.0.4536.1000"
"October 2009","SP2010 (Tech Preview #2 - used for Ignite training)","14.0.0.4514"
"July 2009","SP 2010 (Tech Preview)","14.0.4006.1030"
一个ps1文件
$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$buildstr = $farm.BuildVersion.ToString()
$vertable = Import-Csv versions.csv
$vertable | where-object {$_.Version -eq $buildstr}
结果
Released Name Version
-------- ---- -------
November 2009 SP2010 Public Beta 2 14.0.4536.1000
如果SPS2010还没有加入Powershell,使用以下命令
Add-PSSnapin Microsoft.SharePoint.Powershell