Skip to content

Enable-CredentialGuard.ps1 Not Creating Valid TimeStamp for Cmtrace #5

@BaddMann

Description

@BaddMann

Was looking at the logs and noticed that here in Arizona this happens:
Get-WmiObject -Class Win32_TimeZone | Select-Object -ExpandProperty Bias
Gives us
-420

A negative value added to the end of the $Time string can not be parsed by the Cmtrace tool.

so on line 57 I added an Absolute Value Function to the result:
$Time = -join @((Get-Date -Format "HH:mm:ss.fff"), "+", [math]::abs((Get-WmiObject -Class Win32_TimeZone | Select-Object -ExpandProperty Bias)))

I have no idea if this is the right thing to do, I just know it's the quick fix I had to put in place, I'm sure you have a better answer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions