diff --git a/PSDevOps.format.ps1xml b/PSDevOps.format.ps1xml index 801c1cbb..f9d5d4b6 100644 --- a/PSDevOps.format.ps1xml +++ b/PSDevOps.format.ps1xml @@ -1,208 +1,210 @@ - - - - - - PSDevOps.AreaPath - - PSDevOps.AreaPath - - - - - - - - - - - - - Organization - - - AreaPath - - - - - - - - PSDevOps.Build.Change - - PSDevOps.Build.Change - - - - - - - - - - - - - - - - - - $_.Author.DisplayName - - + + + + + + PSDevOps.AreaPath + + PSDevOps.AreaPath + + + + + + + + + + + + + Organization + + + AreaPath + + + + + + + + PSDevOps.Build.Change + + PSDevOps.Build.Change + + + + + + + + + + + + + + + + + + $_.Author.DisplayName + + ([DateTime]$_.TimeStamp).ToLocalTime().ToString() - - - - Message - - - - - - - - PSDevOps.Build.Change - - PSDevOps.Build.Change - - - - - - - - $_.Author.DisplayName - - - + + + + Message + + + + + + + + PSDevOps.Build.Change + + PSDevOps.Build.Change + + + + + + + + $_.Author.DisplayName + + + ([DateTime]$_.TimeStamp).ToLocalTime().ToString() - - - - Message - - - Type - - - DisplayUri - - - - - - - - PSDevOps.Build - - PSDevOps.Build - - - - - - - $_.Definition.Name + ' ' + $_.BuildNumber + ' [' - - - $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) - -. ${PSDevOps_SetOutputStyle} -ForegroundColor 'PSDevOps.Build.Succeeded' - - - + + + + Message + + + Type + + + DisplayUri + + + + + + + + PSDevOps.Build + + PSDevOps.Build + + + + + + + $_.Definition.Name + ' ' + $_.BuildNumber + ' [' + + + $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) + + +@(& ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.Succeeded' -NoClear) -join '' + + + $_.Result -eq 'Succeeded' - - + + $_.Result - - - - . ${PSDevOps_ClearOutputStyle} - - - . ${PSDevOps_SetOutputStyle} -ForegroundColor 'PSDevOps.Build.Failed' - - - + + + + @(& ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.Succeeded' ) -join '' + + + @(& ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.Failed' -NoClear) -join '' + + + $_.Result -eq 'Failed' - - + + $_.Result - - - - . ${PSDevOps_ClearOutputStyle} - - - . ${PSDevOps_SetOutputStyle} -ForegroundColor 'PSDevOps.Build.NotStarted' - - - + + + + @(& ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.Failed' ) -join '' + + + @(& ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.NotStarted' -NoClear) -join '' + + + $_.Status -eq 'notStarted' - - + + $_.Status - - - - . ${PSDevOps_ClearOutputStyle} - - - . ${PSDevOps_SetOutputStyle} -ForegroundColor 'PSDevOps.Build.InProgress' - - - + + + + @(& ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.NotStarted' ) -join '' + + + @(& ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.InProgress' -NoClear) -join '' + + + $_.Status -eq 'inProgress' - - + + if ($_.QueueTime -and -not $_.StartTime) { 'Queued' } elseif ($_.StartTime -and -not $_.FinishTime) { 'Running' } - - - - . ${PSDevOps_ClearOutputStyle} - - + + + + @(& ${PSDevOps_Format-RichText} -ForegroundColor 'PSDevOps.Build.InProgress' ) -join '' + + if ($_.Status -eq 'inProgress') { if ($_.QueueTime -and -not $_.StartTime) { @@ -213,11 +215,11 @@ $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBindi } else { " in " + ([DateTime]($_.FinishTime) - [DateTime]($_.StartTime)).ToString().Substring(0,8) } - - - ] - - + + + ] + + '=' * ($_.Definition.Name.Length + $_.BuildNumber.Length + @@ -227,312 +229,316 @@ $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBindi 5 + 8 + $(if (-not $_.StartTime) { 'Queued'.Length} else { 'Running'.Length }) }) ) - - - - + + + + $_.Reason + ' of ' + $_.sourceBranch + ' for ' + $_.RequestedFor.DisplayName - - - - + + + + '-' * ($_.Reason.Length + 4 + $_.sourceBranch.Length + 5 + $_.RequestedFor.DisplayName.Length) - - - - - - $_.ChangeSet - + + + + + + $_.ChangeSet + "### Changes:" + [Environment]::NewLine - - - - - $_.ChangeSet - + + + + + $_.ChangeSet + ' * ' + (@($_.ChangeSet | Select-Object -ExpandProperty Message) -join "$([Environment]::NewLine) * ") - - - - - - - - - PSDevOps.BuildStep - - PSDevOps.BuildStep - - - BuildSystem - - - - - - - - - - - - - - - Name - - - Type - - - Extension - - - - - - - - PSDevOps.ExtensionContribution - - PSDevOps.ExtensionContribution - - - - - - ContributionID: - - $_.ContributionID +[Environment]::NewLine - - - - $_.Name - - ' ' + $_.Name - - - - $_.Description - - [Environment]::NewLine + ' ' + $_.Description - - - - - - - - PSDevOps.Field - - PSDevOps.Field - - - - - - - - - - - - - - - - - - Name - - - Type - - - FieldName - - - Description - - - - - - - - PSDevOps - - PSDevOps - - - - - - - - - - - - - - - - - - - - - $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) - + + + + + + + + + PSDevOps.BuildStep + + PSDevOps.BuildStep + + + BuildSystem + + + + + + + + + + + + + + + Name + + + Type + + + Extension + + + + + + + + PSDevOps.ExtensionContribution + + PSDevOps.ExtensionContribution + + + + + + ContributionID: + + $_.ContributionID +[Environment]::NewLine + + + + $_.Name + + ' ' + $_.Name + + + + $_.Description + + [Environment]::NewLine + ' ' + $_.Description + + + + + + + + PSDevOps.Field + + PSDevOps.Field + + + + + + + + + + + + + + + + + + Name + + + Type + + + FieldName + + + Description + + + + + + + + PSDevOps + + PSDevOps + + + + + + + + + + + + + + + + + + + + + $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 = . ${PSDevOps_SetOutputStyle} $ci - } else { - $ci = . ${PSDevOps_SetOutputStyle} @ci + $ci = & ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci + } else { + $ci = & ${PSDevOps_Format-RichText} -NoClear @ci } $output = . {$_.'Name'} - @($ci; $output; . ${PSDevOps_ClearOutputStyle}) -join "" - - - - ScriptType - - - Synopsis - - + @($ci; $output; & ${PSDevOps_Format-RichText}) -join "" + + + + ScriptType + + + Synopsis + + @(foreach ($kv in ([Management.Automation.CommandMetaData]$_).Parameters.GetEnumerator()) { @( - . ${PSDevOps_SetOutputStyle} -ForegroundColor Verbose + . ${PSDevOps_setOutputStyle} -ForegroundColor Verbose "[$($kv.Value.ParameterType)]" - . ${PSDevOps_ClearOutputStyle} - . ${PSDevOps_SetOutputStyle} -ForegroundColor Warning + . ${PSDevOps_clearOutputStyle} + . ${PSDevOps_setOutputStyle} -ForegroundColor Warning "`$$($kv.Key)" - . ${PSDevOps_ClearOutputStyle} + . ${PSDevOps_clearOutputStyle} ) -join '' }) -join [Environment]::NewLine - - - - - - - - - Description - - PSDevOps - - - - - left - 30 - - - left - - - - - - - - Name - - - Description - - - - - - - - PSDevOps.GitIssue - - PSDevOps.GitIssue - - - - - - - - - - - - - - - + + + + + + + + + Description + + PSDevOps + + + + + left + 30 + + + left + + + + + + + + Name + + + Description + + + + + + + + PSDevOps.GitIssue + + PSDevOps.GitIssue + + + + + + + + + + + + + + + - - - - $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) - +"}--> + + + + $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 = . { @@ -542,15 +548,15 @@ $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBindi } $_ = $__ if ($ci -is [string]) { - $ci = . ${PSDevOps_SetOutputStyle} $ci - } else { - $ci = . ${PSDevOps_SetOutputStyle} @ci + $ci = & ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci + } else { + $ci = & ${PSDevOps_Format-RichText} -NoClear @ci } $output = . {$_.'Number'} - @($ci; $output; . ${PSDevOps_ClearOutputStyle}) -join "" - - - + @($ci; $output; & ${PSDevOps_Format-RichText}) -join "" + + + $__ = $_ $ci = . { @@ -560,15 +566,15 @@ $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBindi } $_ = $__ if ($ci -is [string]) { - $ci = . ${PSDevOps_SetOutputStyle} $ci - } else { - $ci = . ${PSDevOps_SetOutputStyle} @ci + $ci = & ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci + } else { + $ci = & ${PSDevOps_Format-RichText} -NoClear @ci } $output = . {$_.'State'} - @($ci; $output; . ${PSDevOps_ClearOutputStyle}) -join "" - - - + @($ci; $output; & ${PSDevOps_Format-RichText}) -join "" + + + $__ = $_ $ci = . { @@ -578,593 +584,593 @@ $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBindi } $_ = $__ if ($ci -is [string]) { - $ci = . ${PSDevOps_SetOutputStyle} $ci - } else { - $ci = . ${PSDevOps_SetOutputStyle} @ci + $ci = & ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci + } else { + $ci = & ${PSDevOps_Format-RichText} -NoClear @ci } $output = . {$_.'Title'} - @($ci; $output; . ${PSDevOps_ClearOutputStyle}) -join "" - - - - - - - - - PSDevOps.GitRepo - - PSDevOps.GitRepo - - - OwnerName - - - - - left - 30 - - - - Center - 5 - - - - Center - 5 - - - - Center - 5 - - - Left - - - - - - - - Name - - - $_.'stargazers_count' - - - $_.'open_issues_count' - - - $_.'forks_count' - - - Description - - - - - - - - PSDevOps.InstalledExtension - - PSDevOps.InstalledExtension - - - - - - left - 20 - - - - left - 20 - - - left - 20 - - - - left - - - - - - - + @($ci; $output; & ${PSDevOps_Format-RichText}) -join "" + + + + + + + + + PSDevOps.GitRepo + + PSDevOps.GitRepo + + + OwnerName + + + + + left + 30 + + + + Center + 5 + + + + Center + 5 + + + + Center + 5 + + + Left + + + + + + + + Name + + + $_.'stargazers_count' + + + $_.'open_issues_count' + + + $_.'forks_count' + + + Description + + + + + + + + PSDevOps.InstalledExtension + + PSDevOps.InstalledExtension + + + + + + left + 20 + + + + left + 20 + + + left + 20 + + + + left + + + + + + + $_.PublisherName + [Environment]::NewLine + '(' + $_.PublisherID + ')' - - - + + + $_.ExtensionName + [Environment]::NewLine + '(' + $_.ExtensionID + ')' - - - - Version - - + + + + Version + + ($_.Contributions | Out-String -Width ($host.UI.RawUI.BufferSize.Width - 45)).Trim() - - - - - - - - - PSDevOps.IterationPath - - PSDevOps.IterationPath - - - - - - - - - - - - - - - - IterationPath - - - StartDate - - - EndDate - - - - - - - - PSDevOps.Picklist - - PSDevOps.Picklist - - - - - - - - - - - - - - - - - Name - - - Type - - - IsSuggested - - - PicklistID - - - - - - - - PSDevOps.Picklist.Detail - - PSDevOps.Picklist.Detail - - - - - - - - - - - - - - - - - - - - - Name - - - Type - - - PicklistID - - - IsSuggested - - - $_.Items -join [Environment]::NewLine - - - - - - - - ID - - PSDevOps.Picklist - PSDevOps.Picklist.Detail - - - - - - - - - - - - - Name - - - PicklistID - - - - - - - - PSDevOps.Pool - - PSDevOps.Pool - - - OwnerName - - - - - - - - - - - - - - - - - PoolID - - - Name - - - OwnerName - - - DateCreated - - - - - - - - PSDevOps.Project - - PSDevOps.Project - - - Organization - - - - - - - - - - - - - Project - - - Description - - - - - - - - PSDevOps.Repository - - PSDevOps.Repository - - - - - - - - - - - - - - - - Name - - - ID - - - Size - - - - - - - - PSDevOps.SecurityNamespace - - PSDevOps.SecurityNamespace - - - - - - - - - - - - - - - - - Name - - - NamespaceID - - - $_.Permissions -join [Environment]::NewLine - - - - - - - - PSDevOps.SharedQuery - - PSDevOps.SharedQuery - - - Project - - - - - - - - - - - - - - - - IsPublic - - - Path - - - Wiql - - - - - - - - PSDevOps.Team - - PSDevOps.Team - - - - - - - - - - - - - - - ProjectName - - - Team - - - Description - - - - - - - - ID - - PSDevOps.Team - - - - - - - - - - - - - - - - - ProjectName - - - ProjectID - - - Team - - - TeamID - - - - - - - - URL - - PSDevOps.Team - - - - - - - - - - - - - - - - ProjectName - - - Team - - - Url - - - - - - - - PSDevOps.TeamDescriptor - - PSDevOps.TeamDescriptor - - - Organization - - - - - - - - - - - - - - TeamName - - - TeamDescriptor - - - - - - - - PSDevOps.TeamFieldValue - - PSDevOps.TeamFieldValue - - - - - - - - - - - - - - - - + + + + + + + + + PSDevOps.IterationPath + + PSDevOps.IterationPath + + + + + + + + + + + + + + + + IterationPath + + + StartDate + + + EndDate + + + + + + + + PSDevOps.Picklist + + PSDevOps.Picklist + + + + + + + + + + + + + + + + + Name + + + Type + + + IsSuggested + + + PicklistID + + + + + + + + PSDevOps.Picklist.Detail + + PSDevOps.Picklist.Detail + + + + + + + + + + + + + + + + + + + + + Name + + + Type + + + PicklistID + + + IsSuggested + + + $_.Items -join [Environment]::NewLine + + + + + + + + ID + + PSDevOps.Picklist + PSDevOps.Picklist.Detail + + + + + + + + + + + + + Name + + + PicklistID + + + + + + + + PSDevOps.Pool + + PSDevOps.Pool + + + OwnerName + + + + + + + + + + + + + + + + + PoolID + + + Name + + + OwnerName + + + DateCreated + + + + + + + + PSDevOps.Project + + PSDevOps.Project + + + Organization + + + + + + + + + + + + + Project + + + Description + + + + + + + + PSDevOps.Repository + + PSDevOps.Repository + + + + + + + + + + + + + + + + Name + + + ID + + + Size + + + + + + + + PSDevOps.SecurityNamespace + + PSDevOps.SecurityNamespace + + + + + + + + + + + + + + + + + Name + + + NamespaceID + + + $_.Permissions -join [Environment]::NewLine + + + + + + + + PSDevOps.SharedQuery + + PSDevOps.SharedQuery + + + Project + + + + + + + + + + + + + + + + IsPublic + + + Path + + + Wiql + + + + + + + + PSDevOps.Team + + PSDevOps.Team + + + + + + + + + + + + + + + ProjectName + + + Team + + + Description + + + + + + + + ID + + PSDevOps.Team + + + + + + + + + + + + + + + + + ProjectName + + + ProjectID + + + Team + + + TeamID + + + + + + + + URL + + PSDevOps.Team + + + + + + + + + + + + + + + + ProjectName + + + Team + + + Url + + + + + + + + PSDevOps.TeamDescriptor + + PSDevOps.TeamDescriptor + + + Organization + + + + + + + + + + + + + + TeamName + + + TeamDescriptor + + + + + + + + PSDevOps.TeamFieldValue + + PSDevOps.TeamFieldValue + + + + + + + + + + + + + + + + $_.field.ReferenceName - - - - DefaultValue - - + + + + DefaultValue + + foreach ($v in $_.values) { if ($v.IncludeChildren) { @@ -1173,82 +1179,82 @@ $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBindi "$($v.value)" } } - - - - - - - - - PSDevOps.TestPlan - - PSDevOps.TestPlan - - + + + + + + + + + PSDevOps.TestPlan + + PSDevOps.TestPlan + + $_.Project.Name - - - - - - - - - - - - - - - - - - - - - - Name - - - TestPlanID - - - Owner - - - State - - - AreaPath - - - - - - - - PSDevOps.TestRun - - PSDevOps.TestRun - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + Name + + + TestPlanID + + + Owner + + + State + + + AreaPath + + + + + + + + PSDevOps.TestRun + + PSDevOps.TestRun + + + + + + + + + + + + + + + + + - - - - $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) - +"}--> + + + + $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 = . { @@ -1303,15 +1311,15 @@ $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBindi } $_ = $__ if ($ci -is [string]) { - $ci = . ${PSDevOps_SetOutputStyle} $ci - } else { - $ci = . ${PSDevOps_SetOutputStyle} @ci + $ci = & ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci + } else { + $ci = & ${PSDevOps_Format-RichText} -NoClear @ci } $output = . {$_.'Name'} - @($ci; $output; . ${PSDevOps_ClearOutputStyle}) -join "" - - - + @($ci; $output; & ${PSDevOps_Format-RichText}) -join "" + + + $__ = $_ $ci = . { @@ -1327,15 +1335,15 @@ $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBindi } $_ = $__ if ($ci -is [string]) { - $ci = . ${PSDevOps_SetOutputStyle} $ci - } else { - $ci = . ${PSDevOps_SetOutputStyle} @ci + $ci = & ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci + } else { + $ci = & ${PSDevOps_Format-RichText} -NoClear @ci } $output = . {$_.'IsAutomated'} - @($ci; $output; . ${PSDevOps_ClearOutputStyle}) -join "" - - - + @($ci; $output; & ${PSDevOps_Format-RichText}) -join "" + + + $__ = $_ $ci = . { @@ -1351,15 +1359,15 @@ $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBindi } $_ = $__ if ($ci -is [string]) { - $ci = . ${PSDevOps_SetOutputStyle} $ci - } else { - $ci = . ${PSDevOps_SetOutputStyle} @ci + $ci = & ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci + } else { + $ci = & ${PSDevOps_Format-RichText} -NoClear @ci } $output = . {$_.'TotalTests'} - @($ci; $output; . ${PSDevOps_ClearOutputStyle}) -join "" - - - + @($ci; $output; & ${PSDevOps_Format-RichText}) -join "" + + + $__ = $_ $ci = . { @@ -1375,249 +1383,251 @@ $($ParentNode.CustomControl.CustomEntries.CustomEntry.CustomItem.ExpressionBindi } $_ = $__ if ($ci -is [string]) { - $ci = . ${PSDevOps_SetOutputStyle} $ci - } else { - $ci = . ${PSDevOps_SetOutputStyle} @ci + $ci = & ${PSDevOps_Format-RichText} -NoClear -ForegroundColor $ci + } else { + $ci = & ${PSDevOps_Format-RichText} -NoClear @ci } $output = . {$_.'PassedTests'} - @($ci; $output; . ${PSDevOps_ClearOutputStyle}) -join "" - - - - - - - - - PSDevOps.TestSuite - - PSDevOps.TestSuite - - - TestPlanName - - - - - left - 20 - - - left - 12 - - - - left - 20 - - - left - - - - - - - - Name - - - TestSuiteID - - + @($ci; $output; & ${PSDevOps_Format-RichText}) -join "" + + + + + + + + + PSDevOps.TestSuite + + PSDevOps.TestSuite + + + TestPlanName + + + + + left + 20 + + + left + 12 + + + + left + 20 + + + left + + + + + + + + Name + + + TestSuiteID + + $_.LastUpdated.ToString('s') - - - - QueryString - - - - - - - - PSDevOps.Wiki - - PSDevOps.Wiki - - - - - - - - - - - - - - - - - - - - Project - - - Name - - - WikiID - - - Type - - - MappedPath - - - - - - - - PSDevOps.WorkItem.Comment - - PSDevOps.WorkItem.Comment - - - WorkItemID - - - - - - - - - - - - - - - - - $_.CreatedBy.displayName - - - CreatedAt - - - Comment - - - - - - - - PSDevOps.WorkItem.CommentReaction - - PSDevOps.WorkItem.CommentReaction - - - Comment - - - - - - - - - - - - - Type - - - Count - - - - - - - - PSDevOps.WorkItem - - PSDevOps.WorkItem - - - - - left - 8 - - - - left - 20 - - - left - - - - - - - - ID - - - if ($_.AssignedTo.DisplayName) { $_.AssignedTo.DisplayName } else { $_.AssignedTo } - - - Title - - - - - - - - PSDevOps.WorkItem - - PSDevOps.WorkItem - - - - - - - $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) - + + + + QueryString + + + + + + + + PSDevOps.Wiki + + PSDevOps.Wiki + + + + + + + + + + + + + + + + + + + + Project + + + Name + + + WikiID + + + Type + + + MappedPath + + + + + + + + PSDevOps.WorkItem.Comment + + PSDevOps.WorkItem.Comment + + + WorkItemID + + + + + + + + + + + + + + + + + $_.CreatedBy.displayName + + + CreatedAt + + + Comment + + + + + + + + PSDevOps.WorkItem.CommentReaction + + PSDevOps.WorkItem.CommentReaction + + + Comment + + + + + + + + + + + + + Type + + + Count + + + + + + + + PSDevOps.WorkItem + + PSDevOps.WorkItem + + + + + left + 8 + + + + left + 20 + + + left + + + + + + + + ID + + + if ($_.AssignedTo.DisplayName) { $_.AssignedTo.DisplayName } else { $_.AssignedTo } + + + Title + + + + + + + + PSDevOps.WorkItem + + PSDevOps.WorkItem + + + + + + + $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 @@ -1633,14 +1643,14 @@ $justify = {param($l, $r) @( . ${PSDevOps_HorizontalRule} #('-' * $uiBuffer) -& $justify "[$($wi.ID)] $($wi.'System.Title')" "$($wi.'System.State')" +& justify "[$($wi.ID)] $($wi.'System.Title')" "$($wi.'System.State')" . ${PSDevOps_HorizontalRule} #('-' * $uiBuffer) if ($wi.'System.IterationPath') { - & $justify "Iteration Path:" $wi.'System.IterationPath' + & justify "Iteration Path:" $wi.'System.IterationPath' } if ($wi.'System.AssignedTo') { - & $justify "Assigned To:" $(if ($wi.'System.AssignedTo'.displayName) { + & justify "Assigned To:" $(if ($wi.'System.AssignedTo'.displayName) { $wi.'System.AssignedTo'.displayName } else { $wi.'System.AssignedTo' @@ -1653,7 +1663,7 @@ $changedBy = $wi.'System.ChangedBy' } if ($changedBy) { - & $justify "Last Updated:" "$changedBy @ $($wi.'System.ChangedDate' -as [DateTime])" + & justify "Last Updated:" "$changedBy @ $($wi.'System.ChangedDate' -as [DateTime])" } $createdBy = if ($wi.'System.CreatedBy'.displayName) { @@ -1662,7 +1672,7 @@ $createdBy = $wi.'System.CreatedBy' } if ($createdby) { - & $justify "Created:" "$createdBy @ $($wi.'System.CreatedDate' -as [DateTime])" + & justify "Created:" "$createdBy @ $($wi.'System.CreatedDate' -as [DateTime])" } if ($wi.'System.Description') { "Description:" @@ -1685,175 +1695,489 @@ if ($wi.'Microsoft.VSTS.TCM.ReproSteps') { ) -join [Environment]::NewLine - - - - - - - - - PSDevOps.WorkItemType - - PSDevOps.WorkItemType - - - - - - - - - - - - - - - - - - - Name - - + + + + + + + + + PSDevOps.WorkItemType + + PSDevOps.WorkItemType + + + + + + + + + + + + + + + + + + + Name + + if ($_.Icon.id) { $_.Icon.id } else { $_.Icon } - - - - Color - - - Description - - - - - - - - PSDevOps.WorkProcess.Field - - PSDevOps.WorkProcess.Field - - - - - - - - - - - - - - - - - - - Name - - - Type - - - Required - - - Customization - - - Description - - - - - - - - PSDevOps.WorkProcess - - PSDevOps.WorkProcess - - - - - - - - - - - - - - - - - - Name - - - IsEnabled - - - IsDefault - - - Description - - - - - - - - Picklist - - PSDevOps.WorkProcess - - - - - - - - - - - - - - - Name - - - IsPicklist - - - PicklistID - - - - - - - - - - ${PSDevOps_SetOutputStyle} - - - - - + + + + Color + + + Description + + + + + + + + PSDevOps.WorkProcess.Field + + PSDevOps.WorkProcess.Field + + + + + + + + + + + + + + + + + + + Name + + + Type + + + Required + + + Customization + + + Description + + + + + + + + PSDevOps.WorkProcess + + PSDevOps.WorkProcess + + + + + + + + + + + + + + + + + + Name + + + IsEnabled + + + IsDefault + + + Description + + + + + + + + Picklist + + PSDevOps.WorkProcess + + + + + + + + + + + + + + + Name + + + IsPicklist + + + PicklistID + + + + + + + + + + ${PSDevOps_Format-RichText} + + + + + + + <# + .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)) + #> + [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 blinking (not supported in all terminals or HTML) + [switch]$Blink, + # If set, will render as strikethru + [switch]$Strikethru, + # If set, will underline text + [switch]$Underline, + # 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=''} + $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 + } + } + } + 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) { [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 ($Strikethru) { + $styleAttributes += + if ($canUseHTML) { + "text-decoration: line-through" + } elseif ($canUseANSI) { + '' +[char]0x1b + "[4m" + } + } + + if ($Blink) { + $styleAttributes += + if ($canUseHTML) { + + } elseif ($canUseANSI) { + '' +[char]0x1b + "[5m" + } + } + + if ($Strikethru) { + $styleAttributes += + if ($canUseHTML) { + "text-decoration: line-through" + } elseif ($canUseANSI) { + [char]0x1b + "[9m" + } + } + + if ($Invert) { + $styleAttributes += + if ($canUseHTML) { + "filter:invert(100%)" + } elseif ($canUseANSI) { + [char]0x1b + "[7m" + } + } + + $header = + if ($canUseHTML) { + "<span$( + if ($styleAttributes) { " style='$($styleAttributes -join ';')'"} + )$( + if ($cssClasses) { " class='$($cssClasses -join ' ')'"} + )>" + } 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) { + "</span>" + } + elseif ($canUseANSI) { + if ($Underline) { + '' + [char]0x1b + "[24m" + } + if ($Strikethru) { + '' + [char]0x1b + "[29m" + } + if ($Bold) { + '' + [char]0x1b + "[21m" + '' + [char]0x1b + "[22m" + } + 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' + } + } + } + } + + + + + + + + + ${PSDevOps_setOutputStyle} + + + + + <# .Synopsis Adds style to a format output @@ -2037,20 +2361,20 @@ if ($canUseHTML) { )>" } elseif ($canUseANSI) { $styleAttributes -join '' -} - - - - - - - - ${PSDevOps_ClearOutputStyle} - - - - - +} + + + + + + + + ${PSDevOps_clearOutputStyle} + + + + + <# .Synopsis Clears the output style @@ -2101,20 +2425,20 @@ $BackgroundColor [char]0x1b + '[0m' } -}) -join '' - - - - - - - - ${PSDevOps_HorizontalRule} - - - - - +}) -join '' + + + + + + + + ${PSDevOps_HorizontalRule} + + + + + <# .Synopsis Renders a HorizontalRule @@ -2148,12 +2472,12 @@ if ($canUseHTML) { } return (([string]$Character) * ($Host.UI.RawUI.BufferSize.Width - 1)) - - - - - - - - - + + + + + + + + + diff --git a/PSDevOps.types.ps1xml b/PSDevOps.types.ps1xml index 35dc249e..62f6c6b3 100644 --- a/PSDevOps.types.ps1xml +++ b/PSDevOps.types.ps1xml @@ -1,127 +1,127 @@ - - - - - PSDevOps.Agent - - - AgentID - ID - - - - - Deserialized.PSDevOps.Agent - - - AgentID - ID - - - - - PSDevOps.AreaPath - - - AreaPath - Path - - - AreaPathID - Identifier - - - - - Deserialized.PSDevOps.AreaPath - - - AreaPath - Path - - - AreaPathID - Identifier - - - - - PSDevOps.ArtifactFeed - - - FeedID - fullyQualifiedId - - - - - Deserialized.PSDevOps.ArtifactFeed - - - FeedID - fullyQualifiedId - - - - - PSDevOps.ArtifactFeed.Package - - - packageId - id - - - - - Deserialized.PSDevOps.ArtifactFeed.Package - - - packageId - id - - - - - PSDevOps.ArtifactFeed.PackageVersion - - - versionID - id - - - - - Deserialized.PSDevOps.ArtifactFeed.PackageVersion - - - versionID - id - - - - - PSDevOps.ArtifactFeed.View - - - ViewID - id - - - - - Deserialized.PSDevOps.ArtifactFeed.View - - - ViewID - id - - - - - PSDevOps.Behavior - - - BehaviorID + + + + + PSDevOps.Agent + + + AgentID + ID + + + + + Deserialized.PSDevOps.Agent + + + AgentID + ID + + + + + PSDevOps.AreaPath + + + AreaPath + Path + + + AreaPathID + Identifier + + + + + Deserialized.PSDevOps.AreaPath + + + AreaPath + Path + + + AreaPathID + Identifier + + + + + PSDevOps.ArtifactFeed + + + FeedID + fullyQualifiedId + + + + + Deserialized.PSDevOps.ArtifactFeed + + + FeedID + fullyQualifiedId + + + + + PSDevOps.ArtifactFeed.Package + + + packageId + id + + + + + Deserialized.PSDevOps.ArtifactFeed.Package + + + packageId + id + + + + + PSDevOps.ArtifactFeed.PackageVersion + + + versionID + id + + + + + Deserialized.PSDevOps.ArtifactFeed.PackageVersion + + + versionID + id + + + + + PSDevOps.ArtifactFeed.View + + + ViewID + id + + + + + Deserialized.PSDevOps.ArtifactFeed.View + + + ViewID + id + + + + + PSDevOps.Behavior + + + BehaviorID if ($this.behavior.id) { $this.behavior.id @@ -129,15 +129,15 @@ ([uri]$this.url).Segments[-1].TrimStart('/') } - - - - - - Deserialized.PSDevOps.Behavior - - - BehaviorID + + + + + + Deserialized.PSDevOps.Behavior + + + BehaviorID if ($this.behavior.id) { $this.behavior.id @@ -145,353 +145,353 @@ ([uri]$this.url).Segments[-1].TrimStart('/') } - - - - - - PSDevOps.Build - - - BuildID - ID - - - ChangedAt + + + + + + PSDevOps.Build + + + BuildID + ID + + + ChangedAt $this.LastChangedDate -as [DateTime] - - - - FinishedAt + + + + FinishedAt $this.finishTime -as [DateTime] - - - - QueuedAt + + + + QueuedAt $this.queueTime -as [DateTime] - - - - StartedAt + + + + StartedAt $this.StartTime -as [DateTime] - - - - - - Deserialized.PSDevOps.Build - - - BuildID - ID - - - ChangedAt + + + + + + Deserialized.PSDevOps.Build + + + BuildID + ID + + + ChangedAt $this.LastChangedDate -as [DateTime] - - - - FinishedAt + + + + FinishedAt $this.finishTime -as [DateTime] - - - - QueuedAt + + + + QueuedAt $this.queueTime -as [DateTime] - - - - StartedAt + + + + StartedAt $this.StartTime -as [DateTime] - - - - - - PSDevOps.Build.Artifact - - - Download + + + + + + PSDevOps.Build.Artifact + + + Download - - - ArtifactData + + + + ArtifactData $this.resource.data - - - - ArtifactType + + + + ArtifactType $this.Resource.type - - - - - - Deserialized.PSDevOps.Build.Artifact - - - Download + + + + + + Deserialized.PSDevOps.Build.Artifact + + + Download - - - ArtifactData + + + + ArtifactData $this.resource.data - - - - ArtifactType + + + + ArtifactType $this.Resource.type - - - - - - PSDevOps.Build.Definition - - - BuildPath - Path - - - DefinitionID - ID - - - - - Deserialized.PSDevOps.Build.Definition - - - BuildPath - Path - - - DefinitionID - ID - - - - - PSDevOps.Build.Timeline - - - Agent + + + + + + PSDevOps.Build.Definition + + + BuildPath + Path + + + DefinitionID + ID + + + + + Deserialized.PSDevOps.Build.Definition + + + BuildPath + Path + + + DefinitionID + ID + + + + + PSDevOps.Build.Timeline + + + Agent $this.Records | Select-Object -ExpandProperty WorkerName -Unique - - - - - - Deserialized.PSDevOps.Build.Timeline - - - Agent + + + + + + Deserialized.PSDevOps.Build.Timeline + + + Agent $this.Records | Select-Object -ExpandProperty WorkerName -Unique - - - - - - PSDevOps.Consumer - - - ConsumerID - ID - - - - - Deserialized.PSDevOps.Consumer - - - ConsumerID - ID - - - - - PSDevOps.Dashboard - - - DashboardID - ID - - - - - Deserialized.PSDevOps.Dashboard - - - DashboardID - ID - - - - - PSDevOps.ExtensionContribution - - - ContributionID - ID - - - Description + + + + + + PSDevOps.Consumer + + + ConsumerID + ID + + + + + Deserialized.PSDevOps.Consumer + + + ConsumerID + ID + + + + + PSDevOps.Dashboard + + + DashboardID + ID + + + + + Deserialized.PSDevOps.Dashboard + + + DashboardID + ID + + + + + PSDevOps.ExtensionContribution + + + ContributionID + ID + + + Description $this.properties.description - - - - Name + + + + Name $this.properties.name - - - - - - Deserialized.PSDevOps.ExtensionContribution - - - ContributionID - ID - - - Description + + + + + + Deserialized.PSDevOps.ExtensionContribution + + + ContributionID + ID + + + Description $this.properties.description - - - - Name + + + + Name $this.properties.name - - - - - - PSDevOps.Field - - - FieldName - ReferenceName - - - - - Deserialized.PSDevOps.Field - - - FieldName - ReferenceName - - - - - PSDevOps.GitIssue - - - Created + + + + + + PSDevOps.Field + + + FieldName + ReferenceName + + + + + Deserialized.PSDevOps.Field + + + FieldName + ReferenceName + + + + + PSDevOps.GitIssue + + + Created [DateTime]$this.created_At - - - - Updated + + + + Updated [DateTime]$this.updated_At - - - - - - Deserialized.PSDevOps.GitIssue - - - Created + + + + + + Deserialized.PSDevOps.GitIssue + + + Created [DateTime]$this.created_At - - - - Updated + + + + Updated [DateTime]$this.updated_At - - - - - - PSDevOps.GitLicense - - - License - Key - - - - - Deserialized.PSDevOps.GitLicense - - - License - Key - - - - - PSDevOps.GitObject - - - Initialize + + + + + + PSDevOps.GitLicense + + + License + Key + + + + + Deserialized.PSDevOps.GitLicense + + + License + Key + + + + + PSDevOps.GitObject + + + Initialize - - - - - Deserialized.PSDevOps.GitObject - - - Initialize + + + + + + Deserialized.PSDevOps.GitObject + + + Initialize - - - - - PSDevOps.GitRepo - - - CreatedAt + + + + + + PSDevOps.GitRepo + + + CreatedAt [DateTime]$this.created_At - - - - OwnerName + + + + OwnerName $this.Owner.Login - - - - - - Deserialized.PSDevOps.GitRepo - - - CreatedAt + + + + + + Deserialized.PSDevOps.GitRepo + + + CreatedAt [DateTime]$this.created_At - - - - OwnerName + + + + OwnerName $this.Owner.Login - - - - - - PSDevOps.IterationPath - - - IterationID - Identifier - - - IterationPath - Path - - - EndDate + + + + + + PSDevOps.IterationPath + + + IterationID + Identifier + + + IterationPath + Path + + + EndDate if ($this.Attributes.FinishDate) { ($this.Attributes.FinishDate -as [DateTime]).ToUniversalTime() } - - - - FinishDate + + + + FinishDate if ($this.Attributes.FinishDate) { ($this.Attributes.FinishDate -as [DateTime]).ToUniversalTime() } - - - - StartDate + + + + StartDate if ($this.Attributes.StartDate) { ($this.Attributes.StartDate -as [DateTime]).ToUniversalTime() } - - - - - - Deserialized.PSDevOps.IterationPath - - - IterationID - Identifier - - - IterationPath - Path - - - EndDate + + + + + + Deserialized.PSDevOps.IterationPath + + + IterationID + Identifier + + + IterationPath + Path + + + EndDate if ($this.Attributes.FinishDate) { ($this.Attributes.FinishDate -as [DateTime]).ToUniversalTime() } - - - - FinishDate + + + + FinishDate if ($this.Attributes.FinishDate) { ($this.Attributes.FinishDate -as [DateTime]).ToUniversalTime() } - - - - StartDate + + + + StartDate if ($this.Attributes.StartDate) { ($this.Attributes.StartDate -as [DateTime]).ToUniversalTime() } - - - - - - PSDevOps.Picklist - - - PicklistID - ID - - - - - Deserialized.PSDevOps.Picklist - - - PicklistID - ID - - - - - PSDevOps.Picklist.Detail - - - PicklistID - ID - - - - - Deserialized.PSDevOps.Picklist.Detail - - - PicklistID - ID - - - - - PSDevOps.Pool - - - PoolID - ID - - - DateCreated + + + + + + PSDevOps.Picklist + + + PicklistID + ID + + + + + Deserialized.PSDevOps.Picklist + + + PicklistID + ID + + + + + PSDevOps.Picklist.Detail + + + PicklistID + ID + + + + + Deserialized.PSDevOps.Picklist.Detail + + + PicklistID + ID + + + + + PSDevOps.Pool + + + PoolID + ID + + + DateCreated [DateTime]$this.createdOn - - - - OwnerName + + + + OwnerName $this.owner.displayName - - - - - - Deserialized.PSDevOps.Pool - - - PoolID - ID - - - DateCreated + + + + + + Deserialized.PSDevOps.Pool + + + PoolID + ID + + + DateCreated [DateTime]$this.createdOn - - - - OwnerName + + + + OwnerName $this.owner.displayName - - - - - - PSDevOps.Project - - - PSStandardMembers - - - DefaultDisplayPropertySet - - Organization - Project - LastUpdateTime - Description - - - - - - Project - Name - - - ProjectID - ID - - - LastUpdated + + + + + + PSDevOps.Project + + + PSStandardMembers + + + DefaultDisplayPropertySet + + Organization + Project + LastUpdateTime + Description + + + + + + Project + Name + + + ProjectID + ID + + + LastUpdated [DateTime]$this.LastUpdateTime - - - - - - Deserialized.PSDevOps.Project - - - PSStandardMembers - - - DefaultDisplayPropertySet - - Organization - Project - LastUpdateTime - Description - - - - - - Project - Name - - - ProjectID - ID - - - LastUpdated + + + + + + Deserialized.PSDevOps.Project + + + PSStandardMembers + + + DefaultDisplayPropertySet + + Organization + Project + LastUpdateTime + Description + + + + + + Project + Name + + + ProjectID + ID + + + LastUpdated [DateTime]$this.LastUpdateTime - - - - - - PSDevOps.Publisher - - - PublisherID - ID - - - - - Deserialized.PSDevOps.Publisher - - - PublisherID - ID - - - - - PSDevOps.Repository - - - RepositoryID - ID - - - - - Deserialized.PSDevOps.Repository - - - RepositoryID - ID - - - - - PSDevOps.Repository.SourceProvider - - - ProviderName - Name - - - - - Deserialized.PSDevOps.Repository.SourceProvider - - - ProviderName - Name - - - - - PSDevOps.Rule - - - RuleID - ID - - - - - Deserialized.PSDevOps.Rule - - - RuleID - ID - - - - - PSDevOps.SecurityNamespace - - - ConvertFromBitmask + + + + + + PSDevOps.Publisher + + + PublisherID + ID + + + + + Deserialized.PSDevOps.Publisher + + + PublisherID + ID + + + + + PSDevOps.Repository + + + RepositoryID + ID + + + + + Deserialized.PSDevOps.Repository + + + RepositoryID + ID + + + + + PSDevOps.Repository.SourceProvider + + + ProviderName + Name + + + + + Deserialized.PSDevOps.Repository.SourceProvider + + + ProviderName + Name + + + + + PSDevOps.Rule + + + RuleID + ID + + + + + Deserialized.PSDevOps.Rule + + + RuleID + ID + + + + + PSDevOps.SecurityNamespace + + + ConvertFromBitmask - - - ConvertToBitmask + + + + ConvertToBitmask - - - Permissions + + + + Permissions foreach ($perm in $this.Actions) { $perm.Name } - - - - Role + + + + Role [PSCustomObject][Ordered]@{ Read = @( @@ -1020,15 +1020,15 @@ $bitMask - - - - - - Deserialized.PSDevOps.SecurityNamespace - - - ConvertFromBitmask + + + + + + Deserialized.PSDevOps.SecurityNamespace + + + ConvertFromBitmask - - - ConvertToBitmask + + + + ConvertToBitmask - - - Permissions + + + + Permissions foreach ($perm in $this.Actions) { $perm.Name } - - - - Role + + + + Role [PSCustomObject][Ordered]@{ Read = @( @@ -1103,353 +1103,353 @@ $bitMask - - - - - - PSDevOps.ServiceEndpoint - - - EndpointID - ID - - - EndpointType - Type - - - - - Deserialized.PSDevOps.ServiceEndpoint - - - EndpointID - ID - - - EndpointType - Type - - - - - PSDevOps.SharedQuery - - - QueryID - ID - - - - - Deserialized.PSDevOps.SharedQuery - - - QueryID - ID - - - - - PSDevOps.State - - - StateID - ID - - - - - Deserialized.PSDevOps.State - - - StateID - ID - - - - - PSDevOps.Team - - - Team - Name - - - TeamID - ID - - - - - Deserialized.PSDevOps.Team - - - Team - Name - - - TeamID - ID - - - - - PSDevOps.TeamDescriptor - - - TeamDescriptor - Value - - - - - Deserialized.PSDevOps.TeamDescriptor - - - TeamDescriptor - Value - - - - - PSDevOps.TeamMembership - - - MemberUrl + + + + + + PSDevOps.ServiceEndpoint + + + EndpointID + ID + + + EndpointType + Type + + + + + Deserialized.PSDevOps.ServiceEndpoint + + + EndpointID + ID + + + EndpointType + Type + + + + + PSDevOps.SharedQuery + + + QueryID + ID + + + + + Deserialized.PSDevOps.SharedQuery + + + QueryID + ID + + + + + PSDevOps.State + + + StateID + ID + + + + + Deserialized.PSDevOps.State + + + StateID + ID + + + + + PSDevOps.Team + + + Team + Name + + + TeamID + ID + + + + + Deserialized.PSDevOps.Team + + + Team + Name + + + TeamID + ID + + + + + PSDevOps.TeamDescriptor + + + TeamDescriptor + Value + + + + + Deserialized.PSDevOps.TeamDescriptor + + + TeamDescriptor + Value + + + + + PSDevOps.TeamMembership + + + MemberUrl $this._links.member.href -as [uri] - - - - - - Deserialized.PSDevOps.TeamMembership - - - MemberUrl + + + + + + Deserialized.PSDevOps.TeamMembership + + + MemberUrl $this._links.member.href -as [uri] - - - - - - PSDevOps.TestPlan - - - TestPlanID - ID - - - TestPlanName - Name - - - - - Deserialized.PSDevOps.TestPlan - - - TestPlanID - ID - - - TestPlanName - Name - - - - - PSDevOps.TestResult - - - TestResultID - ID - - - - - Deserialized.PSDevOps.TestResult - - - TestResultID - ID - - - - - PSDevOps.TestRun - - - TestRunID - ID - - - - - Deserialized.PSDevOps.TestRun - - - TestRunID - ID - - - - - PSDevOps.TestSuite - - - TestSuiteID - ID - - - LastUpdated + + + + + + PSDevOps.TestPlan + + + TestPlanID + ID + + + TestPlanName + Name + + + + + Deserialized.PSDevOps.TestPlan + + + TestPlanID + ID + + + TestPlanName + Name + + + + + PSDevOps.TestResult + + + TestResultID + ID + + + + + Deserialized.PSDevOps.TestResult + + + TestResultID + ID + + + + + PSDevOps.TestRun + + + TestRunID + ID + + + + + Deserialized.PSDevOps.TestRun + + + TestRunID + ID + + + + + PSDevOps.TestSuite + + + TestSuiteID + ID + + + LastUpdated [DateTime]$this.LastUpdatedDate - - - - - - Deserialized.PSDevOps.TestSuite - - - TestSuiteID - ID - - - LastUpdated + + + + + + Deserialized.PSDevOps.TestSuite + + + TestSuiteID + ID + + + LastUpdated [DateTime]$this.LastUpdatedDate - - - - - - PSDevOps.User - - - UserDescriptor - Descriptor - - - - - Deserialized.PSDevOps.User - - - UserDescriptor - Descriptor - - - - - PSDevOps.Widget - - - WidgetID - ID - - - GetHTML + + + + + + PSDevOps.User + + + UserDescriptor + Descriptor + + + + + Deserialized.PSDevOps.User + + + UserDescriptor + Descriptor + + + + + PSDevOps.Widget + + + WidgetID + ID + + + GetHTML - - - ExtensionID + + + + ExtensionID @($this.contributionId -split '\.')[1] - - - - PublisherID + + + + PublisherID @($this.contributionId -split '\.')[0] - - - - - - Deserialized.PSDevOps.Widget - - - WidgetID - ID - - - GetHTML + + + + + + Deserialized.PSDevOps.Widget + + + WidgetID + ID + + + GetHTML - - - ExtensionID + + + + ExtensionID @($this.contributionId -split '\.')[1] - - - - PublisherID + + + + PublisherID @($this.contributionId -split '\.')[0] - - - - - - PSDevOps.Wiki - - - WikiID - ID - - - - - Deserialized.PSDevOps.Wiki - - - WikiID - ID - - - - - PSDevOps.WorkItem - - - AssignedTo - System.AssignedTo - - - ID - System.ID - - - LastUpdated - ChangedDate - - - Title - System.Title - - - AddComment + + + + + + PSDevOps.Wiki + + + WikiID + ID + + + + + Deserialized.PSDevOps.Wiki + + + WikiID + ID + + + + + PSDevOps.WorkItem + + + AssignedTo + System.AssignedTo + + + ID + System.ID + + + LastUpdated + ChangedDate + + + Title + System.Title + + + AddComment - - - HTMLToText + + + + HTMLToText - - - ChangedDate + + + + ChangedDate [DateTime]$this.'System.ChangedDate' - - - - CreatedDate + + + + CreatedDate [DateTime]$this.'System.CreatedDate' - - - - - - Deserialized.PSDevOps.WorkItem - - - AssignedTo - System.AssignedTo - - - ID - System.ID - - - LastUpdated - ChangedDate - - - Title - System.Title - - - AddComment + + + + + + Deserialized.PSDevOps.WorkItem + + + AssignedTo + System.AssignedTo + + + ID + System.ID + + + LastUpdated + ChangedDate + + + Title + System.Title + + + AddComment - - - HTMLToText + + + + HTMLToText - - - ChangedDate + + + + ChangedDate [DateTime]$this.'System.ChangedDate' - - - - CreatedDate + + + + CreatedDate [DateTime]$this.'System.CreatedDate' - - - - - - PSDevOps.WorkItem.Comment - - - CommentID - ID - - - Comment + + + + + + PSDevOps.WorkItem.Comment + + + CommentID + ID + + + Comment $this.Text -replace '<br(?:/)?>', [Environment]::NewLine -replace @@ -1587,24 +1587,24 @@ Invoke-ADORestAPI -Uri "$($this.Url)/comments" -QueryParameter @{"api-version"=" '\<[^\>]+\>', '' -replace '&quot;', '"' -replace '&nbsp;',' ' -replace ([Environment]::NewLine * 2), [Environment]::NewLine - - - - CreatedAt + + + + CreatedAt ([DateTime]$this.CreatedDate).ToLocalTime() - - - - ModifiedAt + + + + ModifiedAt ([DateTime]$this.ModifiedDate).ToLocalTime() - - - - Reaction + + + + Reaction Invoke-ADORestAPI -Uri "$($this.Url)/reactions" -Property @{ Project = $this.Project @@ -1617,19 +1617,19 @@ Invoke-ADORestAPI -Uri "$($this.Url)/comments" -QueryParameter @{"api-version"=" 'PSDevOps.WorkItem.CommentReaction' ) - - - - - - Deserialized.PSDevOps.WorkItem.Comment - - - CommentID - ID - - - Comment + + + + + + Deserialized.PSDevOps.WorkItem.Comment + + + CommentID + ID + + + Comment $this.Text -replace '<br(?:/)?>', [Environment]::NewLine -replace @@ -1639,24 +1639,24 @@ Invoke-ADORestAPI -Uri "$($this.Url)/comments" -QueryParameter @{"api-version"=" '\<[^\>]+\>', '' -replace '&quot;', '"' -replace '&nbsp;',' ' -replace ([Environment]::NewLine * 2), [Environment]::NewLine - - - - CreatedAt + + + + CreatedAt ([DateTime]$this.CreatedDate).ToLocalTime() - - - - ModifiedAt + + + + ModifiedAt ([DateTime]$this.ModifiedDate).ToLocalTime() - - - - Reaction + + + + Reaction Invoke-ADORestAPI -Uri "$($this.Url)/reactions" -Property @{ Project = $this.Project @@ -1669,52 +1669,52 @@ Invoke-ADORestAPI -Uri "$($this.Url)/comments" -QueryParameter @{"api-version"=" 'PSDevOps.WorkItem.CommentReaction' ) - - - - - - PSDevOps.WorkItemType - - - WorkItemTypeName - ReferenceName - - - - - Deserialized.PSDevOps.WorkItemType - - - WorkItemTypeName - ReferenceName - - - - - PSDevOps.WorkProcess - - - ProcessID - TypeID - - - ProcessName - Name - - - - - Deserialized.PSDevOps.WorkProcess - - - ProcessID - TypeID - - - ProcessName - Name - - - - + + + + + + PSDevOps.WorkItemType + + + WorkItemTypeName + ReferenceName + + + + + Deserialized.PSDevOps.WorkItemType + + + WorkItemTypeName + ReferenceName + + + + + PSDevOps.WorkProcess + + + ProcessID + TypeID + + + ProcessName + Name + + + + + Deserialized.PSDevOps.WorkProcess + + + ProcessID + TypeID + + + ProcessName + Name + + + +