Private/Write-NSPConditionalAccessTaskIntro.ps1
|
function Write-NSPConditionalAccessTaskIntro { <# .SYNOPSIS Dashboard: starts a task screen. Clears it, shows the title and tenant, and explains what the task does and what comes next. .DESCRIPTION -Text lines are the explanation. A line starting with '- ' is a bullet, one starting with '! ' a caution (shown in the warning color), and one starting with '> ' a next step. #> [CmdletBinding()] param( [Parameter(Mandatory)]$Session, [Parameter(Mandatory)][string]$Title, [string[]]$Text ) Clear-NSPConsole $tenant = if ($Session.State -and $Session.State.TenantDomain) { $Session.State.TenantDomain } else { [string]$Session.TenantId } Write-NSPConsoleHeader -Title $Title -Subtitle $tenant foreach ($line in $Text) { if ($line -like '! *') { Write-NSPConsoleLine " $($line.Substring(2))" -Role Warning } elseif ($line -like '> *') { Write-NSPConsoleSegment -Segment @(@(' > ', 'Key'), $line.Substring(2)) } elseif ($line -like '- *') { Write-NSPConsoleSegment -Segment @(@(' * ', 'Muted'), $line.Substring(2)) } else { Write-NSPConsoleLine " $line" } } Write-NSPConsoleLine '' } |