Windows10FeatureUpdates icon indicating copy to clipboard operation
Windows10FeatureUpdates copied to clipboard

NewDateTime variable output may vary depending on culture settings

Open astratom opened this issue 4 years ago • 0 comments

Hi!

The following variable may be blank depending on culture settings: https://github.com/AdamGrossTX/Windows10FeatureUpdates/blob/6f195f81fb811338557d8afd96966abe6b755100/Templates/Process-SetupDiag.ps1#L186

See Remarks for explanation: DateTime.GetDateTimeFormats Method

Example: Open PowerShell, run: Set-Culture lt-LT Close & re-open PowerShell, run: (Get-Date).GetDateTimeFormats()[72] Output will be blank.

This causes the DateTime registry value in HKLM:\System\Setup\MoSetup\Volatile\SetupDiag to be blank which causes the discovery script of the CI Feature Update - SetupDiag Results to always be non-compliant. This means SetupDiag will run every time the CI runs.

I suggest replacing it with: $NewDateTime = Get-Date -Format G

astratom avatar May 17 '21 08:05 astratom