Skip to content

added CDXML CIM datetime test - #4796

Merged
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:cdxml-datetime
Sep 19, 2017
Merged

Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:cdxml-datetime

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Sep 10, 2017 •

Copy link
Copy Markdown
Member

Part of #4169

Adds coverage to https://codecov.io/gh/PowerShell/PowerShell/src/ee0bb15b71738eb4ab67cd81d3deca182417116c/src/System.Management.Automation/utils/ClrFacade.cs

To make sure the test runs successfully on any machine in any timezone, needed to create the test mof during runtime with current UTC offset

@daxian-dbw

Copy link
Copy Markdown
Member

James Truher (@JamesWTruher) Could you please review this PR when you have time? Thanks!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks great

$result = MofComp.exe ${script:createMof}
$testMof = Get-Content -Path ${script:createmof} -Raw
$currentTimeZone = [System.TimeZoneInfo]::Local
$UTCOffset = ($currentTimeZone.GetUtcOffset([datetime]::new(2008, 01, 01, 0, 0, 0))).TotalMinutes.ToString()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if the 1/1/2008 date was special (since I hadn't got to the MOF change). Perhaps a comment indicating that this date is reflected in the MOF file.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a comment that this date is not special but matches what is in the mof

@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 66552a4 into PowerShell:master Sep 19, 2017
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the cdxml-datetime branch October 16, 2017 21:54
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
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

Successfully merging this pull request may close these issues.

4 participants