PSWindowsUpdate icon indicating copy to clipboard operation
PSWindowsUpdate copied to clipboard

Region settins for script is set to US

Open HiFi66 opened this issue 1 year ago • 0 comments

Hi

There is problem when scheduling remote computer windows update, this is because script will use us-en region settings for time and date

Install-WindowsUpdate -ComputerName test1 -MicrosoftUpdate -Install -AcceptAll -Verbose VERBOSE: test1 (16.8.2024 14.57.19): Connecting to Microsoft Update server. Please wait... VERBOSE: Found [5] Updates in pre search criteria VERBOSE: Found [5] Updates in post search criteria

X ComputerName Result KB Size Title


1 test1 Accepted KB890830 71MB Windows Malicious Software Removal Tool x64 - v5.127 (KB890830)
1 test1 Accepted KB5042350 84MB 2024-08 Cumulative Update for .NET Framework 3.5, 4.7.2 and 4.8 for Windows Server 2019 for x64 (KB5042350)
1 test1 Accepted KB5043465 85MB AzureConnectedMachineAgent Version 1.45 - August 2024 Update
1 test1 Accepted KB2267602 1GB Security Intelligence Update for Microsoft Defender Antivirus - KB2267602 (Version 1.417.151.0) - Current Channel (Broad)
1 test1 Accepted KB5040430 17GB 2024-07 Cumulative Update for Windows Server 2019 (1809) for x64-based Systems (KB5040430)
VERBOSE: Accepted [5] Updates ready to Download VERBOSE: Invoke-WUJob: PSWindowsUpdate test1 (Now): VERBOSE: powershell.exe -Command "Get-WindowsUpdate -AcceptAll -Criteria "(UpdateID = '45323849-eba1-4028-a097-3233edd9837c' and RevisionNumber = 200) or (UpdateID = '1972376f-909e-4d39-ad5e-a bc1e91b5645' and RevisionNumber = 200) or (UpdateID = 'ecc9c46e-073e-4dca-add3-bd082760f8e2' and RevisionNumber = 200) or (UpdateID = '09ad3ba8-16ca-4b25-96fb-ed2e5e38182c' and RevisionNumber = 200) or (UpdateID = 'aa240e89-ed0e-4420-a100-fd7d1d19a5d4' and RevisionNumber = 1)" -Download -Install -MicrosoftUpdate -IgnoreReboot -Verbose *>&1 | Out-File $Env:TEMP\PSWindowsUpdate.log" Install-WindowsUpdate : (10,44):StartBoundary:2024-08-16T14.57.55 At line:1 char:1

  • Install-WindowsUpdate -ComputerName test1 -MicrosoftUpdate -In ...
  •   + CategoryInfo          : NotSpecified: (:) [Get-WindowsUpdate], COMException
      + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,PSWindowsUpdate.GetWindowsUpdate
    
    

i can override this by setting culture to EN-US, but its very annoying to do that all the time. So if there would be like universal datetime or possibility to set time as string or something it would be nice

Thanks B.R HiFi

HiFi66 avatar Aug 16 '24 12:08 HiFi66