摘要:
Environment 获取 OSversion:$OSVersion = [System.Environment]::OSVersion.VersionWMI获取Caption:$OSCaption = (Get-WmiObject -class Win32_OperatingSystem).Caption版本转换获取小版本号[Version]:$IsWindowsServer2012Env = ([version]$scriptargs.OSVersion).Major -eq 6 -and ([version]$scriptargs.OSVersion).Minor -eq 2 -and 阅读全文
摘要:
用InstallState来判断function Check-DataDeduplication{Import-Module "ServerManager" -ErrorAction SilentlyContinueif((Get-Module "ServerManager") -and (Get-WindowsFeature -name FS-Data-Deduplication -ErrorAction SilentlyContinue)){$scriptenv.IsExistDataDeduplicationEnv = (Get-WindowsFe 阅读全文
摘要:
获取文件版本信息,通过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($DdpStoreFileVer 阅读全文