Windows10FeatureUpdates icon indicating copy to clipboard operation
Windows10FeatureUpdates copied to clipboard

Process-SetupDiag.ps1 error

Open clckr24 opened this issue 4 years ago • 0 comments

I had to change lines 187 and 189 or I got an Compliance error for Feature Update -ISetupDiag Results. If Setupdiag has never been run, you get an error.

New code starting at line 189 is:

If(Get-ItemProperty -Path $SetupDiagKeyPath -Name 'DateTime') { $NewDateTime = (Get-Date).GetDateTimeFormats()[72] $NewKey = New-ItemProperty -Path $SetupDiagKeyPath -Name 'DateTime' -Value $NewDateTime -PropertyType string -Force | Out-Null }

Get-item Property was missing the path and $NewKey | NewItemProperty was getting a pipeline error.

Added the -Path parameter on line 187 Change the $NewKey | to $NewKey = on line 189

This fixed the problem.

clckr24 avatar Feb 13 '21 14:02 clckr24