PSDevOps.types.ps1xml
<?xml version="1.0" encoding="utf-16"?>
<!-- Generated with EZOut 1.8.5: Install-Module EZOut or https://github.com/StartAutomating/EZOut --> <Types> <Type> <Name>PSDevOps.Agent</Name> <Members> <AliasProperty> <Name>AgentID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Agent</Name> <Members> <AliasProperty> <Name>AgentID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.ArtifactFeed</Name> <Members> <AliasProperty> <Name>FeedID</Name> <ReferencedMemberName>fullyQualifiedId</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.ArtifactFeed</Name> <Members> <AliasProperty> <Name>FeedID</Name> <ReferencedMemberName>fullyQualifiedId</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.ArtifactFeed.Package</Name> <Members> <AliasProperty> <Name>packageId</Name> <ReferencedMemberName>id</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.ArtifactFeed.Package</Name> <Members> <AliasProperty> <Name>packageId</Name> <ReferencedMemberName>id</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.ArtifactFeed.PackageVersion</Name> <Members> <AliasProperty> <Name>versionID</Name> <ReferencedMemberName>id</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.ArtifactFeed.PackageVersion</Name> <Members> <AliasProperty> <Name>versionID</Name> <ReferencedMemberName>id</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.ArtifactFeed.View</Name> <Members> <AliasProperty> <Name>ViewID</Name> <ReferencedMemberName>id</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.ArtifactFeed.View</Name> <Members> <AliasProperty> <Name>ViewID</Name> <ReferencedMemberName>id</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.Behavior</Name> <Members> <ScriptProperty> <Name>BehaviorID</Name> <GetScriptBlock> if ($this.behavior.id) { $this.behavior.id } elseif ($this.url) { ([uri]$this.url).Segments[-1].TrimStart('/') } </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Behavior</Name> <Members> <ScriptProperty> <Name>BehaviorID</Name> <GetScriptBlock> if ($this.behavior.id) { $this.behavior.id } elseif ($this.url) { ([uri]$this.url).Segments[-1].TrimStart('/') } </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.Build</Name> <Members> <AliasProperty> <Name>BuildID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <ScriptProperty> <Name>ChangedAt</Name> <GetScriptBlock> $this.LastChangedDate -as [DateTime] </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>FinishedAt</Name> <GetScriptBlock> $this.finishTime -as [DateTime] </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>QueuedAt</Name> <GetScriptBlock> $this.queueTime -as [DateTime] </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>StartedAt</Name> <GetScriptBlock> $this.StartTime -as [DateTime] </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Build</Name> <Members> <AliasProperty> <Name>BuildID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <ScriptProperty> <Name>ChangedAt</Name> <GetScriptBlock> $this.LastChangedDate -as [DateTime] </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>FinishedAt</Name> <GetScriptBlock> $this.finishTime -as [DateTime] </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>QueuedAt</Name> <GetScriptBlock> $this.queueTime -as [DateTime] </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>StartedAt</Name> <GetScriptBlock> $this.StartTime -as [DateTime] </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.Build.Artifact</Name> <Members> <ScriptMethod> <Name>Download</Name> <Script> if ($this.resource.downloadUrl) { Invoke-ADORestAPI -Uri $this.resource.downloadURL -AsByte } </Script> </ScriptMethod> <ScriptProperty> <Name>ArtifactData</Name> <GetScriptBlock> $this.resource.data </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>ArtifactType</Name> <GetScriptBlock> $this.Resource.type </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Build.Artifact</Name> <Members> <ScriptMethod> <Name>Download</Name> <Script> if ($this.resource.downloadUrl) { Invoke-ADORestAPI -Uri $this.resource.downloadURL -AsByte } </Script> </ScriptMethod> <ScriptProperty> <Name>ArtifactData</Name> <GetScriptBlock> $this.resource.data </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>ArtifactType</Name> <GetScriptBlock> $this.Resource.type </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.Build.Definition</Name> <Members> <AliasProperty> <Name>DefinitionID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Build.Definition</Name> <Members> <AliasProperty> <Name>DefinitionID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.Build.Timeline</Name> <Members> <ScriptProperty> <Name>Agent</Name> <GetScriptBlock> $this.Records | Select-Object -ExpandProperty WorkerName -Unique </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Build.Timeline</Name> <Members> <ScriptProperty> <Name>Agent</Name> <GetScriptBlock> $this.Records | Select-Object -ExpandProperty WorkerName -Unique </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.Consumer</Name> <Members> <AliasProperty> <Name>ConsumerID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Consumer</Name> <Members> <AliasProperty> <Name>ConsumerID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.Dashboard</Name> <Members> <AliasProperty> <Name>DashboardID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Dashboard</Name> <Members> <AliasProperty> <Name>DashboardID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.ExtensionContribution</Name> <Members> <AliasProperty> <Name>ContributionID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <ScriptProperty> <Name>Description</Name> <GetScriptBlock> $this.properties.description </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>Name</Name> <GetScriptBlock> $this.properties.name </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.ExtensionContribution</Name> <Members> <AliasProperty> <Name>ContributionID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <ScriptProperty> <Name>Description</Name> <GetScriptBlock> $this.properties.description </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>Name</Name> <GetScriptBlock> $this.properties.name </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.Field</Name> <Members> <AliasProperty> <Name>FieldName</Name> <ReferencedMemberName>ReferenceName</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Field</Name> <Members> <AliasProperty> <Name>FieldName</Name> <ReferencedMemberName>ReferenceName</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.GitIssue</Name> <Members> <ScriptProperty> <Name>Created</Name> <GetScriptBlock> [DateTime]$this.created_At </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>Updated</Name> <GetScriptBlock> [DateTime]$this.updated_At </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.GitIssue</Name> <Members> <ScriptProperty> <Name>Created</Name> <GetScriptBlock> [DateTime]$this.created_At </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>Updated</Name> <GetScriptBlock> [DateTime]$this.updated_At </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.GitLicense</Name> <Members> <AliasProperty> <Name>License</Name> <ReferencedMemberName>Key</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.GitLicense</Name> <Members> <AliasProperty> <Name>License</Name> <ReferencedMemberName>Key</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.GitObject</Name> <Members> <ScriptMethod> <Name>Initialize</Name> <Script> $RestVariable = [Regex]::new(@' # Matches URL segments and query strings containing variables. # Variables can be enclosed in brackets or curly braces, or preceeded by a $ or : (?> # A variable can be in a URL segment or subdomain (?<Start>[/\.]) # Match the <Start>ing slash|dot ... (?<IsOptional>\?)? # ... an optional ? (to indicate optional) ... (?: \{(?<Variable>\w+)\}| # ... A <Variable> name in {} OR \[(?<Variable>\w+)\]| # A <Variable> name in [] OR \$(?<Variable>\w+) | # A $ followed by a <Variable> OR \:(?<Variable>\w+) # A : followed by a <Variable> ) | (?<IsOptional> # If it's optional it can also be [{\[](?<Start>/) # a bracket or brace, followed by a slash ) (?<Variable>\w+)[}\]] # then a <Variable> name followed by } or ] | # OR it can be in a query parameter: (?<Start>[?&]) # Match The <Start>ing ? or & ... (?<Query>[\w\-]+) # ... the <Query> parameter name ... = # ... an equals ... (?<IsOptional>\?)? # ... an optional ? (to indicate optional) ... (?: \{(?<Variable>\w+)\}| # ... A <Variable> name in {} OR \[(?<Variable>\w+)\]| # A <Variable> name in [] OR \$(?<Variable>\w+) | # A $ followed by a <Variable> OR \:(?<Variable>\w+) # A : followed by a <Variable> ) ) '@, 'IgnoreCase,IgnorePatternWhitespace') foreach ($property in $this.psobject.properties) { if (-not $property.Name.EndsWith("_url")) { continue } $params = @(foreach ($match in $RestVariable.Matches($property.Value)) { '$' + $match.Groups["Variable"].Value }) -join ',' $newMethodName = $property.Name.Substring(0, $property.Name.Length - 4) -replace '_' $newMethodName = 'Get' + $newMethodName.Substring(0,1).ToUpper() + $newMethodName.Substring(1) if (-not $this.$newMethodName) { $this.psobject.methods.add([PSScriptMethod]::new( $newMethodName, [ScriptBlock]::Create(@" param($params) Invoke-GitRESTApi -Uri '$($property.Value)' -UrlParameter `$psboundParameters "@) )) } } </Script> </ScriptMethod> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.GitObject</Name> <Members> <ScriptMethod> <Name>Initialize</Name> <Script> $RestVariable = [Regex]::new(@' # Matches URL segments and query strings containing variables. # Variables can be enclosed in brackets or curly braces, or preceeded by a $ or : (?> # A variable can be in a URL segment or subdomain (?<Start>[/\.]) # Match the <Start>ing slash|dot ... (?<IsOptional>\?)? # ... an optional ? (to indicate optional) ... (?: \{(?<Variable>\w+)\}| # ... A <Variable> name in {} OR \[(?<Variable>\w+)\]| # A <Variable> name in [] OR \$(?<Variable>\w+) | # A $ followed by a <Variable> OR \:(?<Variable>\w+) # A : followed by a <Variable> ) | (?<IsOptional> # If it's optional it can also be [{\[](?<Start>/) # a bracket or brace, followed by a slash ) (?<Variable>\w+)[}\]] # then a <Variable> name followed by } or ] | # OR it can be in a query parameter: (?<Start>[?&]) # Match The <Start>ing ? or & ... (?<Query>[\w\-]+) # ... the <Query> parameter name ... = # ... an equals ... (?<IsOptional>\?)? # ... an optional ? (to indicate optional) ... (?: \{(?<Variable>\w+)\}| # ... A <Variable> name in {} OR \[(?<Variable>\w+)\]| # A <Variable> name in [] OR \$(?<Variable>\w+) | # A $ followed by a <Variable> OR \:(?<Variable>\w+) # A : followed by a <Variable> ) ) '@, 'IgnoreCase,IgnorePatternWhitespace') foreach ($property in $this.psobject.properties) { if (-not $property.Name.EndsWith("_url")) { continue } $params = @(foreach ($match in $RestVariable.Matches($property.Value)) { '$' + $match.Groups["Variable"].Value }) -join ',' $newMethodName = $property.Name.Substring(0, $property.Name.Length - 4) -replace '_' $newMethodName = 'Get' + $newMethodName.Substring(0,1).ToUpper() + $newMethodName.Substring(1) if (-not $this.$newMethodName) { $this.psobject.methods.add([PSScriptMethod]::new( $newMethodName, [ScriptBlock]::Create(@" param($params) Invoke-GitRESTApi -Uri '$($property.Value)' -UrlParameter `$psboundParameters "@) )) } } </Script> </ScriptMethod> </Members> </Type> <Type> <Name>PSDevOps.GitRepo</Name> <Members> <ScriptProperty> <Name>CreatedAt</Name> <GetScriptBlock> [DateTime]$this.created_At </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>OwnerName</Name> <GetScriptBlock> $this.Owner.Login </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.GitRepo</Name> <Members> <ScriptProperty> <Name>CreatedAt</Name> <GetScriptBlock> [DateTime]$this.created_At </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>OwnerName</Name> <GetScriptBlock> $this.Owner.Login </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.IterationPath</Name> <Members> <ScriptProperty> <Name>EndDate</Name> <GetScriptBlock> if ($this.Attributes.FinishDate) { ($this.Attributes.FinishDate -as [DateTime]).ToUniversalTime() } </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>FinishDate</Name> <GetScriptBlock> if ($this.Attributes.FinishDate) { ($this.Attributes.FinishDate -as [DateTime]).ToUniversalTime() } </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>StartDate</Name> <GetScriptBlock> if ($this.Attributes.StartDate) { ($this.Attributes.StartDate -as [DateTime]).ToUniversalTime() } </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.IterationPath</Name> <Members> <ScriptProperty> <Name>EndDate</Name> <GetScriptBlock> if ($this.Attributes.FinishDate) { ($this.Attributes.FinishDate -as [DateTime]).ToUniversalTime() } </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>FinishDate</Name> <GetScriptBlock> if ($this.Attributes.FinishDate) { ($this.Attributes.FinishDate -as [DateTime]).ToUniversalTime() } </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>StartDate</Name> <GetScriptBlock> if ($this.Attributes.StartDate) { ($this.Attributes.StartDate -as [DateTime]).ToUniversalTime() } </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.Picklist</Name> <Members> <AliasProperty> <Name>PicklistID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Picklist</Name> <Members> <AliasProperty> <Name>PicklistID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.Picklist.Detail</Name> <Members> <AliasProperty> <Name>PicklistID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Picklist.Detail</Name> <Members> <AliasProperty> <Name>PicklistID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.Pool</Name> <Members> <AliasProperty> <Name>PoolID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <ScriptProperty> <Name>DateCreated</Name> <GetScriptBlock> [DateTime]$this.createdOn </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>OwnerName</Name> <GetScriptBlock> $this.owner.displayName </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Pool</Name> <Members> <AliasProperty> <Name>PoolID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <ScriptProperty> <Name>DateCreated</Name> <GetScriptBlock> [DateTime]$this.createdOn </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>OwnerName</Name> <GetScriptBlock> $this.owner.displayName </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.Project</Name> <Members> <MemberSet> <Name>PSStandardMembers</Name> <Members> <PropertySet> <Name>DefaultDisplayPropertySet</Name> <ReferencedProperties> <Name>Organization</Name> <Name>Project</Name> <Name>LastUpdateTime</Name> <Name>Description</Name> </ReferencedProperties> </PropertySet> </Members> </MemberSet> <AliasProperty> <Name>Project</Name> <ReferencedMemberName>Name</ReferencedMemberName> </AliasProperty> <AliasProperty> <Name>ProjectID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <ScriptProperty> <Name>LastUpdated</Name> <GetScriptBlock> [DateTime]$this.LastUpdateTime </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Project</Name> <Members> <MemberSet> <Name>PSStandardMembers</Name> <Members> <PropertySet> <Name>DefaultDisplayPropertySet</Name> <ReferencedProperties> <Name>Organization</Name> <Name>Project</Name> <Name>LastUpdateTime</Name> <Name>Description</Name> </ReferencedProperties> </PropertySet> </Members> </MemberSet> <AliasProperty> <Name>Project</Name> <ReferencedMemberName>Name</ReferencedMemberName> </AliasProperty> <AliasProperty> <Name>ProjectID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <ScriptProperty> <Name>LastUpdated</Name> <GetScriptBlock> [DateTime]$this.LastUpdateTime </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.Publisher</Name> <Members> <AliasProperty> <Name>PublisherID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Publisher</Name> <Members> <AliasProperty> <Name>PublisherID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.Repository</Name> <Members> <AliasProperty> <Name>RepositoryID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Repository</Name> <Members> <AliasProperty> <Name>RepositoryID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.Repository.SourceProvider</Name> <Members> <AliasProperty> <Name>ProviderName</Name> <ReferencedMemberName>Name</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Repository.SourceProvider</Name> <Members> <AliasProperty> <Name>ProviderName</Name> <ReferencedMemberName>Name</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.Rule</Name> <Members> <AliasProperty> <Name>RuleID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Rule</Name> <Members> <AliasProperty> <Name>RuleID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.SecurityNamespace</Name> <Members> <ScriptMethod> <Name>ConvertFromBitmask</Name> <Script> param( [int] $Bitmask ) @(foreach ($act in $this.Actions) { if ($Bitmask -band $act.bit) { $act.Name } }) </Script> </ScriptMethod> <ScriptMethod> <Name>ConvertToBitmask</Name> <Script> param( [Parameter(Mandatory,Position=0)] [string[]] $Permission ) $bitMask = 0 foreach ($act in $this.Actions) { foreach ($p in $Permission) { if ($act.Name -like $p -or $act.DisplayName -like $p) { $bitMask = $bitmask -bor $act.bit } } } $bitMask </Script> </ScriptMethod> <ScriptProperty> <Name>Permissions</Name> <GetScriptBlock> foreach ($perm in $this.Actions) { $perm.Name } </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>Role</Name> <GetScriptBlock> [PSCustomObject][Ordered]@{ Read = @( foreach ($act in $this.Actions) { if ($this.readPermission -band $act.bit) { $act.Name } } ) Write = @( foreach ($act in $this.Actions) { if ($this.writePermission -band $act.bit) { $act.Name } } ) System = @( foreach ($act in $this.Actions) { if ($this.systemBitmask -band $act.bit) { $act.Name } } ) } </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.SecurityNamespace</Name> <Members> <ScriptMethod> <Name>ConvertFromBitmask</Name> <Script> param( [int] $Bitmask ) @(foreach ($act in $this.Actions) { if ($Bitmask -band $act.bit) { $act.Name } }) </Script> </ScriptMethod> <ScriptMethod> <Name>ConvertToBitmask</Name> <Script> param( [Parameter(Mandatory,Position=0)] [string[]] $Permission ) $bitMask = 0 foreach ($act in $this.Actions) { foreach ($p in $Permission) { if ($act.Name -like $p -or $act.DisplayName -like $p) { $bitMask = $bitmask -bor $act.bit } } } $bitMask </Script> </ScriptMethod> <ScriptProperty> <Name>Permissions</Name> <GetScriptBlock> foreach ($perm in $this.Actions) { $perm.Name } </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>Role</Name> <GetScriptBlock> [PSCustomObject][Ordered]@{ Read = @( foreach ($act in $this.Actions) { if ($this.readPermission -band $act.bit) { $act.Name } } ) Write = @( foreach ($act in $this.Actions) { if ($this.writePermission -band $act.bit) { $act.Name } } ) System = @( foreach ($act in $this.Actions) { if ($this.systemBitmask -band $act.bit) { $act.Name } } ) } </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.ServiceEndpoint</Name> <Members> <AliasProperty> <Name>EndpointID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <AliasProperty> <Name>EndpointType</Name> <ReferencedMemberName>Type</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.ServiceEndpoint</Name> <Members> <AliasProperty> <Name>EndpointID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <AliasProperty> <Name>EndpointType</Name> <ReferencedMemberName>Type</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.SharedQuery</Name> <Members> <AliasProperty> <Name>QueryID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.SharedQuery</Name> <Members> <AliasProperty> <Name>QueryID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.State</Name> <Members> <AliasProperty> <Name>StateID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.State</Name> <Members> <AliasProperty> <Name>StateID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.Team</Name> <Members> <AliasProperty> <Name>Team</Name> <ReferencedMemberName>Name</ReferencedMemberName> </AliasProperty> <AliasProperty> <Name>TeamID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Team</Name> <Members> <AliasProperty> <Name>Team</Name> <ReferencedMemberName>Name</ReferencedMemberName> </AliasProperty> <AliasProperty> <Name>TeamID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.TeamDescriptor</Name> <Members> <AliasProperty> <Name>TeamDescriptor</Name> <ReferencedMemberName>Value</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.TeamDescriptor</Name> <Members> <AliasProperty> <Name>TeamDescriptor</Name> <ReferencedMemberName>Value</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.TeamMembership</Name> <Members> <ScriptProperty> <Name>MemberUrl</Name> <GetScriptBlock> $this._links.member.href -as [uri] </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.TeamMembership</Name> <Members> <ScriptProperty> <Name>MemberUrl</Name> <GetScriptBlock> $this._links.member.href -as [uri] </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.TestPlan</Name> <Members> <AliasProperty> <Name>TestPlanID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <AliasProperty> <Name>TestPlanName</Name> <ReferencedMemberName>Name</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.TestPlan</Name> <Members> <AliasProperty> <Name>TestPlanID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <AliasProperty> <Name>TestPlanName</Name> <ReferencedMemberName>Name</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.TestResult</Name> <Members> <AliasProperty> <Name>TestResultID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.TestResult</Name> <Members> <AliasProperty> <Name>TestResultID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.TestRun</Name> <Members> <AliasProperty> <Name>TestRunID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.TestRun</Name> <Members> <AliasProperty> <Name>TestRunID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.TestSuite</Name> <Members> <AliasProperty> <Name>TestSuiteID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <ScriptProperty> <Name>LastUpdated</Name> <GetScriptBlock> [DateTime]$this.LastUpdatedDate </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.TestSuite</Name> <Members> <AliasProperty> <Name>TestSuiteID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <ScriptProperty> <Name>LastUpdated</Name> <GetScriptBlock> [DateTime]$this.LastUpdatedDate </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.User</Name> <Members> <AliasProperty> <Name>UserDescriptor</Name> <ReferencedMemberName>Descriptor</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.User</Name> <Members> <AliasProperty> <Name>UserDescriptor</Name> <ReferencedMemberName>Descriptor</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.Widget</Name> <Members> <AliasProperty> <Name>WidgetID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <ScriptMethod> <Name>GetHTML</Name> <Script> if (-not $this.contentUri) { throw '$this.ContentUri is empty' } return Invoke-RestMethod $this.contentUri </Script> </ScriptMethod> <ScriptProperty> <Name>ExtensionID</Name> <GetScriptBlock> @($this.contributionId -split '\.')[1] </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>PublisherID</Name> <GetScriptBlock> @($this.contributionId -split '\.')[0] </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Widget</Name> <Members> <AliasProperty> <Name>WidgetID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <ScriptMethod> <Name>GetHTML</Name> <Script> if (-not $this.contentUri) { throw '$this.ContentUri is empty' } return Invoke-RestMethod $this.contentUri </Script> </ScriptMethod> <ScriptProperty> <Name>ExtensionID</Name> <GetScriptBlock> @($this.contributionId -split '\.')[1] </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>PublisherID</Name> <GetScriptBlock> @($this.contributionId -split '\.')[0] </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.Wiki</Name> <Members> <AliasProperty> <Name>WikiID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.Wiki</Name> <Members> <AliasProperty> <Name>WikiID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>PSDevOps.WorkItem</Name> <Members> <AliasProperty> <Name>AssignedTo</Name> <ReferencedMemberName>System.AssignedTo</ReferencedMemberName> </AliasProperty> <AliasProperty> <Name>ID</Name> <ReferencedMemberName>System.ID</ReferencedMemberName> </AliasProperty> <AliasProperty> <Name>LastUpdated</Name> <ReferencedMemberName>ChangedDate</ReferencedMemberName> </AliasProperty> <AliasProperty> <Name>Title</Name> <ReferencedMemberName>System.Title</ReferencedMemberName> </AliasProperty> <ScriptMethod> <Name>AddComment</Name> <Script> param($Comment) $commentBody = if ($Comment -is [string]) { @{text=$Comment} } else { $Comment } Invoke-ADORestAPI -Uri "$($this.Url)/comments" -QueryParameter @{"api-version"="5.1-preview"} -Method POST -Body $commentBody -PSTypeName @( "$($this.Organization).$($this.Project).WorkItem.Comment" "$($this.Organization).WorkItem.Comment" "PSDevOps.WorkItem.Comment" ) </Script> </ScriptMethod> <ScriptMethod> <Name>HTMLToText</Name> <Script> param([string]$html) $html -replace '<br(?:/)?>', [Environment]::NewLine -replace '</div>', [Environment]::NewLine -replace '<li>',"* " -replace '</li>', [Environment]::NewLine -replace '\<[^\>]+\>', '' -replace '&quot;', '"' -replace '&nbsp;',' ' -replace ([Environment]::NewLine * 2), [Environment]::NewLine </Script> </ScriptMethod> <ScriptProperty> <Name>ChangedDate</Name> <GetScriptBlock> [DateTime]$this.'System.ChangedDate' </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>CreatedDate</Name> <GetScriptBlock> [DateTime]$this.'System.CreatedDate' </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.WorkItem</Name> <Members> <AliasProperty> <Name>AssignedTo</Name> <ReferencedMemberName>System.AssignedTo</ReferencedMemberName> </AliasProperty> <AliasProperty> <Name>ID</Name> <ReferencedMemberName>System.ID</ReferencedMemberName> </AliasProperty> <AliasProperty> <Name>LastUpdated</Name> <ReferencedMemberName>ChangedDate</ReferencedMemberName> </AliasProperty> <AliasProperty> <Name>Title</Name> <ReferencedMemberName>System.Title</ReferencedMemberName> </AliasProperty> <ScriptMethod> <Name>AddComment</Name> <Script> param($Comment) $commentBody = if ($Comment -is [string]) { @{text=$Comment} } else { $Comment } Invoke-ADORestAPI -Uri "$($this.Url)/comments" -QueryParameter @{"api-version"="5.1-preview"} -Method POST -Body $commentBody -PSTypeName @( "$($this.Organization).$($this.Project).WorkItem.Comment" "$($this.Organization).WorkItem.Comment" "PSDevOps.WorkItem.Comment" ) </Script> </ScriptMethod> <ScriptMethod> <Name>HTMLToText</Name> <Script> param([string]$html) $html -replace '<br(?:/)?>', [Environment]::NewLine -replace '</div>', [Environment]::NewLine -replace '<li>',"* " -replace '</li>', [Environment]::NewLine -replace '\<[^\>]+\>', '' -replace '&quot;', '"' -replace '&nbsp;',' ' -replace ([Environment]::NewLine * 2), [Environment]::NewLine </Script> </ScriptMethod> <ScriptProperty> <Name>ChangedDate</Name> <GetScriptBlock> [DateTime]$this.'System.ChangedDate' </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>CreatedDate</Name> <GetScriptBlock> [DateTime]$this.'System.CreatedDate' </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.WorkItem.Comment</Name> <Members> <AliasProperty> <Name>CommentID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <ScriptProperty> <Name>Comment</Name> <GetScriptBlock> $this.Text -replace '<br(?:/)?>', [Environment]::NewLine -replace '</div>', [Environment]::NewLine -replace '<li>',"* " -replace '</li>', [Environment]::NewLine -replace '\<[^\>]+\>', '' -replace '&quot;', '"' -replace '&nbsp;',' ' -replace ([Environment]::NewLine * 2), [Environment]::NewLine </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>CreatedAt</Name> <GetScriptBlock> ([DateTime]$this.CreatedDate).ToLocalTime() </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>ModifiedAt</Name> <GetScriptBlock> ([DateTime]$this.ModifiedDate).ToLocalTime() </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>Reaction</Name> <GetScriptBlock> Invoke-ADORestAPI -Uri "$($this.Url)/reactions" -Property @{ Project = $this.Project Organization = $this.Organization WorkItemID = $this.WorkItemID Comment = $this.Comment } -PSTypeName @( "$($this.Organization).$($this.Project).WorkItem.CommentReaction" "$($this.Organization)..WorkItem.CommentReaction" 'PSDevOps.WorkItem.CommentReaction' ) </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.WorkItem.Comment</Name> <Members> <AliasProperty> <Name>CommentID</Name> <ReferencedMemberName>ID</ReferencedMemberName> </AliasProperty> <ScriptProperty> <Name>Comment</Name> <GetScriptBlock> $this.Text -replace '<br(?:/)?>', [Environment]::NewLine -replace '</div>', [Environment]::NewLine -replace '<li>',"* " -replace '</li>', [Environment]::NewLine -replace '\<[^\>]+\>', '' -replace '&quot;', '"' -replace '&nbsp;',' ' -replace ([Environment]::NewLine * 2), [Environment]::NewLine </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>CreatedAt</Name> <GetScriptBlock> ([DateTime]$this.CreatedDate).ToLocalTime() </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>ModifiedAt</Name> <GetScriptBlock> ([DateTime]$this.ModifiedDate).ToLocalTime() </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>Reaction</Name> <GetScriptBlock> Invoke-ADORestAPI -Uri "$($this.Url)/reactions" -Property @{ Project = $this.Project Organization = $this.Organization WorkItemID = $this.WorkItemID Comment = $this.Comment } -PSTypeName @( "$($this.Organization).$($this.Project).WorkItem.CommentReaction" "$($this.Organization)..WorkItem.CommentReaction" 'PSDevOps.WorkItem.CommentReaction' ) </GetScriptBlock> </ScriptProperty> </Members> </Type> <Type> <Name>PSDevOps.WorkItemType</Name> <Members> <AliasProperty> <Name>WorkItemTypeName</Name> <ReferencedMemberName>ReferenceName</ReferencedMemberName> </AliasProperty> </Members> </Type> <Type> <Name>Deserialized.PSDevOps.WorkItemType</Name> <Members> <AliasProperty> <Name>WorkItemTypeName</Name> <ReferencedMemberName>ReferenceName</ReferencedMemberName> </AliasProperty> </Members> </Type> </Types> |