Jump to content

smcclos

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by smcclos

  1. The Update.zip has changed. Change the line: $ExpectedMD5 = "9235318c553c3f770ba95ab673566a4e" to this $ExpectedMD5 = "3930be0c42df65df80c2e5ac632126fe"
  2. I looked at this script, and it will always return "Operating system is not supported" because in the script $major and $minor are strings, I was able to confirm that with the commands: $major.GetType() IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True String System.Object $minor.GetType() IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True String System.Object I recommend updating the script to this, and I highlighted the changes: $version = (Get-WmiObject Win32_OperatingSystem).Version [int]$major = $version.split(".")[0] [int]$minor = $version.split(".")[1] if ($major -gt 6 -or ($major -eq 6 -and $minor -gt 1)) { Optimize-Volume -driveletter $pwd.drive.name -Analyze -verbos } Else { Write-Output "Operating system is not supported." } Here is the original script: $version = (Get-WmiObject Win32_OperatingSystem).Version $major = $version.split(".")[0] $minor = $version.split(".")[1] if ($major -gt 6 -or ($major -eq 6 -and $minor -gt 1)) { Optimize-Volume $pwd.drive.name -Analyze -verbos } Else { Write-Output "Operating system is not supported." } REF: https://learn.microsoft.com/en-us/powershell/module/storage/optimize-volume?view=windowsserver2022-ps REF: https://lazyadmin.nl/powershell/if-else-statements/ REF: https://theitbros.com/powershell-convert-string-to-int/
  3. The primary reason that I have Pulseway is for Patching.
×
×
  • Create New...