Environment  获取 OSversion:

$OSVersion = [System.Environment]::OSVersion.Version

WMI获取Caption:

$OSCaption = (Get-WmiObject -class Win32_OperatingSystem).Caption

版本转换获取小版本号[Version]:

$IsWindowsServer2012Env = ([version]$scriptargs.OSVersion).Major -eq 6 -and ([version]$scriptargs.OSVersion).Minor -eq 2 -and $scriptargs.OSCaption -like "*Windows Server 2012 *"

判断hotfix是否安排:

$IsHotfix2896660InstalledEnv =(Get-HotFix | Where-Object{$_.HotFixID -eq "KB2896660"}) -ne $null

相关文章:

  • 2022-12-23
  • 2021-11-06
  • 2021-12-31
  • 2021-11-28
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2021-06-21
猜你喜欢
  • 2021-05-17
  • 2021-07-10
  • 2021-09-07
  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
相关资源
相似解决方案