Powershell 获取文件版本信息
2013-11-21 17:31
225 查看
获取文件版本信息,通过FileVersionInfo::GetVersioninfo(file) 来获取信息
function Check-DdpstoreFileVersion
{
$DdpstorePath = Join-Path $Env:windir "System32\Ddpstore.dll"
if(Test-Path $DdpstorePath)
{
$DdpStoreFileVersionObj = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($DdpstorePath)
if($DdpStoreFileVersionObj)
{
$DdpStoreFileVersion = "{0}.{1}.{2}.{3}" -f $DdpStoreFileVersionObj.FileMajorPart,$DdpStoreFileVersionObj.FileMinorPart,$DdpStoreFileVersionObj.FileBuildPart,$DdpStoreFileVersionObj.FilePrivatePart
$scriptenv.IsRequiredUpdateForDdpstoreEnv = [version]$DdpStoreFileVersion -lt [version]"6.2.9200.20842"
}
}
}
function Check-DdpstoreFileVersion
{
$DdpstorePath = Join-Path $Env:windir "System32\Ddpstore.dll"
if(Test-Path $DdpstorePath)
{
$DdpStoreFileVersionObj = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($DdpstorePath)
if($DdpStoreFileVersionObj)
{
$DdpStoreFileVersion = "{0}.{1}.{2}.{3}" -f $DdpStoreFileVersionObj.FileMajorPart,$DdpStoreFileVersionObj.FileMinorPart,$DdpStoreFileVersionObj.FileBuildPart,$DdpStoreFileVersionObj.FilePrivatePart
$scriptenv.IsRequiredUpdateForDdpstoreEnv = [version]$DdpStoreFileVersion -lt [version]"6.2.9200.20842"
}
}
}
相关文章推荐
- FileInfo 0.0.0003--masm32写的获取文件属性、版本、时间、MD5值等信息的小程序
- VB.Net 获取文件详细信息(版本、公司等)
- 【VB.NET】获取文件版本信息
- delphi获取Exe文件版本信息的函数[转]
- 获取文件版本信息
- Powershell - 获取OS版本信息和catpion信息
- Android笔记之获取apk文件包名、版本信息
- 获取文件版本信息
- 利用反射获取.DLL文件中的属性和方法以及版本信息
- 利用WinAPI(GetFileVersionInfo)获取文件版本信息
- 获取Exe文件版本信息的函数(使用GetFileVersionInfo得到TFileVersionInfo结构体,包含12项内容)
- 获取一个文件的版本信息
- java通过解析文件获取apk版本等信息
- 一行命令获取文件版本信息
- 使用Windows API实现运行时动态获取程序文件版本信息
- 获取手机上apk文件信息类,主要是判断是否安装再手机上了,安装的版本比较现有apk版本信息
- 获取文件或者动态库版本信息
- 获取文件版本信息
- vc代码获取文件版本信息
- sharepoint 2007 获取启用特定数量历史版本文件的信息(站点/最后更新时间/author/修改者/版本数/大小)