PSDevOps.format.ps1xml

<?xml version="1.0" encoding="utf-16"?>
<!-- Generated with EZOut 1.9.7: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<Configuration>
  <Controls>
    <Control>
      <Name>ADO.Service.Health.ServiceGeographies</Name>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <ExpressionBinding>
                <ScriptBlock>$moduleName = 'PSDevOps'

            do {
                $lm = Get-Module -Name $moduleName -ErrorAction Ignore
                if (-not $lm) { continue }
                if ($lm.FormatPartsLoaded) { break }
                $wholeScript = @(foreach ($formatFilePath in $lm.exportedFormatFiles) {
                    foreach ($partNodeName in Select-Xml -LiteralPath $formatFilePath -XPath "/Configuration/Controls/Control/Name[starts-with(., '$')]") {
                        $ParentNode = $partNodeName.Node.ParentNode
                        "$($ParentNode.Name)={
            $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBinding.ScriptBlock)}"
                    }
                }) -join [Environment]::NewLine
                New-Module -Name "${ModuleName}.format.ps1xml" -ScriptBlock ([ScriptBlock]::Create(($wholeScript + ';Export-ModuleMember -Variable *'))) |
                    Import-Module -Global
                $onRemove = [ScriptBlock]::Create("Remove-Module '${ModuleName}.format.ps1xml'")
                
                if (-not $lm.OnRemove) {
                    $lm.OnRemove = $onRemove
                } else {
                    $lm.OnRemove = [ScriptBlock]::Create($onRemove.ToString() + '' + [Environment]::NewLine + $lm.OnRemove)
                }
                $lm | Add-Member NoteProperty FormatPartsLoaded $true -Force
            
            } while ($false)
            
        
@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'Success' -NoClear) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock> -not @($_.geographies.Health -ne 'Healthy') </ScriptBlock>
                </ItemSelectionCondition>
                <ScriptBlock>
        "* $($_.id)"
    </ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'Success' ) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'Warning' -NoClear) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock> @($_.geographies.Health -ne 'Healthy')</ScriptBlock>
                </ItemSelectionCondition>
                <ScriptBlock>
        "* $($_.id)"
    </ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'Warning' ) -join ''</ScriptBlock>
              </ExpressionBinding>
              <NewLine />
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock> @($_.geographies.Health -ne 'Healthy')</ScriptBlock>
                </ItemSelectionCondition>
                <PropertyName>geographies</PropertyName>
                <EnumerateCollection />
                <CustomControlName>ADO.Service.Health.Geography</CustomControlName>
              </ExpressionBinding>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </Control>
    <Control>
      <Name>ADO.Service.Health.Geography</Name>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <ExpressionBinding>
                <ScriptBlock>$moduleName = 'PSDevOps'

            do {
                $lm = Get-Module -Name $moduleName -ErrorAction Ignore
                if (-not $lm) { continue }
                if ($lm.FormatPartsLoaded) { break }
                $wholeScript = @(foreach ($formatFilePath in $lm.exportedFormatFiles) {
                    foreach ($partNodeName in Select-Xml -LiteralPath $formatFilePath -XPath "/Configuration/Controls/Control/Name[starts-with(., '$')]") {
                        $ParentNode = $partNodeName.Node.ParentNode
                        "$($ParentNode.Name)={
            $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBinding.ScriptBlock)}"
                    }
                }) -join [Environment]::NewLine
                New-Module -Name "${ModuleName}.format.ps1xml" -ScriptBlock ([ScriptBlock]::Create(($wholeScript + ';Export-ModuleMember -Variable *'))) |
                    Import-Module -Global
                $onRemove = [ScriptBlock]::Create("Remove-Module '${ModuleName}.format.ps1xml'")
                
                if (-not $lm.OnRemove) {
                    $lm.OnRemove = $onRemove
                } else {
                    $lm.OnRemove = [ScriptBlock]::Create($onRemove.ToString() + '' + [Environment]::NewLine + $lm.OnRemove)
                }
                $lm | Add-Member NoteProperty FormatPartsLoaded $true -Force
            
            } while ($false)
            
        
@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'Success' -NoClear) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock> $_.Health -eq 'Healthy'</ScriptBlock>
                </ItemSelectionCondition>
                <ScriptBlock>
        " * $($_.Name) (Healthy)"
    </ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'Success' ) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'Warning' -NoClear) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock> $_.Health -ne 'Healthy'</ScriptBlock>
                </ItemSelectionCondition>
                <ScriptBlock>
        " * $($_.Name) ($($_.Health))"
    </ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'Warning' ) -join ''</ScriptBlock>
              </ExpressionBinding>
              <NewLine />
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </Control>
    <Control>
      <Name>${PSDevOps_Format-RichText}</Name>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <ExpressionBinding>
                <ScriptBlock>
    &lt;#
    .Synopsis
        Formats the text color of output
    .Description
        Formats the text color of output

        * ForegroundColor
        * BackgroundColor
        * Bold
        * Underline
    .Notes
        Stylized Output works in two contexts at present:
        * Rich consoles (Windows Terminal, PowerShell.exe, Pwsh.exe) (when $host.UI.SupportsVirtualTerminal)
        * Web pages (Based off the presence of a $Request variable, or when $host.UI.SupportsHTML (you must add this property to $host.UI))
    #&gt;
    [Management.Automation.Cmdlet("Format","Object")]
    [ValidateScript({
        $canUseANSI = $host.UI.SupportsVirtualTerminal
        $canUseHTML = $Request -or $host.UI.SupportsHTML -or $OutputMode -eq 'HTML'
        if (-not ($canUseANSI -or $canUseHTML)) { return $false}
        return $true
    })]
    param(
    # The input object
    [Parameter(ValueFromPipeline)]
    [PSObject]
    $InputObject,

    # The foreground color
    [string]$ForegroundColor,

    # The background color
    [string]$BackgroundColor,

    # If set, will render as bold
    [switch]$Bold,

    # If set, will render as italic.
    [Alias('Italics')]
    [switch]$Italic,

    # If set, will render as faint
    [switch]$Faint,

    # If set, will render as hidden text.
    [switch]$Hide,

    # If set, will render as blinking (not supported in all terminals or HTML)
    [switch]$Blink,

    # If set, will render as strikethru
    [Alias('Strikethrough', 'Crossout')]
    [switch]$Strikethru,

    # If set, will underline text
    [switch]$Underline,

    # If set, will double underline text.
    [switch]$DoubleUnderline,

    # If set, will invert text
    [switch]$Invert,
    # If set, will not clear formatting
    [switch]$NoClear
    )

    begin {
        $canUseANSI = $host.UI.SupportsVirtualTerminal
        $canUseHTML = $Request -or $host.UI.SupportsHTML -or $OutputMode -eq 'HTML'
        $knownStreams = @{
            Output='';Error='BrightRed';Warning='BrightYellow';
            Verbose='BrightCyan';Debug='Yellow';Progress='Cyan';
            Success='BrightGreen';Failure='Red';Default=''}
        $esc = [char]0x1b
        $standardColors = 'Black', 'Red', 'Green', 'Yellow', 'Blue','Magenta', 'Cyan', 'White'
        $brightColors = 'BrightBlack', 'BrightRed', 'BrightGreen', 'BrightYellow', 'BrightBlue','BrightMagenta', 'BrightCyan', 'BrightWhite'

        $n =0
        $cssClasses = @()
        $colorAttributes =
            @(:nextColor foreach ($hc in $ForegroundColor,$BackgroundColor) {
                $n++
                if (-not $hc) { continue }
                if ($hc[0] -eq $esc) {
                    if ($canUseANSI) {
                        $hc; continue
                    }
                }
        
                $ansiStartPoint = if ($n -eq 1) { 30 } else { 40 }
                if ($knownStreams.ContainsKey($hc)) {
                    $i = $brightColors.IndexOf($knownStreams[$hc])
                    if ($canUseHTML) {
                        $cssClasses += $hc
                    } else {
                        if ($i -ge 0 -and $canUseANSI) {
                            '' + $esc + "[1;$($ansiStartPoint + $i)m"
                        } else {
                            $i = $standardColors.IndexOf($knownStreams[$hc])
                            if ($i -ge 0 -and $canUseANSI) {
                                '' + $esc + "[1;$($ansiStartPoint + $i)m"
                            } elseif ($i -le 0 -and $canUseANSI) {
                                '' + $esc + "[$($ansistartpoint + 8):5m"
                            }
                        }
                    }
                    continue nextColor
                }
                elseif ($standardColors -contains $hc) {
                    for ($i = 0; $i -lt $standardColors.Count;$i++) {
                        if ($standardColors[$i] -eq $hc) {
                            if ($canUseANSI -and -not $canUseHTML) {
                                '' + $esc + "[$($ansiStartPoint + $i)m"
                            } else {
                                $cssClasses += $standardColors[$i]
                            }
                            continue nextColor
                        }
                    }
                } elseif ($brightColors -contains $hc) {
                    for ($i = 0; $i -lt $brightColors.Count;$i++) {
                        if ($brightColors[$i] -eq $hc) {
                            if ($canUseANSI -and -not $canUseHTML) {
                                '' + $esc + "[1;$($ansiStartPoint + $i)m"
                            } else {
                                $cssClasses += $standardColors[$i]
                            }
                            continue nextColor
                        }
                    }
                }
                elseif ($psStyle -and $psStyle.Formatting.$hc -and
                    $psStyle.Formatting.$hc -match '^\e') {
                    if ($canUseANSI -and -not $canUseHTML) {
                        $psStyle.Formatting.$hc
                    } else {
                        $cssClasses += "formatting-$hc"
                    }
                }
                elseif (-not $n -and $psStyle -and $psStyle.Foreground.$hc -and
                    $psStyle.Foreground.$hc -match '^\e' ) {
                    if ($canUseANSI -and -not $canUseHTML) {
                        $psStyle.Foreground.$hc
                    } else {
                        $cssClasses += "foreground-$hc"
                    }
                }
                elseif ($n -and $psStyle -and $psStyle.Background.$hc -and
                    $psStyle.Background.$hc -match '^\e') {
                    if ($canUseANSI -and -not $canUseHTML) {
                        $psStyle.Background.$hc
                    } else {
                        $cssClasses += "background-$hc"
                    }
                }

        
        
                if ($hc -and $hc -notmatch '^[\#\e]') {
                    $placesToLook=
                        @(if ($hc.Contains('.')) {
                            $module, $setting = $hc -split '\.', 2
                            $theModule = Get-Module $module
                            $theModule.PrivateData.Color,
                                $theModule.PrivateData.Colors,
                                $theModule.PrivateData.Colour,
                                $theModule.PrivateData.Colours,
                                $theModule.PrivateData.EZOut,
                                $global:PSColors,
                                $global:PSColours
                        } else {
                            $setting = $hc
                            $moduleColorSetting = $theModule.PrivateData.PSColors.$setting
                        })
        
                    foreach ($place in $placesToLook) {
                        if (-not $place) { continue }
                        foreach ($propName in $setting -split '\.') {
                            $place = $place.$propName
                            if (-not $place) { break }
                        }
                        if ($place -and "$place".StartsWith('#') -and 4,7 -contains "$place".Length) {
                            $hc = $place
                            continue
                        }
                    }
                    if (-not $hc.StartsWith -or -not $hc.StartsWith('#')) {
                        continue
                    }
                }
                $r,$g,$b = if ($hc.Length -eq 7) {
                    [int]::Parse($hc[1..2]-join'', 'HexNumber')
                    [int]::Parse($hc[3..4]-join '', 'HexNumber')
                    [int]::Parse($hc[5..6] -join'', 'HexNumber')
                }elseif ($hc.Length -eq 4) {
                    [int]::Parse($hc[1], 'HexNumber') * 16
                    [int]::Parse($hc[2], 'HexNumber') * 16
                    [int]::Parse($hc[3], 'HexNumber') * 16
                }
        
                if ($canUseHTML) {
                    if ($n -eq 1) { "color:$hc" }
                    elseif ($n -eq 2) { "background-color:$hc"}
                }
                elseif ($canUseANSI) {
                    if ($n -eq 1) { $esc+"[38;2;$r;$g;${b}m" }
                    elseif ($n -eq 2) { $esc+"[48;2;$r;$g;${b}m" }
                }
                
            })
        
        $styleAttributes = @() + $colorAttributes
        
        $styleAttributes += @(
            if ($Bold) {
                if ($canUseHTML) {"font-weight:bold"}
                elseif ($canUseANSI) { '' + $esc + "[1m" }
            }
            if ($Faint) {
                if ($canUseHTML) { "opacity:.5" }
                elseif ($canUseANSI) { '' + $esc + "[2m" }
            }
            if ($Italic) {
                if ($canUseHTML) { "font-weight:bold" }
                elseif ($canUseANSI) {'' + $esc + "[3m" }
            }
            
            if ($Underline -and -not $doubleUnderline) {
                if ($canUseHTML) { "text-decoration:underline"}
                elseif ($canUseANSI) {'' +$esc + "[4m" }
            }

            if ($Blink) {
                if ($canUseANSI) { '' +$esc + "[5m" }
            }

            if ($invert) {
                if ($canUseHTML) {"filter:invert(100%)"}
                elseif ($canUseANSI) { '' + $esc + "[7m"}
            }

            if ($hide) {
                if ($canUseHTML) {"opacity:0"}
                elseif ($canUseANSI) { '' + $esc + "[8m"}
            }
            
            if ($Strikethru) {
                if ($canUseHTML) {"text-decoration: line-through"}
                elseif ($canUseANSI) { '' +$esc + "[9m" }
            }
            
            if ($DoubleUnderline) {
                if ($canUseHTML) { "border-bottom: 3px double;"}
                elseif ($canUseANSI) {'' +$esc + "[21m" }
            }
            
        )
        
        $header =
            if ($canUseHTML) {
                "&lt;span$(
                    if ($styleAttributes) { " style='$($styleAttributes -join ';')'"}
                )$(
                    if ($cssClasses) { " class='$($cssClasses -join ' ')'"}
                )&gt;"
            } elseif ($canUseANSI) {
                $styleAttributes -join ''
            }
    }

    process {
        if ($header) {
            "$header" + "$(if ($inputObject) { $inputObject | Out-String})".Trim()
        }
        elseif ($inputObject) {
            ($inputObject | Out-String).Trim()
        }
    }

    end {
        
        if (-not $NoClear) {
            if ($canUseHTML) {
                "&lt;/span&gt;"
            }
            elseif ($canUseANSI) {
                if ($Bold -or $Faint -or $colorAttributes -match '\[1;') {
                    "$esc[22m"
                }
                if ($Italic) {
                    "$esc[23m"
                }
                if ($Underline -or $doubleUnderline) {
                    "$esc[24m"
                }
                if ($Blink) {
                    "$esc[25m"
                }
                if ($Invert) {
                    "$esc[27m"
                }
                if ($hide) {
                    "$esc[28m"
                }
                if ($Strikethru) {
                    "$esc[29m"
                }
                if ($ForegroundColor) {
                    "$esc[39m"
                }
                if ($BackgroundColor) {
                    "$esc[49m"
                }
            
                if (-not ($Underline -or $Bold -or $Invert -or $ForegroundColor -or $BackgroundColor)) {
                    '' + $esc + '[0m'
                }
            }
        }
    }
</ScriptBlock>
              </ExpressionBinding>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </Control>
    <Control>
      <Name>${PSDevOps_setOutputStyle}</Name>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <ExpressionBinding>
                <ScriptBlock>&lt;#
.Synopsis
    Adds style to a format output
.Description
    Adds style information to a format output, including:

    * ForegroundColor
    * BackgroundColor
    * Bold
    * Underline
.Notes
    Stylized Output works in two contexts at present:
    * Rich consoles (Windows Terminal, PowerShell.exe, Pwsh.exe) (when $host.UI.SupportsVirtualTerminal)
    * Web pages (Based off the presence of a $Request variable, or when $host.UI.SupportsHTML (you must add this property to $host.UI))

    IsFormatPart: true
#&gt;
param(
[string]$ForegroundColor,
[string]$BackgroundColor,
[switch]$Bold,
[switch]$Underline,
[switch]$Invert
)

$canUseANSI = $host.UI.SupportsVirtualTerminal
$canUseHTML = $Request -or $host.UI.SupportsHTML
if (-not ($canUseANSI -or $canUseHTML)) { return }

$knownStreams = @{
    Output='';Error='BrightRed';Warning='BrightYellow';
    Verbose='BrightCyan';Debug='Yellow';Progress='Cyan';
    Success='BrightGreen';Failure='Red';Default=''}
$standardColors = 'Black', 'Red', 'Green', 'Yellow', 'Blue','Magenta', 'Cyan', 'White'
$brightColors = 'BrightBlack', 'BrightRed', 'BrightGreen', 'BrightYellow', 'BrightBlue','BrightMagenta', 'BrightCyan', 'BrightWhite'
$n =0
$cssClasses = @()
$styleAttributes =
    @(:nextColor foreach ($hc in $ForegroundColor,$BackgroundColor) {
        $n++
        if (-not $hc) { continue }
        if ($hc[0] -eq [char]0x1b) {
            if ($canUseANSI) {
                $hc; continue
            }
        }

        $ansiStartPoint = if ($n -eq 1) { 30 } else { 40 }
        if ($knownStreams.ContainsKey($hc)) {
            $i = $brightColors.IndexOf($knownStreams[$hc])
            if ($canUseHTML) {
                $cssClasses += $hc
            } else {
                if ($i -ge 0 -and $canUseANSI) {
                    '' + [char]0x1b + "[1;$($ansiStartPoint + $i)m"
                } else {
                    $i = $standardColors.IndexOf($knownStreams[$hc])
                    if ($i -ge 0 -and $canUseANSI) {
                        '' + [char]0x1b + "[1;$($ansiStartPoint + $i)m"
                    } elseif ($i -le 0 -and $canUseANSI) {
                        '' + [char]0x1b + "[$($ansistartpoint + 8):5m"
                    }
                }
            }
            continue nextColor
        }
        elseif ($standardColors -contains $hc) {
            for ($i = 0; $i -lt $standardColors.Count;$i++) {
                if ($standardColors[$i] -eq $hc) {
                    if ($canUseANSI -and -not $canUseHTML) {
                        '' + [char]0x1b + "[$($ansiStartPoint + $i)m"
                    } else {
                        $cssClasses += $standardColors[$i]
                    }
                    continue nextColor
                }
            }
        } elseif ($brightColors -contains $hc) {
            for ($i = 0; $i -lt $brightColors.Count;$i++) {
                if ($brightColors[$i] -eq $hc) {
                    if ($canUseANSI -and -not $canUseHTML) {
                        '' + [char]0x1b + "[1;$($ansiStartPoint + $i)m"
                    } else {
                        $cssClasses += $standardColors[$i]
                    }
                    continue nextColor
                }
            }
        }


        if ($hc -and -not $hc.StartsWith('#')) {
            $placesToLook=
                @(if ($hc.Contains('.')) {
                    $module, $setting = $hc -split '\.', 2
                    $theModule = Get-Module $module
                    $theModule.PrivateData.Color,
                        $theModule.PrivateData.Colors,
                        $theModule.PrivateData.Colour,
                        $theModule.PrivateData.Colours,
                        $theModule.PrivateData.EZOut,
                        $global:PSColors,
                        $global:PSColours
                } else {
                    $setting = $hc
                    $moduleColorSetting = $theModule.PrivateData.PSColors.$setting
                })

            foreach ($place in $placesToLook) {
                if (-not $place) { continue }
                foreach ($propName in $setting -split '\.') {
                    $place = $place.$propName
                    if (-not $place) { break }
                }
                if ($place -and "$place".StartsWith('#') -and 4,7 -contains "$place".Length) {
                    $hc = $place
                    continue
                }
            }
            if (-not $hc.StartsWith -or -not $hc.StartsWith('#')) {
                continue
            }
        }
        $r,$g,$b = if ($hc.Length -eq 7) {
            [int]::Parse($hc[1..2]-join'', 'HexNumber')
            [int]::Parse($hc[3..4]-join '', 'HexNumber')
            [int]::Parse($hc[5..6] -join'', 'HexNumber')
        }elseif ($hc.Length -eq 4) {
            [int]::Parse($hc[1], 'HexNumber') * 16
            [int]::Parse($hc[2], 'HexNumber') * 16
            [int]::Parse($hc[3], 'HexNumber') * 16
        }

        if ($canUseHTML) {
            if ($n -eq 1) { "color:$hc" }
            elseif ($n -eq 2) { "background-color:$hc"}
        }
        elseif ($canUseANSI) {
            if ($n -eq 1) { [char]0x1b+"[38;2;$r;$g;${b}m" }
            elseif ($n -eq 2) { [char]0x1b+"[48;2;$r;$g;${b}m" }
        }
        
    })


if ($Bold) {
    $styleAttributes +=
        if ($canUseHTML) {
            "font-weight:bold"
        }
        elseif ($canUseANSI)
        {
            [char]0x1b + "[1m"
        }
}

if ($Underline) {
    $styleAttributes +=
        if ($canUseHTML) {
            "text-decoration:underline"
        } elseif ($canUseANSI) {
            [char]0x1b + "[4m"
        }
}

if ($Invert) {
    $styleAttributes +=
        if ($canUseHTML) {
            "filter:invert(100%)"
        } elseif ($canUseANSI) {
            [char]0x1b + "[7m"
        }
}

if ($canUseHTML) {
   
    "&lt;span$(
        if ($styleAttributes) { " style='$($styleAttributes -join ';')'"}
    )$(
        if ($cssClasses) { " class='$($cssClasses -join ' ')'"}
    )&gt;"
} elseif ($canUseANSI) {
    $styleAttributes -join ''
}</ScriptBlock>
              </ExpressionBinding>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </Control>
    <Control>
      <Name>${PSDevOps_clearOutputStyle}</Name>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <ExpressionBinding>
                <ScriptBlock>&lt;#
.Synopsis
    Clears the output style
.Description
    Clears ANSI output style or closes the most recent span element.

    ANSI stylization can be toggled off individually (for instance, to stop applying an -Underline but leave the color unchanged)
.Notes
    IsFormatPart: true
#&gt;
param(
# If set, will explicitly clear ANSI Bold
[switch]
$Bold,
# If set, will explicitly clear ANSI Underline
[switch]
$Underline,
# If set, will explicitly clear ANSI Invert
[switch]
$Invert,
# If set, will explicitly clear ANSI Foreground Color
[switch]
$ForegroundColor,
# If set, will explicitly clear ANSI Background Color
[switch]
$BackgroundColor
)
@(if ($request -or $host.UI.SupportsHTML) {
    "&lt;/span&gt;"
} elseif ($Host.UI.SupportsVirtualTerminal) {
    if ($Underline) {
        [char]0x1b + "[24m"
    }
    if ($Bold) {
        [char]0x1b + "[21m"
    }
    if ($Invert) {
        [char]0x1b + '[27m'
    }
    if ($ForegroundColor) {
        [char]0x1b + '[39m'
    }
    if ($BackgroundColor) {
        [char]0x1b + '[49m'
    }

    if (-not ($Underline -or $Bold -or $Invert -or $ForegroundColor -or $BackgroundColor)) {
        [char]0x1b + '[0m'
    }
    
}) -join ''</ScriptBlock>
              </ExpressionBinding>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </Control>
    <Control>
      <Name>${PSDevOps_HorizontalRule}</Name>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <ExpressionBinding>
                <ScriptBlock>&lt;#
.Synopsis
    Renders a HorizontalRule
.Description
    Renders a HorizontalRule.

    If $request or $host.UI.SupportsHTML, this will render a &lt;hr/&gt; tag.

    Otherwise, this will render a line filled with a given -Character (by default, a '-')
.Notes
    IsFormatPart: true
#&gt;
param(
# The Character used for a Horizontal Rule
[char]
$Character = '-',

# The CSS Class used for the Horizontal Rule (If ($request -or $host.SupportsHTML))
[string]
$Class
)
$canUseHTML = $Request -or $host.UI.SupportsHTML

if ($canUseHTML) {
    if (-not $Class) {
        '&lt;hr/&gt;'
    } else {
        "&lt;hr class='$class' /&gt;"
    }
    return
}

return (([string]$Character) * ($Host.UI.RawUI.BufferSize.Width - 1))
</ScriptBlock>
              </ExpressionBinding>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </Control>
  </Controls>
  <ViewDefinitions>
    <View>
      <Name>ADO.Service.Health</Name>
      <ViewSelectedBy>
        <TypeName>ADO.Service.Health</TypeName>
      </ViewSelectedBy>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <ExpressionBinding>
                <ScriptBlock>$moduleName = 'PSDevOps'

            do {
                $lm = Get-Module -Name $moduleName -ErrorAction Ignore
                if (-not $lm) { continue }
                if ($lm.FormatPartsLoaded) { break }
                $wholeScript = @(foreach ($formatFilePath in $lm.exportedFormatFiles) {
                    foreach ($partNodeName in Select-Xml -LiteralPath $formatFilePath -XPath "/Configuration/Controls/Control/Name[starts-with(., '$')]") {
                        $ParentNode = $partNodeName.Node.ParentNode
                        "$($ParentNode.Name)={
            $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBinding.ScriptBlock)}"
                    }
                }) -join [Environment]::NewLine
                New-Module -Name "${ModuleName}.format.ps1xml" -ScriptBlock ([ScriptBlock]::Create(($wholeScript + ';Export-ModuleMember -Variable *'))) |
                    Import-Module -Global
                $onRemove = [ScriptBlock]::Create("Remove-Module '${ModuleName}.format.ps1xml'")
                
                if (-not $lm.OnRemove) {
                    $lm.OnRemove = $onRemove
                } else {
                    $lm.OnRemove = [ScriptBlock]::Create($onRemove.ToString() + '' + [Environment]::NewLine + $lm.OnRemove)
                }
                $lm | Add-Member NoteProperty FormatPartsLoaded $true -Force
            
            } while ($false)
            
        
@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'Success' -NoClear) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock> $_.Status.Health -eq 'Healthy'</ScriptBlock>
                </ItemSelectionCondition>
                <ScriptBlock>
        "Healthy @ $(($_.LastUpdated.ToLocalTime() | Out-String).Trim())"
    </ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'Success' ) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'Warning' -NoClear) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock> $_.Status.Health -ne 'Healthy'</ScriptBlock>
                </ItemSelectionCondition>
                <ScriptBlock>
        "$($_.Status.Health) @ $(($_.LastUpdated.ToLocalTime() | Out-String).Trim())"
    </ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'Warning' ) -join ''</ScriptBlock>
              </ExpressionBinding>
              <NewLine />
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock> $_.Status.Health -ne 'Healthy'</ScriptBlock>
                </ItemSelectionCondition>
                <PropertyName>Services</PropertyName>
                <EnumerateCollection />
                <CustomControlName>ADO.Service.Health.ServiceGeographies</CustomControlName>
              </ExpressionBinding>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </View>
    <View>
      <Name>PSDevOps.AreaPath</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.AreaPath</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Organization</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>AreaPath</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.Build.Change</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.Build.Change</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Label>Author</Label>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Timestamp</Label>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <ScriptBlock> $_.Author.DisplayName </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
        ([DateTime]$_.TimeStamp).ToLocalTime().ToString()
    </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Message</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.Build.Change</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.Build.Change</TypeName>
      </ViewSelectedBy>
      <ListControl>
        <ListEntries>
          <ListEntry>
            <ListItems>
              <ListItem>
                <Label>Author</Label>
                <ScriptBlock> $_.Author.DisplayName </ScriptBlock>
              </ListItem>
              <ListItem>
                <Label>Timestamp</Label>
                <ScriptBlock>
        ([DateTime]$_.TimeStamp).ToLocalTime().ToString()
    </ScriptBlock>
              </ListItem>
              <ListItem>
                <PropertyName>Message</PropertyName>
              </ListItem>
              <ListItem>
                <PropertyName>Type</PropertyName>
              </ListItem>
              <ListItem>
                <PropertyName>DisplayUri</PropertyName>
              </ListItem>
            </ListItems>
          </ListEntry>
        </ListEntries>
      </ListControl>
    </View>
    <View>
      <Name>PSDevOps.Build</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.Build</TypeName>
      </ViewSelectedBy>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <ExpressionBinding>
                <ScriptBlock> $_.Definition.Name + ' ' + $_.BuildNumber + ' [' </ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>$moduleName = 'PSDevOps'

            do {
                $lm = Get-Module -Name $moduleName -ErrorAction Ignore
                if (-not $lm) { continue }
                if ($lm.FormatPartsLoaded) { break }
                $wholeScript = @(foreach ($formatFilePath in $lm.exportedFormatFiles) {
                    foreach ($partNodeName in Select-Xml -LiteralPath $formatFilePath -XPath "/Configuration/Controls/Control/Name[starts-with(., '$')]") {
                        $ParentNode = $partNodeName.Node.ParentNode
                        "$($ParentNode.Name)={
            $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBinding.ScriptBlock)}"
                    }
                }) -join [Environment]::NewLine
                New-Module -Name "${ModuleName}.format.ps1xml" -ScriptBlock ([ScriptBlock]::Create(($wholeScript + ';Export-ModuleMember -Variable *'))) |
                    Import-Module -Global
                $onRemove = [ScriptBlock]::Create("Remove-Module '${ModuleName}.format.ps1xml'")
                
                if (-not $lm.OnRemove) {
                    $lm.OnRemove = $onRemove
                } else {
                    $lm.OnRemove = [ScriptBlock]::Create($onRemove.ToString() + '' + [Environment]::NewLine + $lm.OnRemove)
                }
                $lm | Add-Member NoteProperty FormatPartsLoaded $true -Force
            
            } while ($false)
            
        
@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.Succeeded' -NoClear) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock>
        $_.Result -eq 'Succeeded'
    </ScriptBlock>
                </ItemSelectionCondition>
                <ScriptBlock>
        $_.Result
    </ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.Succeeded' ) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.Failed' -NoClear) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock>
        $_.Result -eq 'Failed'
    </ScriptBlock>
                </ItemSelectionCondition>
                <ScriptBlock>
        $_.Result
    </ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.Failed' ) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.NotStarted' -NoClear) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock>
        $_.Status -eq 'notStarted'
    </ScriptBlock>
                </ItemSelectionCondition>
                <ScriptBlock>
        $_.Status
    </ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.NotStarted' ) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.InProgress' -NoClear) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock>
        $_.Status -eq 'inProgress'
    </ScriptBlock>
                </ItemSelectionCondition>
                <ScriptBlock>
        if ($_.QueueTime -and -not $_.StartTime) {
            'Queued'
        } elseif ($_.StartTime -and -not $_.FinishTime) {
            'Running'
        }
    </ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>@(&amp; ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.InProgress' ) -join ''</ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ScriptBlock>
        if ($_.Status -eq 'inProgress') {
            if ($_.QueueTime -and -not $_.StartTime) {
                ' for ' + ([DateTime]::Now - $([Datetime]$_.QueueTime).ToLocalTime()).ToString().Substring(0,8)
            } else {
                ' for ' + ([DateTime]::Now - $([DateTime]$_.StartTime).ToLocalTime()).ToString().Substring(0,8)
            }
        } else {
            " in " + ([DateTime]($_.FinishTime) - [DateTime]($_.StartTime)).ToString().Substring(0,8)
        }
    </ScriptBlock>
              </ExpressionBinding>
              <Text>]</Text>
              <NewLine />
              <ExpressionBinding>
                <ScriptBlock>
        '=' * ($_.Definition.Name.Length +
            $_.BuildNumber.Length +
            $_.Result.Length + 4 + $(
                if ($_.FinishTime) { 4 + 8 }
                else {
                    5 + 8 + $(if (-not $_.StartTime) { 'Queued'.Length} else { 'Running'.Length })
                })
            )
    </ScriptBlock>
              </ExpressionBinding>
              <NewLine />
              <ExpressionBinding>
                <ScriptBlock>
        $_.Reason + ' of ' + $_.sourceBranch + ' for ' + $_.RequestedFor.DisplayName
    </ScriptBlock>
              </ExpressionBinding>
              <NewLine />
              <ExpressionBinding>
                <ScriptBlock>
        '-' * ($_.Reason.Length + 4 + $_.sourceBranch.Length + 5 + $_.RequestedFor.DisplayName.Length)
    </ScriptBlock>
              </ExpressionBinding>
              <NewLine />
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock> $_.ChangeSet </ScriptBlock>
                </ItemSelectionCondition>
                <ScriptBlock>
        "### Changes:" + [Environment]::NewLine
    </ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock> $_.ChangeSet </ScriptBlock>
                </ItemSelectionCondition>
                <ScriptBlock>
        ' * ' + (@($_.ChangeSet | Select-Object -ExpandProperty Message) -join "$([Environment]::NewLine) * ")
    </ScriptBlock>
              </ExpressionBinding>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </View>
    <View>
      <Name>PSDevOps.BuildStep</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.BuildStep</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>BuildSystem</PropertyName>
      </GroupBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Type</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Extension</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.ExtensionContribution</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.ExtensionContribution</TypeName>
      </ViewSelectedBy>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <Text>ContributionID: </Text>
              <ExpressionBinding>
                <ScriptBlock> $_.ContributionID +[Environment]::NewLine </ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock> $_.Name </ScriptBlock>
                </ItemSelectionCondition>
                <ScriptBlock> ' ' + $_.Name </ScriptBlock>
              </ExpressionBinding>
              <ExpressionBinding>
                <ItemSelectionCondition>
                  <ScriptBlock> $_.Description </ScriptBlock>
                </ItemSelectionCondition>
                <ScriptBlock> [Environment]::NewLine + ' ' + $_.Description </ScriptBlock>
              </ExpressionBinding>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </View>
    <View>
      <Name>PSDevOps.Field</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.Field</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Type</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>FieldName</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Description</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Label>Name</Label>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Parameters</Label>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <!-- {ConditionalColor:"&quot;Success&quot;"}-->
              <TableColumnItem>
                <ScriptBlock>$moduleName = 'PSDevOps'

            do {
                $lm = Get-Module -Name $moduleName -ErrorAction Ignore
                if (-not $lm) { continue }
                if ($lm.FormatPartsLoaded) { break }
                $wholeScript = @(foreach ($formatFilePath in $lm.exportedFormatFiles) {
                    foreach ($partNodeName in Select-Xml -LiteralPath $formatFilePath -XPath "/Configuration/Controls/Control/Name[starts-with(., '$')]") {
                        $ParentNode = $partNodeName.Node.ParentNode
                        "$($ParentNode.Name)={
            $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBinding.ScriptBlock)}"
                    }
                }) -join [Environment]::NewLine
                New-Module -Name "${ModuleName}.format.ps1xml" -ScriptBlock ([ScriptBlock]::Create(($wholeScript + ';Export-ModuleMember -Variable *'))) |
                    Import-Module -Global
                $onRemove = [ScriptBlock]::Create("Remove-Module '${ModuleName}.format.ps1xml'")
                
                if (-not $lm.OnRemove) {
                    $lm.OnRemove = $onRemove
                } else {
                    $lm.OnRemove = [ScriptBlock]::Create($onRemove.ToString() + '' + [Environment]::NewLine + $lm.OnRemove)
                }
                $lm | Add-Member NoteProperty FormatPartsLoaded $true -Force
            
            } while ($false)
            
        

                $__ = $_
                $ci = . {"Success"}
                $_ = $__
                if ($ci -is [string]) {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci
                } else {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear @ci
                }
                $output = . {$_.'Name'}
                @($ci; $output; &amp; ${PSDevOps_Format-RichText}) -join ""
                </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>ScriptType</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Synopsis</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
        @(foreach ($kv in ([Management.Automation.CommandMetaData]$_).Parameters.GetEnumerator()) {
            @(
            . ${PSDevOps_setOutputStyle} -ForegroundColor Verbose
            "[$($kv.Value.ParameterType)]"
            . ${PSDevOps_clearOutputStyle}
            . ${PSDevOps_setOutputStyle} -ForegroundColor Warning
            "`$$($kv.Key)"
            . ${PSDevOps_clearOutputStyle}
            ) -join ''
        }) -join [Environment]::NewLine
    </ScriptBlock>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>Description</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Alignment>left</Alignment>
            <Width>30</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Alignment>left</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Description</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.GitIssue</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.GitIssue</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <AutoSize />
        <TableHeaders>
          <TableColumnHeader>
            <Label>Number</Label>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>State</Label>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Title</Label>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <!-- {ConditionalColor:"
    if ($_.labels.count -eq 1) { # If there&apos;s only one label
        &apos;#&apos; + $_.labels[0].color # use that color code.
    }
"}-->
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <ScriptBlock>$moduleName = 'PSDevOps'

            do {
                $lm = Get-Module -Name $moduleName -ErrorAction Ignore
                if (-not $lm) { continue }
                if ($lm.FormatPartsLoaded) { break }
                $wholeScript = @(foreach ($formatFilePath in $lm.exportedFormatFiles) {
                    foreach ($partNodeName in Select-Xml -LiteralPath $formatFilePath -XPath "/Configuration/Controls/Control/Name[starts-with(., '$')]") {
                        $ParentNode = $partNodeName.Node.ParentNode
                        "$($ParentNode.Name)={
            $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBinding.ScriptBlock)}"
                    }
                }) -join [Environment]::NewLine
                New-Module -Name "${ModuleName}.format.ps1xml" -ScriptBlock ([ScriptBlock]::Create(($wholeScript + ';Export-ModuleMember -Variable *'))) |
                    Import-Module -Global
                $onRemove = [ScriptBlock]::Create("Remove-Module '${ModuleName}.format.ps1xml'")
                
                if (-not $lm.OnRemove) {
                    $lm.OnRemove = $onRemove
                } else {
                    $lm.OnRemove = [ScriptBlock]::Create($onRemove.ToString() + '' + [Environment]::NewLine + $lm.OnRemove)
                }
                $lm | Add-Member NoteProperty FormatPartsLoaded $true -Force
            
            } while ($false)
            
        

                $__ = $_
                $ci = . {
    if ($_.labels.count -eq 1) { # If there's only one label
        '#' + $_.labels[0].color # use that color code.
    }
}
                $_ = $__
                if ($ci -is [string]) {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci
                } else {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear @ci
                }
                $output = . {$_.'Number'}
                @($ci; $output; &amp; ${PSDevOps_Format-RichText}) -join ""
                </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
                $__ = $_
                $ci = . {
    if ($_.labels.count -eq 1) { # If there's only one label
        '#' + $_.labels[0].color # use that color code.
    }
}
                $_ = $__
                if ($ci -is [string]) {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci
                } else {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear @ci
                }
                $output = . {$_.'State'}
                @($ci; $output; &amp; ${PSDevOps_Format-RichText}) -join ""
                </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
                $__ = $_
                $ci = . {
    if ($_.labels.count -eq 1) { # If there's only one label
        '#' + $_.labels[0].color # use that color code.
    }
}
                $_ = $__
                if ($ci -is [string]) {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci
                } else {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear @ci
                }
                $output = . {$_.'Title'}
                @($ci; $output; &amp; ${PSDevOps_Format-RichText}) -join ""
                </ScriptBlock>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.GitRepo</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.GitRepo</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>OwnerName</PropertyName>
      </GroupBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Alignment>left</Alignment>
            <Width>30</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>*</Label>
            <Alignment>Center</Alignment>
            <Width>5</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>!</Label>
            <Alignment>Center</Alignment>
            <Width>5</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>/</Label>
            <Alignment>Center</Alignment>
            <Width>5</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Alignment>Left</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>$_.'stargazers_count'</ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>$_.'open_issues_count'</ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>$_.'forks_count'</ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Description</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.InstalledExtension</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.InstalledExtension</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Label>PublisherName(ID)</Label>
            <Alignment>left</Alignment>
            <Width>20</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>ExtensionName(ID)</Label>
            <Alignment>left</Alignment>
            <Width>20</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Alignment>left</Alignment>
            <Width>20</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Contributions</Label>
            <Alignment>left</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <ScriptBlock>
        $_.PublisherName + [Environment]::NewLine + '(' + $_.PublisherID + ')'
    </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
        $_.ExtensionName + [Environment]::NewLine + '(' + $_.ExtensionID + ')'
    </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Version</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
        ($_.Contributions |
            Out-String -Width ($host.UI.RawUI.BufferSize.Width - 45)).Trim()
    </ScriptBlock>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.IterationPath</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.IterationPath</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <AutoSize />
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>IterationPath</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>StartDate</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>EndDate</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.Picklist</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.Picklist</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Type</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>IsSuggested</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>PicklistID</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.Picklist.Detail</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.Picklist.Detail</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Items</Label>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Type</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>PicklistID</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>IsSuggested</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock> $_.Items -join [Environment]::NewLine </ScriptBlock>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>ID</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.Picklist</TypeName>
        <TypeName>PSDevOps.Picklist.Detail</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>PicklistID</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.Pool</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.Pool</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>OwnerName</PropertyName>
      </GroupBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>PoolID</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>OwnerName</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>DateCreated</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.Project</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.Project</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>Organization</PropertyName>
      </GroupBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Project</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Description</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.Repository</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.Repository</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <AutoSize />
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>ID</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Size</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.SecurityNamespace</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.SecurityNamespace</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Permissions</Label>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>NamespaceID</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock> $_.Permissions -join [Environment]::NewLine </ScriptBlock>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.SharedQuery</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.SharedQuery</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>Project</PropertyName>
      </GroupBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>IsPublic</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Path</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Wiql</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.Team</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.Team</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>ProjectName</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Team</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Description</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>ID</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.Team</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>ProjectName</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>ProjectID</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Team</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>TeamID</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>URL</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.Team</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>ProjectName</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Team</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Url</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.TeamDescriptor</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.TeamDescriptor</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>Organization</PropertyName>
      </GroupBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>TeamName</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>TeamDescriptor</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.TeamFieldValue</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.TeamFieldValue</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Label>Field</Label>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Values</Label>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <ScriptBlock>
        $_.field.ReferenceName
    </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>DefaultValue</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
            foreach ($v in $_.values) {
                if ($v.IncludeChildren) {
                    "$($v.value)/*"
                } else {
                    "$($v.value)"
                }
            }
    </ScriptBlock>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.TestPlan</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.TestPlan</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <ScriptBlock>
    $_.Project.Name
</ScriptBlock>
        <Label>ProjectName</Label>
      </GroupBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>TestPlanID</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Owner</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>State</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>AreaPath</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.TestRun</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.TestRun</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Label>Name</Label>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>IsAutomated</Label>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>TotalTests</Label>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>PassedTests</Label>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <!-- {ConditionalColor:"
    if ($_.PassedTests -lt $_.TotalTests) {
        if ($_.PassedTests -lt ($_.TotalTests / 2)) {
            &apos;Red&apos;
        } else {
            &apos;Yellow&apos;
        }
    } else {
        &apos;Green&apos;
    }
"}-->
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <ScriptBlock>$moduleName = 'PSDevOps'

            do {
                $lm = Get-Module -Name $moduleName -ErrorAction Ignore
                if (-not $lm) { continue }
                if ($lm.FormatPartsLoaded) { break }
                $wholeScript = @(foreach ($formatFilePath in $lm.exportedFormatFiles) {
                    foreach ($partNodeName in Select-Xml -LiteralPath $formatFilePath -XPath "/Configuration/Controls/Control/Name[starts-with(., '$')]") {
                        $ParentNode = $partNodeName.Node.ParentNode
                        "$($ParentNode.Name)={
            $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBinding.ScriptBlock)}"
                    }
                }) -join [Environment]::NewLine
                New-Module -Name "${ModuleName}.format.ps1xml" -ScriptBlock ([ScriptBlock]::Create(($wholeScript + ';Export-ModuleMember -Variable *'))) |
                    Import-Module -Global
                $onRemove = [ScriptBlock]::Create("Remove-Module '${ModuleName}.format.ps1xml'")
                
                if (-not $lm.OnRemove) {
                    $lm.OnRemove = $onRemove
                } else {
                    $lm.OnRemove = [ScriptBlock]::Create($onRemove.ToString() + '' + [Environment]::NewLine + $lm.OnRemove)
                }
                $lm | Add-Member NoteProperty FormatPartsLoaded $true -Force
            
            } while ($false)
            
        

                $__ = $_
                $ci = . {
    if ($_.PassedTests -lt $_.TotalTests) {
        if ($_.PassedTests -lt ($_.TotalTests / 2)) {
            'Red'
        } else {
            'Yellow'
        }
    } else {
        'Green'
    }
}
                $_ = $__
                if ($ci -is [string]) {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci
                } else {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear @ci
                }
                $output = . {$_.'Name'}
                @($ci; $output; &amp; ${PSDevOps_Format-RichText}) -join ""
                </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
                $__ = $_
                $ci = . {
    if ($_.PassedTests -lt $_.TotalTests) {
        if ($_.PassedTests -lt ($_.TotalTests / 2)) {
            'Red'
        } else {
            'Yellow'
        }
    } else {
        'Green'
    }
}
                $_ = $__
                if ($ci -is [string]) {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci
                } else {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear @ci
                }
                $output = . {$_.'IsAutomated'}
                @($ci; $output; &amp; ${PSDevOps_Format-RichText}) -join ""
                </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
                $__ = $_
                $ci = . {
    if ($_.PassedTests -lt $_.TotalTests) {
        if ($_.PassedTests -lt ($_.TotalTests / 2)) {
            'Red'
        } else {
            'Yellow'
        }
    } else {
        'Green'
    }
}
                $_ = $__
                if ($ci -is [string]) {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci
                } else {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear @ci
                }
                $output = . {$_.'TotalTests'}
                @($ci; $output; &amp; ${PSDevOps_Format-RichText}) -join ""
                </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
                $__ = $_
                $ci = . {
    if ($_.PassedTests -lt $_.TotalTests) {
        if ($_.PassedTests -lt ($_.TotalTests / 2)) {
            'Red'
        } else {
            'Yellow'
        }
    } else {
        'Green'
    }
}
                $_ = $__
                if ($ci -is [string]) {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci
                } else {
                    $ci = &amp; ${PSDevOps_Format-RichText} -NoClear @ci
                }
                $output = . {$_.'PassedTests'}
                @($ci; $output; &amp; ${PSDevOps_Format-RichText}) -join ""
                </ScriptBlock>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.TestSuite</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.TestSuite</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>TestPlanName</PropertyName>
      </GroupBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Alignment>left</Alignment>
            <Width>20</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Alignment>left</Alignment>
            <Width>12</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>LastUpdated</Label>
            <Alignment>left</Alignment>
            <Width>20</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Alignment>left</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>TestSuiteID</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
        $_.LastUpdated.ToString('s')
    </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>QueryString</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.Wiki</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.Wiki</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Project</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>WikiID</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Type</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>MappedPath</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.WorkItem.Comment</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.WorkItem.Comment</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>WorkItemID</PropertyName>
      </GroupBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Label>CreatedBy</Label>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <ScriptBlock> $_.CreatedBy.displayName </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>CreatedAt</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Comment</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.WorkItem.CommentReaction</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.WorkItem.CommentReaction</TypeName>
      </ViewSelectedBy>
      <GroupBy>
        <PropertyName>Comment</PropertyName>
      </GroupBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Type</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Count</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.WorkItem</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.WorkItem</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
            <Alignment>left</Alignment>
            <Width>8</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>AssignedTo</Label>
            <Alignment>left</Alignment>
            <Width>20</Width>
          </TableColumnHeader>
          <TableColumnHeader>
            <Alignment>left</Alignment>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>ID</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock> if ($_.AssignedTo.DisplayName) { $_.AssignedTo.DisplayName } else { $_.AssignedTo } </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Title</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.WorkItem</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.WorkItem</TypeName>
      </ViewSelectedBy>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <ExpressionBinding>
                <ScriptBlock>$moduleName = 'PSDevOps'

            do {
                $lm = Get-Module -Name $moduleName -ErrorAction Ignore
                if (-not $lm) { continue }
                if ($lm.FormatPartsLoaded) { break }
                $wholeScript = @(foreach ($formatFilePath in $lm.exportedFormatFiles) {
                    foreach ($partNodeName in Select-Xml -LiteralPath $formatFilePath -XPath "/Configuration/Controls/Control/Name[starts-with(., '$')]") {
                        $ParentNode = $partNodeName.Node.ParentNode
                        "$($ParentNode.Name)={
            $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBinding.ScriptBlock)}"
                    }
                }) -join [Environment]::NewLine
                New-Module -Name "${ModuleName}.format.ps1xml" -ScriptBlock ([ScriptBlock]::Create(($wholeScript + ';Export-ModuleMember -Variable *'))) |
                    Import-Module -Global
                $onRemove = [ScriptBlock]::Create("Remove-Module '${ModuleName}.format.ps1xml'")
                
                if (-not $lm.OnRemove) {
                    $lm.OnRemove = $onRemove
                } else {
                    $lm.OnRemove = [ScriptBlock]::Create($onRemove.ToString() + '' + [Environment]::NewLine + $lm.OnRemove)
                }
                $lm | Add-Member NoteProperty FormatPartsLoaded $true -Force
            
            } while ($false)
            
        

$wi = $_
$uiBuffer = $Host.UI.RawUI.BufferSize.Width - 1
$bufferWidth = $uiBuffer
$justify = {param($l, $r)
    
    $d = $host.UI.RawUI.BufferSize.Width - 1 - $l.Length - $r.Length
    if ($d -lt 0) { $d = 0 }
    $l + (' ' * $d) + $r
            
}

@(
. ${PSDevOps_HorizontalRule}
#('-' * $uiBuffer)
&amp; justify "[$($wi.ID)] $($wi.'System.Title')" "$($wi.'System.State')"
. ${PSDevOps_HorizontalRule}
#('-' * $uiBuffer)
if ($wi.'System.IterationPath') {
    &amp; justify "Iteration Path:" $wi.'System.IterationPath'
}
if ($wi.'System.AssignedTo') {
    &amp; justify "Assigned To:" $(if ($wi.'System.AssignedTo'.displayName) {
        $wi.'System.AssignedTo'.displayName
    } else {
        $wi.'System.AssignedTo'
    })
}
$changedBy =
    if ($wi.'System.ChangedBy'.displayName) {
        $wi.'System.ChangedBy'.displayName
    } elseif ($wi.'System.ChangedBy') {
        $wi.'System.ChangedBy'
    }
if ($changedBy) {
    &amp; justify "Last Updated:" "$changedBy @ $($wi.'System.ChangedDate' -as [DateTime])"
}
$createdBy =
    if ($wi.'System.CreatedBy'.displayName) {
        $wi.'System.CreatedBy'.displayName
    } elseif ($wi.'System.CreatedBy') {
        $wi.'System.CreatedBy'
    }
if ($createdby) {
    &amp; justify "Created:" "$createdBy @ $($wi.'System.CreatedDate' -as [DateTime])"
}
if ($wi.'System.Description') {
    "Description:"
    . ${PSDevOps_HorizontalRule} -Character '_'
    $wi.HTMLToText("$($wi.'System.Description')")
    . ${PSDevOps_HorizontalRule} -Character '_'
}

if ($wi.'Microsoft.VSTS.TCM.ReproSteps') {
    "Repro Steps:"
    . ${PSDevOps_HorizontalRule} -Character '_'
    [Environment]::NewLine
    $wi.HTMLToText("$($wi.'Microsoft.VSTS.TCM.ReproSteps')")
    . ${PSDevOps_HorizontalRule} -Character '_'
    [Environment]::NewLine
}




        
) -join [Environment]::NewLine
</ScriptBlock>
              </ExpressionBinding>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </View>
    <View>
      <Name>PSDevOps.WorkItemType</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.WorkItemType</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
            <Label>Icon</Label>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <ScriptBlock>
        if ($_.Icon.id) {
            $_.Icon.id
        } else {
            $_.Icon
        }
    </ScriptBlock>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Color</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Description</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.WorkProcess.Field</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.WorkProcess.Field</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Type</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Required</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Customization</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Description</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>PSDevOps.WorkProcess</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.WorkProcess</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <Wrap />
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>IsEnabled</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>IsDefault</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>Description</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
    <View>
      <Name>Picklist</Name>
      <ViewSelectedBy>
        <TypeName>PSDevOps.WorkProcess</TypeName>
      </ViewSelectedBy>
      <TableControl>
        <TableHeaders>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
          <TableColumnHeader>
          </TableColumnHeader>
        </TableHeaders>
        <TableRowEntries>
          <TableRowEntry>
            <TableColumnItems>
              <TableColumnItem>
                <PropertyName>Name</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>IsPicklist</PropertyName>
              </TableColumnItem>
              <TableColumnItem>
                <PropertyName>PicklistID</PropertyName>
              </TableColumnItem>
            </TableColumnItems>
          </TableRowEntry>
        </TableRowEntries>
      </TableControl>
    </View>
  </ViewDefinitions>
</Configuration>