Repository navigation
feat: colorized console output + per-site progress bar (3.4.0) - #60
Merged
Merged
Conversation
Add Write-SpsLine / Write-SpsRule visual helpers and route the per-site run lines and the end-of-run summary through them: colored status tags (site, jit, ok, skip, warn, deny) + a framed summary block. Color is ANSI via $PSStyle, emitted ONLY on an interactive VT console ($script:UseColor gates on: not Azure Automation, PSStyle present, output not redirected, host SupportsVirtualTerminal). Azure Automation, redirected/piped output and non-VT hosts get a plain ASCII fallback; OutputRendering='Host' keeps Start-Transcript logs ANSI-free. results.json and the HTML report are unchanged (built from $script:RunResults), and the machine-readable '--- SPSCleanVersions finished: ... ---' anchor line is kept. Also rapatriate the per-site Write-Progress bar (Site X of N + percent) from the earlier feat/write-progress spike, gated out of Azure Automation. Write-Warning/Write-Error lines are intentionally left as-is. 195 Pester pass (+5 visual/progress tests). POC previewer _poc-visual.ps1 gitignored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cosmetic 3.4.0 (MINOR): colourized run output with a safe plain-text fallback, plus a per-site progress bar. Validated live on the demo tenant (see run: colored tags + framed summary + progress bar).
What changed
Write-SpsLine/Write-SpsRulehelpers. Per-site lines and the end-of-run summary now carry coloured status tags: site (cyan),[jit ]grant/revoke (magenta),[ ok ]applied (green),[skip]skipped/compliant (grey),[warn]/[deny]. Plus a framed summary block.$PSStyle, emitted only when$script:UseColor= (not Azure Automation) AND ($PSStyle present) AND (output not redirected) AND (host SupportsVirtualTerminal). Azure Automation, redirected/piped output and non-VT hosts get a plain ASCII fallback;OutputRendering='Host'keepsStart-Transcriptlogs ANSI-free (verified).Write-Progress,Site X of N+ percent), suppressed under Azure Automation.results.jsonand the HTML report are built from$script:RunResults(untouched); the machine-readable--- SPSCleanVersions finished: … ---anchor line is kept;Write-Warning/Write-Errorleft as-is;Get-TenantSiteUrlsstill returns a clean array (usesWrite-Verbose).Tests
195 Pester pass (+5: Write-SpsLine plain/colour, Write-SpsRule, progress gating).
.ps1UTF-8 BOM + CRLF preserved.Targeted for 3.4.0 (release cut separately).