Commit b273a4b
feat(scripts): add Get-StandardTimestamp utility to CIHelpers module (#1126)
## Description
Added a `Get-StandardTimestamp` function to `CIHelpers.psm1` that
returns the current UTC time as an ISO 8601 string
(`2025-01-15T18:30:00.0000000Z`). Five different timestamp expressions
existed across linting and security scripts with no shared utility,
making cross-script log correlation unreliable. This function provides a
single, authoritative source for consistent, timezone-unambiguous
timestamps across all scripts.
## Related Issue(s)
Closes #993
## Type of Change
Select all that apply:
**Code & Documentation:**
* [ ] Bug fix (non-breaking change fixing an issue)
* [x] New feature (non-breaking change adding functionality)
* [ ] Breaking change (fix or feature causing existing functionality to
change)
* [ ] Documentation update
**Infrastructure & Configuration:**
* [ ] GitHub Actions workflow
* [ ] Linting configuration (markdown, PowerShell, etc.)
* [ ] Security configuration
* [ ] DevContainer configuration
* [ ] Dependency update
**Other:**
* [x] Script/automation (`.ps1`, `.sh`, `.py`)
* [ ] Other (please describe):
## Testing
All validation was performed:
* `npm run lint:ps` — Passed. All PowerShell files pass PSScriptAnalyzer
checks with no issues.
* `npm run test:ps` — Passed. 73/73 Pester tests pass, including all 4
new `Get-StandardTimestamp` tests:
* `Returns a string`
* `Returns a non-empty value`
* `Matches ISO 8601 UTC format ending in Z`
* `Returns monotonically increasing timestamps on consecutive calls`
* Security analysis: No sensitive data, new dependencies, or privilege
scope changes detected.
* No manual testing required for this change; the function has no
external side effects or I/O.
## Checklist
### Required Checks
* [x] Documentation is updated (if applicable)
* [x] Files follow existing naming conventions
* [x] Changes are backwards compatible (if applicable)
* [x] Tests added for new functionality (if applicable)
### Required Automated Checks
The following validation commands must pass before merging:
* [x] Markdown linting: `npm run lint:md`
* [x] Spell checking: `npm run spell-check`
* [x] Frontmatter validation: `npm run lint:frontmatter`
* [x] Skill structure validation: `npm run validate:skills`
* [x] Link validation: `npm run lint:md-links`
* [x] PowerShell analysis: `npm run lint:ps`
* [x] Plugin freshness: `npm run plugin:generate`
## Security Considerations
<!-- 1 parent fdf1bcf commit b273a4b
File tree
2 files changed
+49
-0
lines changed- scripts
- lib/Modules
- tests/lib
2 files changed
+49
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
553 | 574 | | |
| 575 | + | |
554 | 576 | | |
555 | 577 | | |
556 | 578 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
18 | 45 | | |
19 | 46 | | |
20 | 47 | | |
| |||
0 commit comments