Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process-SetupDiag.ps1 error #26

Open
clckr24 opened this issue Feb 13, 2021 · 0 comments
Open

Process-SetupDiag.ps1 error #26

clckr24 opened this issue Feb 13, 2021 · 0 comments

Comments

@clckr24
Copy link

clckr24 commented Feb 13, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant