Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/security/Modules/SecurityClasses.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class ComplianceReport {
[hashtable] ToHashtable() {
return @{
ScanPath = $this.ScanPath
Timestamp = $this.Timestamp.ToString('yyyy-MM-ddTHH:mm:ss.fffZ')
Timestamp = $this.Timestamp.ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ss.fffffffZ')
TotalFiles = $this.TotalFiles
ScannedFiles = $this.ScannedFiles
TotalDependencies = $this.TotalDependencies
Expand Down
2 changes: 1 addition & 1 deletion scripts/security/Test-DependencyPinning.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ function Get-ComplianceReportData {
$report.Metadata = @{
PowerShellVersion = $PSVersionTable.PSVersion.ToString()
Platform = $PSVersionTable.Platform
ScanTimestamp = $report.Timestamp.ToString('yyyy-MM-ddTHH:mm:ss.fffZ')
ScanTimestamp = $report.Timestamp.ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ss.fffffffZ')
IncludedTypes = $IncludeTypes
ExcludedPaths = $ExcludePaths
RemediationEnabled = $Remediate.IsPresent
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/security/SecurityClasses.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Describe 'ComplianceReport' -Tag 'Unit' {
}

It 'Formats Timestamp as ISO 8601 string' {
$script:ht['Timestamp'] | Should -Match '^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$'
$script:ht['Timestamp'] | Should -Match '^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3,7}Z$'
}

It 'Preserves numeric values' {
Expand Down
Loading