diff --git a/.github/workflows/TestAndPublish.yml b/.github/workflows/TestAndPublish.yml index c0bdd72e..83a1da7e 100644 --- a/.github/workflows/TestAndPublish.yml +++ b/.github/workflows/TestAndPublish.yml @@ -1,4 +1,4 @@ - + name: Analyze, Test, Tag, and Publish on: push: @@ -485,6 +485,25 @@ jobs: } } } @Parameters + HelpOut: + runs-on: ubuntu-latest + if: ${{ success() }} + steps: + - name: Check out repository + uses: actions/checkout@v2 + - name: UseHelpOut + uses: StartAutomating/HelpOut@master + RunEZOut: + runs-on: ubuntu-latest + if: ${{ success() }} + steps: + - name: Check out repository + uses: actions/checkout@v2 + - name: UseEZOut + uses: StartAutomating/EZOut@master + - name: Push Changes + shell: pwsh + run: git push; exit 0 env: SYSTEM_ACCESSTOKEN: ${{ secrets.AZUREDEVOPSPAT }} NoCoverage: true diff --git a/CHANGELOG.md b/CHANGELOG.md index d9d66dd6..894469f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,29 @@ -0.5.7: +## 0.5.8: +* Running EZOut in Workflow (#148) +* Adding support for HelpOut (#147) +* Updating action (pushing changes) #144 +* Updating GitHub Workflow steps/jobs - adding support for HelpOut and EZOut +* Initial Version of PSDevOps Action (#144) +* Adding Remove-ADOPermission (#143) +* Set-ADOPermission: Fixing help typo +* Adding FlushRequestQueue Part +* Fixing Refactoring Related Import Issue +* Adding Initial Extensions (related to -ADOTest commands) +* Add-ADOTest: Initial Commit +* Get-ADOBuild: Passing along ProjectID and ProjectName +* Get/Set-ADOPermission: Repov2 issue (#140) +* Recategorizing Functions --- + +## 0.5.7: + * Fixing issue with setting branch permissions (#136) * Get/Set-ADOPermission: Support for ServiceEndpoints (#137) * Set-ADOPermission: Exposing specialized parameter sets (#138) * PSDevOps.WorkProcess objects now return .ProcessName and .ProcessID as alias properties - -0.5.6: --- + +## 0.5.6: ### Azure DevOps Improvements * Get-ADOPermission : Can now get permissions related to Dashboards, Analytics, AreaPaths, and IterationPaths * Set-ADOPermission : Now can easily set permissions based off of a variety of pipeline inputs (Fixes #128 and #91) @@ -17,130 +34,123 @@ * Adding "On" files for issue creation, deletion, or modification (Fixes #132) * Adding "On" files for common scheduling needs (Fixes #134) * ReleaseNameFormat can not be customized in ReleaseModule step (Fixes #130) - -0.5.5.1: --- + +## 0.5.5.1: * Allowing for [Reflection.AssemblyMetaData] attributes on step .ps1 files (to customize YAML). Issue #123 * Better support for Object and array parameters in Azure DevOps. Issue #125. - -0.5.5: --- +## 0.5.5: * Azure DevOps: Adding support for Shared Queries (Fixes #117) -** Get-ADOWorkItem -SharedQuery can get shared queries -** New-ADOWorkItem -WIQL will create shared queries. -FolderName will create folders. -** Remove-ADOWorkItem -QueryID can remove a shared query by ID + * Get-ADOWorkItem -SharedQuery can get shared queries + * New-ADOWorkItem -WIQL will create shared queries. -FolderName will create folders. + * Remove-ADOWorkItem -QueryID can remove a shared query by ID * GitHub Workflows: -** Adding Job/Step definitions to Release Module -** Adding -NoCoverage to RunPester Step -** Creating Example workflow that publishes PSDevOps. - -0.5.4.2: + * Adding Job/Step definitions to Release Module + * Adding -NoCoverage to RunPester Step + * Creating Example workflow that publishes PSDevOps. --- +## 0.5.4.2: * Adding Register-ADOArtifactFeed (Fixes #118) - -0.5.4.1: --- +## 0.5.4.1: * Fixing Invoke-ADORestApi issues: #111,#114,#115 * Attaching .BuildID and .DefinitionID properties to Get-ADOBuild where appropriate. - -0.5.4: --- +## 0.5.4: * Formatting Improvments: -** Get-ADOField now includes .Type -** Get-ADOExtension now includes .Version + * Get-ADOField now includes .Type + * Get-ADOExtension now includes .Version * Set-ADOTeam -DefaultAreaPath/-AreaPath parameter set issue fixed (fixes #103 / #92) -** Added tests for Set-ADOTeam + * Added tests for Set-ADOTeam * GitHub Workflow Definition Improvements: -** New Triggers: -*** On PullToMain -** New Jobs: -*** UpdateModuleTag -*** PublishToGallery -** New Steps: -*** PublishPowerShellGallery -*** TagModuleVersion + * New Triggers: + * On PullToMain + * New Jobs: + * UpdateModuleTag + * PublishToGallery + * New Steps: + * PublishPowerShellGallery + * TagModuleVersion * New-GitHubWorkflow/New-ADOPipeline now support -RootDirectory * Fixing pluralization / list issue with multiple GitHub Workflow "On" -0.5.3 --- +## 0.5.3 * Get-ADORepository : Adding -PullRequestID * New/Set-ADOWorkItem: Fixing pipelining issue - -0.5.2 --- +## 0.5.2 * Get-ADOTeam: Adding alias -AreaPath for -TeamFieldValue, carrying on team property * Set-ADOTeam: Support for -DefaultAreaPath/-AreaPath (TeamFieldValues api, fixing issue #92) * Get-ADOTest: Enabling pagination and filtering of results. -** Invoke-ADORestAPI: Fixing -Cache(ing) correctly (#88) -** Invoke-GitHubRESTAPI: Only using .ContentEncoding if present in results (PowerShell core fix) + * Invoke-ADORestAPI: Fixing -Cache(ing) correctly (#88) + * Invoke-GitHubRESTAPI: Only using .ContentEncoding if present in results (PowerShell core fix) * Get-ADOWorkItem: -** Fixing -Related (#79) -** Fixing -Comment errors when there are no commments (#80) + * Fixing -Related (#79) + * Fixing -Comment errors when there are no commments (#80) * New/Set-ADOWorkItem: -** Adding -Relationship and -Comment (#81) -** Improving Formatting of Work Items (#82) -** Adding -Tag + * Adding -Relationship and -Comment (#81) + * Improving Formatting of Work Items (#82) + * Adding -Tag * Invoke-ADORestAPI: Fixing issue with -QueryParameter -0.5.1 --- +## 0.5.1 * Bugfixes: -** Get-ADOTest: Fixing parameter sets and adding formatting. -** Invoke-GitHubRESTAPI: Only using .ContentEncoding when present. -0.5 + * Get-ADOTest: Fixing parameter sets and adding formatting. + * Invoke-GitHubRESTAPI: Only using .ContentEncoding when present. --- +## 0.5 * Improved Git Functionality -** New-GitHubAction -** Invoke-GitHubRESTApi -** Connect/Disconnect-GitHub (enabling smart aliases like api.github.com/zen and api.github.com/repos//) -** Formatting for GitHub Issues and Repos + * New-GitHubAction + * Invoke-GitHubRESTApi + * Connect/Disconnect-GitHub (enabling smart aliases like api.github.com/zen and api.github.com/repos//) + * Formatting for GitHub Issues and Repos * Azure DevOps Additions/Fixes -** Invoke-ADORestAPI -AsJob - -** Get-ADOArtifactFeed now has -Metric, -PackageList, -PackageVersionList, -Provenance -** Get-ADOIdentity [new] -** Get-ADOProject now has -Board, -TestVariable, -TestConfiguration -** Get-ADOPermission is now more API-complete and has parameter sets for permission types -** Set-ADOPermission -** Get-ADOExtension can now read extension data -** Set-ADOExtension can now set extension data -** Get-ADOTest [new] -** New-ADOPipeline now has -RootDirectory -** Tons of New Type Definitions and Formatters - -0.4.9 ---- + * Invoke-ADORestAPI -AsJob + * Get-ADOArtifactFeed now has -Metric, -PackageList, -PackageVersionList, -Provenance + * Get-ADOIdentity [new] + * Get-ADOProject now has -Board, -TestVariable, -TestConfiguration + * Get-ADOPermission is now more API-complete and has parameter sets for permission types + * Set-ADOPermission + * Get-ADOExtension can now read extension data + * Set-ADOExtension can now set extension data + * Get-ADOTest [new] + * New-ADOPipeline now has -RootDirectory + * Tons of New Type Definitions and Formatters + --- +## 0.4.9 * New Command: Wait-ADOBuild * Start-ADOBuild -** Supports -Debug (to start a build with extra tracing) -** Allows parameters as PSObject + * Supports -Debug (to start a build with extra tracing) + * Allows parameters as PSObject * Get-ADORepository: Added -IncludeHidden, -IncludeRemoteURL, -IncludeLink * Improvements to Pipelines and Workflows: -** Pester, PSScriptAnalyzer, and ScriptCop now produce output variables -** PSDevOps now includes a file to generate it's own build -** PublishTest/CodeCoverage Results steps will always() run -** Convert-BuildStep will add a .Name to each script step. - -0.4.8 + * Pester, PSScriptAnalyzer, and ScriptCop now produce output variables + * PSDevOps now includes a file to generate it's own build + * PublishTest/CodeCoverage Results steps will always() run + * Convert-BuildStep will add a .Name to each script step. --- + +## 0.4.8 * Improved Tracing -** New Commands: Write-ADOOutput, Trace-ADOCommand/GitHubCommand -** Renaming Command / Adding Parameters: Set-ADOVariable -> Write-ADOVariable. Added -IsOutput & -IsReadOnly. -** Adding Trace-GitHubCommand/ADOCommand -** Improved logging of parameters in Convert-BuildStep + * New Commands: Write-ADOOutput, Trace-ADOCommand/GitHubCommand + * Renaming Command / Adding Parameters: Set-ADOVariable -> Write-ADOVariable. Added -IsOutput & -IsReadOnly. + * Adding Trace-GitHubCommand/ADOCommand + * Improved logging of parameters in Convert-BuildStep * New Functionality in Azure DevOps: -** Get-ADOProject now has -TestRun, -TestPlan, -Release, and -PendingApproval (and better progress bars) -** Get-ADOWorkItemType now has -Field -** Commands for Picklists: Add/Get/Remove/Update-ADOPicklist -0.4.7 ----- + * Get-ADOProject now has -TestRun, -TestPlan, -Release, and -PendingApproval (and better progress bars) + * Get-ADOWorkItemType now has -Field + * Commands for Picklists: Add/Get/Remove/Update-ADOPicklist +--- +## 0.4.7 * New Commands: -** Add/Get/Remove-ADOWiki -** Get-ADOPermission + * Add/Get/Remove-ADOWiki + * Get-ADOPermission * Bugfixes: -** Honoring Get-ADOBuild -DefinitionName + * Honoring Get-ADOBuild -DefinitionName * Disconnect-ADO is now run prior at the start of Connect-ADO, and on module unload. -0.4.6 ---- +---- +## 0.4.6 * New-ADOPipeline/New-GitHubWorkflow: Adding -BuildScript * Connect-ADO: Auto-detecting connected user's teams and adding tab completion for -Project/-ProjectID/-Team/-TeamID * Convert-BuildStep: Re-ordering YAML for GitHub Workflows (putting .runs last) @@ -150,192 +160,187 @@ * Get-ADOBuild: Adding -DefinitionName * Invoke-ADORestAPI: Passing content length of 0 when body is empty. * Updating README -0.4.5 --- +## 0.4.5 * New Commands: -** Connect/Disconnect-ADO: Caching connection info and saving default parameters! -** New-ADOBuild : Create build definitions! -** Remove-ADOAgentPool : Cleaning up pools, queues, and agents. + * Connect/Disconnect-ADO: Caching connection info and saving default parameters! + * New-ADOBuild : Create build definitions! + * Remove-ADOAgentPool : Cleaning up pools, queues, and agents. * Core Improvements -** Invoke-ADORestApi -*** Now supports -ContinuationToken (and auto-continues unless passed a $first or $top query parameter) -*** Caches access tokens. -*** BREAKING: Invoke-ADORestApi No longer has -Proxy* parameters. + * Invoke-ADORestApi + * Now supports -ContinuationToken (and auto-continues unless passed a $first or $top query parameter) + * Caches access tokens. + * BREAKING: Invoke-ADORestApi No longer has -Proxy* parameters. * Updated Commands: -** Get-ADOUser/Get-ADOTeam : Additional Graph scenarios added. -** New/Set-ADOWorkItem : Added -BypassRule, -ValidateOnly, -SkipNotification -0.4.4 + * Get-ADOUser/Get-ADOTeam : Additional Graph scenarios added. + * New/Set-ADOWorkItem : Added -BypassRule, -ValidateOnly, -SkipNotification --- +## 0.4.4 * Get-ADOTask: Adding -YAMLSchema. * Get-ADOTeam: Adding -Setting/-FieldValue/-Iteration/-Board. * Get-ADOAreaPath/ADOIterationPath: Making parameter names match cmdlet. Honoring -AreaPath/-IterationPath. * Get-ADOProject: Adding -ProcessConfiguration, -Plan, -PlanID, and -DeliveryTimeline. * New Command: Set-ADOTeam -0.4.3 --- -*Renaming commands: -** New-ADODashboard -> Add-ADODashboard -** New-ADOTeam -> Add-ADOTeam +## 0.4.3 +* Renaming commands: + * New-ADODashboard -> Add-ADODashboard + * New-ADOTeam -> Add-ADOTeam * Add-ADOTeam can now add members to a team * Get-ADOTeam can now get an -Identity * New Command: Get-ADOUser * Get-ADOAgentPool: Fixed pipelining bug, added -AgentName/-IncludeCapability/-IncludeLastCompletedRequest/-IncludeAssignedRequest. * Set-ADOProject: Can now -EnableFeature and -DisableFeature -0.4.2 --- +## 0.4.2 * Build Step Improvements: -** New-ADOPipeline now has -PowerShellCore and -WindowsPowerShell -** Import-BuildStep now has parameter sets -** New-ADOPipeline/New-GitHubWorkflow now refer to a metadata collection based off of their noun. -** BuildStep directories can be aliased: -*** ADOPipeline directories can be: ADOPipeline, ADO, AzDo, and AzureDevOps. -*** GitHubWorkflow directories can be: GitHubWorkflow, GitHubWorkflows, and GitHub. + * New-ADOPipeline now has -PowerShellCore and -WindowsPowerShell + * Import-BuildStep now has parameter sets + * New-ADOPipeline/New-GitHubWorkflow now refer to a metadata collection based off of their noun. + * BuildStep directories can be aliased: + * ADOPipeline directories can be: ADOPipeline, ADO, AzDo, and AzureDevOps. + * GitHubWorkflow directories can be: GitHubWorkflow, GitHubWorkflows, and GitHub. * New Dashboard Commands: Clear/Update-ADODashboard * New Extension Commands: Enable/Disbale-ADOExtension * Improved formatting/types for Extensions. * Breaking change: Install/Uninstall-ADOExtension now accept -PublisherID and -ExtensionID, not -PublisherName and -ExtensionName. -0.4.1 --- +## 0.4.1 * More GitHub Functionality: -** Write-GitHubDebug -** Write-GitHubOutput -** Hide-GitHubOutput -** New-GitHubWorkflow allows for more complex event mapping. + * Write-GitHubDebug + * Write-GitHubOutput + * Hide-GitHubOutput +* New-GitHubWorkflow allows for more complex event mapping. * Azure DevOps Pipeline Changes -** Convert-BuildStep once again converts using ${{parameters}} syntax + * Convert-BuildStep once again converts using ${{parameters}} syntax * New/Improved Azure DevOps Cmdlets -** Get/New/Remove-ADODashboard -** Get-ADOAgentPool now supports -PoolID -** Set-ADOProject -** Repositories returned from a build definition are now decorated as PSDevOps.Repository + * Get/New/Remove-ADODashboard + * Get-ADOAgentPool now supports -PoolID + * Set-ADOProject + * Repositories returned from a build definition are now decorated as PSDevOps.Repository * Improved testing and static analysis compliance -0.4 --- +## 0.4 * Overhaul of GitHub Workflow functionality. -** New-GitHubAction renamed to New-GitHubWorkflow -** /GitHubActions renamed to /GitHub -** Added -EventParameter to allow for parameters from events such as workflow_dispatch -** Added Write-GitHubError/GitHubWarning (updating Write-ADOError/Write-ADOWarning for consistency) -** Cleaning up GitHub Workflow parts + * New-GitHubAction renamed to New-GitHubWorkflow + * /GitHubActions renamed to /GitHub + * Added -EventParameter to allow for parameters from events such as workflow_dispatch + * Added Write-GitHubError/GitHubWarning (updating Write-ADOError/Write-ADOWarning for consistency) + * Cleaning up GitHub Workflow parts * Get-ADOTask no longer has -ApiVersion parameter -0.3.9 --- +## 0.3.9 * New/Get/Remove-ADOWorkItemType: Create/get/remove work custom work item types, states, rules, and behaviors. * Added Get-ADOBuild -IncludeAllProperty/-IncludeLatestBuild. * ScriptCop Integration: PowerShelllStaticAnalysis stage now runs ScriptCop as well. * Improved ScriptAnalyzer Integration: Rule name is now outputted. -0.3.8 --- +## 0.3.8 * Add/Remove-ADOAreaPath * Formatter for AreaPaths - -0.3.7 --- +## 0.3.7 * Convert-ADOPipeline now has -Passthru and -Wherefore * Get-ADOWorkProcess now has -Behavior and -WorkItemType * Get-ADOWorkItem now has -Mine, -CurrentIteration, -Comment, -Update, -Revision. - -0.3.6.1 --- +## 0.3.6.1 * Convert-ADOPipeline now binds to .Variables property * Fixing bug in PSDevOps.WorkItem types file, which displayed in formatting. -0.3.6 --- +## 0.3.6 * Added: Get-ADOTask, Convert-ADOPipeline -0.3.5 --- +## 0.3.5 * New Command: Get-ADOTeam * Get-ADOBuild -CodeCoverage * Progress bars on Get-ADORepository * Slight refactoring to make progress bars easier in any function - -0.3.4.1 --- +## 0.3.4.1 * Removing supplied parameters in commands generated by Import-ADOProxy. -0.3.4 --- +## 0.3.4 * New capability: Import-ADOProxy (Import a proxy module with for your ADO / TFS instance) * New REST Commands: Get-ADOAreaPath, Get-ADOIterationPath, Get-ADOExtension * More Features: Get-ADORepository -FileList * Massive Internal Refactoring (switching to dynamic parameters for -PersonalAccessToken etc, standardizing pstypenames) -0.3.3 --- +## 0.3.3 * Now Caching Personal Access Tokens! * URLEncoding all segments in Parts/ReplaceRouteParameter. * Ensuring all Azure DevOps YAML Parameters are wrapped in a string. -0.3.2 --- +## 0.3.2 * Pester workarounds - Steps/InstallPester and Steps/RunPester now accept a PesterMaxVersion (defaulting to 4.99.99) * Convert-BuildStep handles blank parameter defaults correctly * Get-ADOBuild can get yaml definitions directly, e.g Get-ADOBuild -DefinitionID 123 -DefinitionYaml -0.3.1 --- +## 0.3.1 * Bugfixes and Improvements to Convert/Import/Expand-BuildStep: 1. Enforcing pluralization of certain fields within Azure DevOps 2. Handling [string[]], [int[]], [float[]], or [ScriptBlock] parameters * Allowing lists of primitives to not be indented in YAML. -0.3.0 ---- +## 0.3.0 * Added Convert/Import/Expand-BuildStep * Allowing build steps to be defined in functions * Automagically importing build step parameters -0.2.9 --- +## 0.2.9 * Get/New/Remove-ADORepository * Get/New/Remove-ADOServiceEndpoint * Get-ADOAgentPool -** Improvements to New-ADOPipeline to avoid unexpected singletons -0.2.8 + * Improvements to New-ADOPipeline to avoid unexpected singletons --- +## 0.2.8 * Get/New/Update-ADOBuild * Improving New-ADOPipeline: -** Unknown -InputObject properties will no longer be pluralized -** Added 'Pool' to list of known singletons -0.2.7 + * Unknown -InputObject properties will no longer be pluralized + * Added 'Pool' to list of known singletons --- +## 0.2.7 * New Cmdlet: Set-ADOArtifactFeed * Improvements to New/Get/Remove-ADOArtifactFeed (better pipelining, renaming -FullyQualifiedID to -FeedID) -0.2.6 --- +## 0.2.6 * New Cmdlets: -** New/Get/Remove-ADOArtifactFeed -** New/Remove-ADOProject -** New-GitHubAction -0.2.5 + * New/Get/Remove-ADOArtifactFeed + * New/Remove-ADOProject + * New-GitHubAction --- +## 0.2.5 * Improving Get-ADOWorkItem: -** -Title allows getting work items by title -** -NoDetail allows for queries to only return IDs -** Passing -Field will skip formatting -** WorkItemsBatch will be used for query results. -** Passing an old -ApiVersion will not use workItemsBatch -** Formatting improved + * -Title allows getting work items by title + * -NoDetail allows for queries to only return IDs + * Passing -Field will skip formatting + * WorkItemsBatch will be used for query results. + * Passing an old -ApiVersion will not use workItemsBatch + * Formatting improved * Adding Get-ADOWorkProcess * Fixing issues with -ADOField commands when not provided a -Project -0.2.4 ---- +## 0.2.4 * Adding Adding -CanSortBy, -IsQueryable, and -ReadOnly to New-ADOField. * Adding parameter help to New-ADOField -0.2.3 --- +## 0.2.3 * Adding New/Remove-ADOField * Adding help to Get-ADOField * Adding formatting for fields -0.2.2 --- +## 0.2.2 * Adding New/Set/Remove-ADOWorkItem * Adding Get-ADOField * New Parameter: Get-ADOWorkItem -WorkItemType * New Parameter: New-ADOPipeline -Option * Initial formatting * Switching Parts to use latest VMImage - -0.2.1 : -* Added Get-ADOWorkItem --- -0.2 : +## 0.2.1 +* Added Get-ADOWorkItem --- +## 0.2 * Added Invoke-ADORestAPI -0.1 : --- +## 0.1 Initial Commit +--- \ No newline at end of file diff --git a/Add-ADOAreaPath.ps1 b/Functions/AzureDevOps/Add-ADOAreaPath.ps1 similarity index 100% rename from Add-ADOAreaPath.ps1 rename to Functions/AzureDevOps/Add-ADOAreaPath.ps1 diff --git a/Add-ADOAttachment.ps1 b/Functions/AzureDevOps/Add-ADOAttachment.ps1 similarity index 100% rename from Add-ADOAttachment.ps1 rename to Functions/AzureDevOps/Add-ADOAttachment.ps1 diff --git a/Add-ADODashboard.ps1 b/Functions/AzureDevOps/Add-ADODashboard.ps1 similarity index 100% rename from Add-ADODashboard.ps1 rename to Functions/AzureDevOps/Add-ADODashboard.ps1 diff --git a/Add-ADOIterationPath.ps1 b/Functions/AzureDevOps/Add-ADOIterationPath.ps1 similarity index 100% rename from Add-ADOIterationPath.ps1 rename to Functions/AzureDevOps/Add-ADOIterationPath.ps1 diff --git a/Add-ADOPicklist.ps1 b/Functions/AzureDevOps/Add-ADOPicklist.ps1 similarity index 100% rename from Add-ADOPicklist.ps1 rename to Functions/AzureDevOps/Add-ADOPicklist.ps1 diff --git a/Add-ADOTeam.ps1 b/Functions/AzureDevOps/Add-ADOTeam.ps1 similarity index 100% rename from Add-ADOTeam.ps1 rename to Functions/AzureDevOps/Add-ADOTeam.ps1 diff --git a/Add-ADOWiki.ps1 b/Functions/AzureDevOps/Add-ADOWiki.ps1 similarity index 100% rename from Add-ADOWiki.ps1 rename to Functions/AzureDevOps/Add-ADOWiki.ps1 diff --git a/Clear-ADODashboard.ps1 b/Functions/AzureDevOps/Clear-ADODashboard.ps1 similarity index 100% rename from Clear-ADODashboard.ps1 rename to Functions/AzureDevOps/Clear-ADODashboard.ps1 diff --git a/Connect-ADO.ps1 b/Functions/AzureDevOps/Connect-ADO.ps1 similarity index 100% rename from Connect-ADO.ps1 rename to Functions/AzureDevOps/Connect-ADO.ps1 diff --git a/Convert-ADOPipeline.ps1 b/Functions/AzureDevOps/Convert-ADOPipeline.ps1 similarity index 100% rename from Convert-ADOPipeline.ps1 rename to Functions/AzureDevOps/Convert-ADOPipeline.ps1 diff --git a/Disable-ADOExtension.ps1 b/Functions/AzureDevOps/Disable-ADOExtension.ps1 similarity index 100% rename from Disable-ADOExtension.ps1 rename to Functions/AzureDevOps/Disable-ADOExtension.ps1 diff --git a/Disconnect-ADO.ps1 b/Functions/AzureDevOps/Disconnect-ADO.ps1 similarity index 100% rename from Disconnect-ADO.ps1 rename to Functions/AzureDevOps/Disconnect-ADO.ps1 diff --git a/Enable-ADOExtension.ps1 b/Functions/AzureDevOps/Enable-ADOExtension.ps1 similarity index 100% rename from Enable-ADOExtension.ps1 rename to Functions/AzureDevOps/Enable-ADOExtension.ps1 diff --git a/Get-ADOAgentPool.ps1 b/Functions/AzureDevOps/Get-ADOAgentPool.ps1 similarity index 100% rename from Get-ADOAgentPool.ps1 rename to Functions/AzureDevOps/Get-ADOAgentPool.ps1 diff --git a/Get-ADOAreaPath.ps1 b/Functions/AzureDevOps/Get-ADOAreaPath.ps1 similarity index 100% rename from Get-ADOAreaPath.ps1 rename to Functions/AzureDevOps/Get-ADOAreaPath.ps1 diff --git a/Get-ADOArtifactFeed.ps1 b/Functions/AzureDevOps/Get-ADOArtifactFeed.ps1 similarity index 100% rename from Get-ADOArtifactFeed.ps1 rename to Functions/AzureDevOps/Get-ADOArtifactFeed.ps1 diff --git a/Get-ADOBuild.ps1 b/Functions/AzureDevOps/Get-ADOBuild.ps1 similarity index 96% rename from Get-ADOBuild.ps1 rename to Functions/AzureDevOps/Get-ADOBuild.ps1 index acc54390..4cb29eec 100644 --- a/Get-ADOBuild.ps1 +++ b/Functions/AzureDevOps/Get-ADOBuild.ps1 @@ -355,10 +355,21 @@ "$Organization.$project.Repository", "$Organization.Repository", "PSDevOps.Repository" } + if (-not ($Project -as [guid])) { + $ProjectName = $Project + $projectID = Get-ADOProject -Organization $Organization -Project $Project -Cache | + Select-Object -ExpandProperty ProjectID + } else { + $ProjectName = Get-ADOProject -Organization $Organization -Project $Project -Cache | + Select-Object -ExpandProperty ProjectName + $ProjectId = $Project + } $invokeParams.Property = @{ Organization = $Organization - Project = $Project - Server = $Server + Project = $Project + ProjectID = $projectID + ProjectName = $ProjectName + Server = $Server } if ($BuildID) { diff --git a/Get-ADODashboard.ps1 b/Functions/AzureDevOps/Get-ADODashboard.ps1 similarity index 100% rename from Get-ADODashboard.ps1 rename to Functions/AzureDevOps/Get-ADODashboard.ps1 diff --git a/Get-ADOExtension.ps1 b/Functions/AzureDevOps/Get-ADOExtension.ps1 similarity index 100% rename from Get-ADOExtension.ps1 rename to Functions/AzureDevOps/Get-ADOExtension.ps1 diff --git a/Get-ADOField.ps1 b/Functions/AzureDevOps/Get-ADOField.ps1 similarity index 100% rename from Get-ADOField.ps1 rename to Functions/AzureDevOps/Get-ADOField.ps1 diff --git a/Get-ADOIdentity.ps1 b/Functions/AzureDevOps/Get-ADOIdentity.ps1 similarity index 100% rename from Get-ADOIdentity.ps1 rename to Functions/AzureDevOps/Get-ADOIdentity.ps1 diff --git a/Get-ADOIterationPath.ps1 b/Functions/AzureDevOps/Get-ADOIterationPath.ps1 similarity index 100% rename from Get-ADOIterationPath.ps1 rename to Functions/AzureDevOps/Get-ADOIterationPath.ps1 diff --git a/Get-ADOPermission.ps1 b/Functions/AzureDevOps/Get-ADOPermission.ps1 similarity index 99% rename from Get-ADOPermission.ps1 rename to Functions/AzureDevOps/Get-ADOPermission.ps1 index 55816a56..6b02b29b 100644 --- a/Get-ADOPermission.ps1 +++ b/Functions/AzureDevOps/Get-ADOPermission.ps1 @@ -297,7 +297,7 @@ } + $PSBoundParameters) $q.Enqueue(@{ NamespaceID = '2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87' # Repositories - SecurityToken = "reposV2/$projectId" + SecurityToken = "repoV2/$projectId" Recurse = $true } + $PSBoundParameters) $q.Enqueue(@{ @@ -377,8 +377,7 @@ $q.Enqueue(@{ NamespaceID = '2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87' - SecurityToken = "repo$( -if ($psCmdlet.ParameterSetName -eq 'AllRepositories') {'s'})V2$( + SecurityToken = "repoV2$( if ($ProjectID) { '/' + $projectId} )$( if ($repositoryID) {'/' + $repositoryID} diff --git a/Get-ADOPicklist.ps1 b/Functions/AzureDevOps/Get-ADOPicklist.ps1 similarity index 100% rename from Get-ADOPicklist.ps1 rename to Functions/AzureDevOps/Get-ADOPicklist.ps1 diff --git a/Get-ADOProject.ps1 b/Functions/AzureDevOps/Get-ADOProject.ps1 similarity index 100% rename from Get-ADOProject.ps1 rename to Functions/AzureDevOps/Get-ADOProject.ps1 diff --git a/Get-ADORepository.ps1 b/Functions/AzureDevOps/Get-ADORepository.ps1 similarity index 100% rename from Get-ADORepository.ps1 rename to Functions/AzureDevOps/Get-ADORepository.ps1 diff --git a/Get-ADOServiceEndpoint.ps1 b/Functions/AzureDevOps/Get-ADOServiceEndpoint.ps1 similarity index 100% rename from Get-ADOServiceEndpoint.ps1 rename to Functions/AzureDevOps/Get-ADOServiceEndpoint.ps1 diff --git a/Get-ADOServiceHook.ps1 b/Functions/AzureDevOps/Get-ADOServiceHook.ps1 similarity index 100% rename from Get-ADOServiceHook.ps1 rename to Functions/AzureDevOps/Get-ADOServiceHook.ps1 diff --git a/Get-ADOTask.ps1 b/Functions/AzureDevOps/Get-ADOTask.ps1 similarity index 100% rename from Get-ADOTask.ps1 rename to Functions/AzureDevOps/Get-ADOTask.ps1 diff --git a/Get-ADOTeam.ps1 b/Functions/AzureDevOps/Get-ADOTeam.ps1 similarity index 100% rename from Get-ADOTeam.ps1 rename to Functions/AzureDevOps/Get-ADOTeam.ps1 diff --git a/Get-ADOTest.ps1 b/Functions/AzureDevOps/Get-ADOTest.ps1 similarity index 100% rename from Get-ADOTest.ps1 rename to Functions/AzureDevOps/Get-ADOTest.ps1 diff --git a/Get-ADOUser.ps1 b/Functions/AzureDevOps/Get-ADOUser.ps1 similarity index 100% rename from Get-ADOUser.ps1 rename to Functions/AzureDevOps/Get-ADOUser.ps1 diff --git a/Get-ADOWiki.ps1 b/Functions/AzureDevOps/Get-ADOWiki.ps1 similarity index 100% rename from Get-ADOWiki.ps1 rename to Functions/AzureDevOps/Get-ADOWiki.ps1 diff --git a/Get-ADOWorkItem.ps1 b/Functions/AzureDevOps/Get-ADOWorkItem.ps1 similarity index 100% rename from Get-ADOWorkItem.ps1 rename to Functions/AzureDevOps/Get-ADOWorkItem.ps1 diff --git a/Get-ADOWorkItemType.ps1 b/Functions/AzureDevOps/Get-ADOWorkItemType.ps1 similarity index 100% rename from Get-ADOWorkItemType.ps1 rename to Functions/AzureDevOps/Get-ADOWorkItemType.ps1 diff --git a/Get-ADOWorkProcess.ps1 b/Functions/AzureDevOps/Get-ADOWorkProcess.ps1 similarity index 100% rename from Get-ADOWorkProcess.ps1 rename to Functions/AzureDevOps/Get-ADOWorkProcess.ps1 diff --git a/Import-ADOProxy.ps1 b/Functions/AzureDevOps/Import-ADOProxy.ps1 similarity index 100% rename from Import-ADOProxy.ps1 rename to Functions/AzureDevOps/Import-ADOProxy.ps1 diff --git a/Install-ADOExtension.ps1 b/Functions/AzureDevOps/Install-ADOExtension.ps1 similarity index 100% rename from Install-ADOExtension.ps1 rename to Functions/AzureDevOps/Install-ADOExtension.ps1 diff --git a/Invoke-ADORestAPI.ps1 b/Functions/AzureDevOps/Invoke-ADORestAPI.ps1 similarity index 100% rename from Invoke-ADORestAPI.ps1 rename to Functions/AzureDevOps/Invoke-ADORestAPI.ps1 diff --git a/New-ADOArtifactFeed.ps1 b/Functions/AzureDevOps/New-ADOArtifactFeed.ps1 similarity index 100% rename from New-ADOArtifactFeed.ps1 rename to Functions/AzureDevOps/New-ADOArtifactFeed.ps1 diff --git a/New-ADOBuild.ps1 b/Functions/AzureDevOps/New-ADOBuild.ps1 similarity index 100% rename from New-ADOBuild.ps1 rename to Functions/AzureDevOps/New-ADOBuild.ps1 diff --git a/New-ADOField.ps1 b/Functions/AzureDevOps/New-ADOField.ps1 similarity index 100% rename from New-ADOField.ps1 rename to Functions/AzureDevOps/New-ADOField.ps1 diff --git a/New-ADOPipeline.ps1 b/Functions/AzureDevOps/New-ADOPipeline.ps1 similarity index 100% rename from New-ADOPipeline.ps1 rename to Functions/AzureDevOps/New-ADOPipeline.ps1 diff --git a/New-ADOProject.ps1 b/Functions/AzureDevOps/New-ADOProject.ps1 similarity index 100% rename from New-ADOProject.ps1 rename to Functions/AzureDevOps/New-ADOProject.ps1 diff --git a/New-ADORepository.ps1 b/Functions/AzureDevOps/New-ADORepository.ps1 similarity index 100% rename from New-ADORepository.ps1 rename to Functions/AzureDevOps/New-ADORepository.ps1 diff --git a/New-ADOServiceEndpoint.ps1 b/Functions/AzureDevOps/New-ADOServiceEndpoint.ps1 similarity index 100% rename from New-ADOServiceEndpoint.ps1 rename to Functions/AzureDevOps/New-ADOServiceEndpoint.ps1 diff --git a/New-ADOWorkItem.ps1 b/Functions/AzureDevOps/New-ADOWorkItem.ps1 similarity index 100% rename from New-ADOWorkItem.ps1 rename to Functions/AzureDevOps/New-ADOWorkItem.ps1 diff --git a/New-ADOWorkItemType.ps1 b/Functions/AzureDevOps/New-ADOWorkItemType.ps1 similarity index 100% rename from New-ADOWorkItemType.ps1 rename to Functions/AzureDevOps/New-ADOWorkItemType.ps1 diff --git a/New-ADOWorkProcess.ps1 b/Functions/AzureDevOps/New-ADOWorkProcess.ps1 similarity index 100% rename from New-ADOWorkProcess.ps1 rename to Functions/AzureDevOps/New-ADOWorkProcess.ps1 diff --git a/Register-ADOArtifactFeed.ps1 b/Functions/AzureDevOps/Register-ADOArtifactFeed.ps1 similarity index 100% rename from Register-ADOArtifactFeed.ps1 rename to Functions/AzureDevOps/Register-ADOArtifactFeed.ps1 diff --git a/Remove-ADOAgentPool.ps1 b/Functions/AzureDevOps/Remove-ADOAgentPool.ps1 similarity index 100% rename from Remove-ADOAgentPool.ps1 rename to Functions/AzureDevOps/Remove-ADOAgentPool.ps1 diff --git a/Remove-ADOAreaPath.ps1 b/Functions/AzureDevOps/Remove-ADOAreaPath.ps1 similarity index 100% rename from Remove-ADOAreaPath.ps1 rename to Functions/AzureDevOps/Remove-ADOAreaPath.ps1 diff --git a/Remove-ADOArtifactFeed.ps1 b/Functions/AzureDevOps/Remove-ADOArtifactFeed.ps1 similarity index 100% rename from Remove-ADOArtifactFeed.ps1 rename to Functions/AzureDevOps/Remove-ADOArtifactFeed.ps1 diff --git a/Remove-ADOBuild.ps1 b/Functions/AzureDevOps/Remove-ADOBuild.ps1 similarity index 100% rename from Remove-ADOBuild.ps1 rename to Functions/AzureDevOps/Remove-ADOBuild.ps1 diff --git a/Remove-ADODashboard.ps1 b/Functions/AzureDevOps/Remove-ADODashboard.ps1 similarity index 100% rename from Remove-ADODashboard.ps1 rename to Functions/AzureDevOps/Remove-ADODashboard.ps1 diff --git a/Remove-ADOField.ps1 b/Functions/AzureDevOps/Remove-ADOField.ps1 similarity index 100% rename from Remove-ADOField.ps1 rename to Functions/AzureDevOps/Remove-ADOField.ps1 diff --git a/Remove-ADOIterationPath.ps1 b/Functions/AzureDevOps/Remove-ADOIterationPath.ps1 similarity index 100% rename from Remove-ADOIterationPath.ps1 rename to Functions/AzureDevOps/Remove-ADOIterationPath.ps1 diff --git a/Functions/AzureDevOps/Remove-ADOPermission.ps1 b/Functions/AzureDevOps/Remove-ADOPermission.ps1 new file mode 100644 index 00000000..67b20b99 --- /dev/null +++ b/Functions/AzureDevOps/Remove-ADOPermission.ps1 @@ -0,0 +1,436 @@ +function Remove-ADOPermission +{ + <# + .Synopsis + Removes Azure DevOps Permissions + .Description + Removes Azure DevOps security permissions. + .Example + Remove-ADOPermission -Organization MyOrganization -Project MyProject -PersonalAccessToken $pat + .Link + https://docs.microsoft.com/en-us/rest/api/azure/devops/security/access%20control%20entries/set%20access%20control%20entries + .Link + https://docs.microsoft.com/en-us/azure/devops/organizations/security/namespace-reference + #> + [CmdletBinding(SupportsShouldProcess,ConfirmImpact='High')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute("Test-ForParameterSetAmbiguity", "", Justification="Ambiguity Desired.")] + [OutputType('PSDevOps.SecurityNamespace', 'PSDevOps.AccessControlList')] + param( + # The Organization. + [Parameter(Mandatory,ValueFromPipelineByPropertyName)] + [Alias('Org')] + [string] + $Organization, + + # The Project ID. + # If this is provided without anything else, will get permissions for the projectID + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='Project')] + [Parameter(ValueFromPipelineByPropertyName,ParameterSetName='Analytics')] + [Parameter(ValueFromPipelineByPropertyName,ParameterSetName='EndpointID')] + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='AreaPath')] + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='Dashboard')] + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='IterationPath')] + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='Tagging')] + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='ManageTFVC')] + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='BuildDefinition')] + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='BuildPermission')] + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='RepositoryID')] + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='ProjectRepository')] + [Alias('Project')] + [string] + $ProjectID, + + # If provided, will set permissions related to a given teamID. ( see Get-ADOTeam) + [Parameter(ValueFromPipelineByPropertyName,ParameterSetName='Dashboard')] + [string] + $TeamID, + + # If provided, will set permissions related to an Area Path. ( see Get-ADOAreaPath ) + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='AreaPath')] + [string] + $AreaPath, + + # If provided, will set permissions related to an Iteration Path. ( see Get-ADOIterationPath ) + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='IterationPath')] + [string] + $IterationPath, + + # The Build Definition ID + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='BuildDefinition')] + [string] + $DefinitionID, + + # The path to the build. + [Parameter(ValueFromPipelineByPropertyName,ParameterSetName='BuildDefinition')] + [string] + $BuildPath ='/', + + # If set, will set build and release permissions for a given project. + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='BuildPermission')] + [switch] + $BuildPermission, + + # If set, will set permissions for repositories within a project + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='ProjectRepository')] + [Alias('ProjectRepositories')] + [switch] + $ProjectRepository, + + # If provided, will set permissions for a given repositoryID + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='RepositoryID')] + [string] + $RepositoryID, + + # If provided, will set permissions for a given branch within a repository + [Parameter(ValueFromPipelineByPropertyName,ParameterSetName='RepositoryID')] + [Parameter(ValueFromPipelineByPropertyName,ParameterSetName='AllRepositories')] + [string] + $BranchName, + + # If set, will set permissions for all repositories within a project + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='AllRepositories')] + [Alias('AllRepositories')] + [switch] + $AllRepository, + + # If set, will set permissions for tagging related to the current project. + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='Tagging')] + [switch] + $Tagging, + + + # If set, will set permissions for Team Foundation Version Control related to the current project. + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='ManageTFVC')] + [switch] + $ManageTFVC, + + # If set, will set permissions for Delivery Plans. + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='Plan')] + [switch] + $Plan, + + # If set, will set dashboard permissions related to the current project. + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='Dashboard')] + [Alias('Dashboards')] + [switch] + $Dashboard, + + # If set, will set endpoint permissions related to a particular endpoint. + [Parameter(Mandatory,ValueFromPipelineByPropertyName,ParameterSetName='EndpointID')] + [string] + $EndpointID, + + # The Security Namespace ID. + [Parameter(Mandatory,ValueFromPipelineByPropertyName, + ParameterSetName='accesscontrolentries/{NamespaceId}')] + [string] + $NamespaceID, + + # The Security Token. + [Parameter(Mandatory,ValueFromPipelineByPropertyName, + ParameterSetName='accesscontrolentries/{NamespaceId}')] + [string] + $SecurityToken, + + # One or more descriptors + [Parameter(ValueFromPipelineByPropertyName, + ParameterSetName='accesscontrolentries/{NamespaceId}')] + [string[]] + $Descriptor, + + # One or more identities. Identities will be converted into descriptors. + [Parameter(ValueFromPipelineByPropertyName)] + [string[]] + $Identity, + + # One or more allow permissions. + [Parameter(ValueFromPipelineByPropertyName)] + [string[]] + $Permission, + + # The server. By default https://dev.azure.com/. + # To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + [Parameter(ValueFromPipelineByPropertyName)] + [uri] + $Server = "https://dev.azure.com/", + + # The api version. By default, 5.1-preview. + # If targeting TFS, this will need to change to match your server version. + # See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + [string] + $ApiVersion = "5.1-preview") + dynamicParam { . $GetInvokeParameters -DynamicParameter } + begin { + #region Copy Invoke-ADORestAPI parameters + $invokeParams = . $getInvokeParameters $PSBoundParameters + #endregion Copy Invoke-ADORestAPI parameters + $q = [Collections.Queue]::new() + + $cachedNamespaces = @{} + $originalInvokeParams = @{} + $invokeParams + + $resolveIdentity = { + param( + [Parameter(Mandatory,Position=0,ValueFromPipelineByPropertyName)] + [string]$Identity) + + begin { + if (-not $script:CachedIdentities) { $script:CachedIdentities = @{}} + } + + process { + if (-not $script:CachedIdentities[$Identity]) { + $searchUri = + "https://vssps.dev.azure.com/$Organization/_apis/identities?api-version=6.0&searchfilter=General&filterValue=$Identity" + $script:CachedIdentities[$Identity] = Invoke-ADORestAPI -Uri $searchUri + } + $script:CachedIdentities[$Identity] + } + } + } + + process { + $ParameterSet = $psCmdlet.ParameterSetName + if ($psCmdlet.ParameterSetName -notin 'securitynamespaces', 'accesscontrolentries/{NamespaceId}') { + if ($ProjectID -and -not ($ProjectID -as [guid])) { + $oldProgressPref = $ProgressPreference; $ProgressPreference = 'silentlycontinue' + $projectID = Get-ADOProject -Organization $Organization -Project $projectID | Select-Object -ExpandProperty ProjectID + $ProgressPreference = $oldProgressPref + if (-not $ProjectID) { return } + } + $psBoundParameters['ParameterSet']='accesscontrolentries/{NamespaceId}' + switch -Regex ($psCmdlet.ParameterSetName) { + Project { + $null = $PSBoundParameters.Remove('ProjectID') + $q.Enqueue(@{ + NamespaceID = '52d39943-cb85-4d7f-8fa8-c6baac873819' + SecurityToken = "`$PROJECT:vstfs:///Classification/TeamProject/$ProjectID" + } + $PSBoundParameters) + } + Analytics { + $null = $PSBoundParameters.Remove('ProjectID') + $q.Enqueue(@{ + NamespaceID = if ($ProjectID) { '58450c49-b02d-465a-ab12-59ae512d6531' } else { 'd34d3680-dfe5-4cc6-a949-7d9c68f73cba'} + SecurityToken = "`$/$(if ($ProjectID) { $ProjectID } else { 'Shared' })" + } + $PSBoundParameters) + } + 'AreaPath|IterationPath' { + $gotPath = + if ($psCmdlet.ParameterSetName -eq 'AreaPath') { + Get-ADOAreaPath -Organization $Organization -Project $ProjectID -AreaPath $AreaPath + } else { + Get-ADOIterationPath -Organization $Organization -Project $ProjectID -IterationPath $iterationPath + } + + if (-not $gotPath) { + continue + } + $PathIdList = @( + $gotPath.Identifier + $parentUri = $gotPath._links.parent.href + while ($parentUri) { + $parentPath = Invoke-ADORestAPI -Uri $parentUri + $parentPath.identifier + $parentUri = $parentPath._links.parent.href + } + ) + + [Array]::Reverse($PathIdList) + + $null = $PSBoundParameters.Remove('ProjectID') + + $q.Enqueue(@{ + NamespaceID = + if ($psCmdlet.ParameterSetName -eq 'AreaPath') { + '83e28ad4-2d72-4ceb-97b0-c7726d5502c3' + } else { + 'bf7bfa03-b2b7-47db-8113-fa2e002cc5b1' + } + SecurityToken = @(foreach($PathId in $PathIdList) { + "vstfs:///Classification/Node/$PathId" + }) -join ':' + } + $PSBoundParameters) + } + Dashboard { + $null = $PSBoundParameters.Remove('ProjectID') + $q.Enqueue(@{ + NamespaceID = '8adf73b7-389a-4276-b638-fe1653f7efc7' + SecurityToken = "$/$(if ($ProjectID) { $ProjectID })/$(if ($teamID) { $teamid } else { [guid]::Empty } )" + } + $PSBoundParameters) + } + Plan { + $q.Enqueue(@{ + NamespaceID = 'bed337f8-e5f3-4fb9-80da-81e17d06e7a8' + SecurityToken = "Plan" + } + $PSBoundParameters) + } + EndpointID { + $q.Enqueue(@{ + NamespaceID = '49b48001-ca20-4adc-8111-5b60c903a50c' + SecurityToken = "endpoints/$( + if ($ProjectID) {"$ProjectID/"} else { "Collection/"} + )$( + if ($EndpointID) {$EndpointID} + )" + } + $PSBoundParameters) + } + Tagging { + $q.Enqueue(@{ + NamespaceID = 'bb50f182-8e5e-40b8-bc21-e8752a1e7ae2' + SecurityToken = "/$ProjectID" + } + $PSBoundParameters) + } + ManageTFVC { + $q.Enqueue(@{ + NamespaceID = 'a39371cf-0841-4c16-bbd3-276e341bc052' + SecurityToken = "/$ProjectID" + } + $PSBoundParameters) + } + 'BuildDefinition|BuildPermission' { + + $q.Enqueue(@{ + NamespaceID = 'a39371cf-0841-4c16-bbd3-276e341bc052' + SecurityToken = "$ProjectID$(($BuildPath -replace '\\','/').TrimEnd('/'))/$DefinitionID" + } + $PSBoundParameters) + $q.Enqueue(@{ + NamespaceID = 'c788c23e-1b46-4162-8f5e-d7585343b5de' + SecurityToken = "$ProjectID$(($BuildPath -replace '\\','/').TrimEnd('/'))/$DefinitionID" + } + $PSBoundParameters) + } + 'RepositoryID|AllRepositories|ProjectRepository' { + $q.Enqueue(@{ + NamespaceID = '2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87' + SecurityToken = "repoV2$( +if ($ProjectID) { '/' + $projectId} +)$( +if ($repositoryID) {'/' + $repositoryID} +)$( +if ($BranchName) { + '/refs/heads/' + ([BitConverter]::ToString([Text.Encoding]::Unicode.GetBytes($BranchName)).Replace('-','').ToLower()) +} +)" + + } + $PSBoundParameters) + } + } + } else { + $q.Enqueue(@{ParameterSet=$ParameterSet} + $PSBoundParameters) + } + } + end { + $c, $t, $progId = 0, $q.Count, [Random]::new().Next() + + while ($q.Count) { + . $DQ $q # Pop one off the queue and declare all of it's variables (see /parts/DQ.ps1). + + $uri = # The URI is comprised of + @( + "$server".TrimEnd('/') # the Server (minus any trailing slashes), + $Organization # the Organization, + '_apis' # the API Root ('_apis'), + (. $ReplaceRouteParameter $ParameterSet) + # and any parameterized URLs in this parameter set. + ) -as [string[]] -ne '' -join '/' + + $uri += '?' # The URI has a query string containing: + $uri += @( + if ($Server -ne 'https://dev.azure.com/' -and + -not $PSBoundParameters.ApiVersion) { + $ApiVersion = '2.0' + } + if ($ApiVersion) { # the api-version + "api-version=$apiVersion" + } + ) -join '&' + + $realAllow = 0 + $realDeny = 0 + if (-not $cachedNamespaces.$namespaceID) { + $cachedNamespaces.$namespaceID = + Get-ADOPermission -Organization $Organization -PersonalAccessToken $psboundParameters["PersonalAccessToken"] -PermissionType | + Where-Object NamespaceID -EQ $NamespaceID | + Select-Object -First 1 + } + + if (-not $cachedNamespaces.$namespaceID) { continue } + + $Descriptors = @($Descriptor) + @( + foreach ($id in $Identity) { + $realId = @(& $resolveIdentity $id) + if (-not $realID) { + Write-Warning "Could not find Identity: '$realId'" + continue + } + if ($realId.Length -gt 1) { + Write-Warning "Ambiguous Identity found: '$id' could be '$($realId -join "','")'" + continue + } + $realId.descriptor + } + ) + + $realPermission = 0 + $friendlyPermission = @(:nextPerm foreach ($perm in $Permission) { + if ($perm -match '^\d+$') { + $realPermission = $realPermission -bor $perm + } else { + foreach ($act in $cachedNamespaces.$namespaceID.actions) { + if ($act.Name -like $perm -or $act.DisplayName -like $perm) { + $Permission = $realPermission -bor $act.bit + $act.Name + continue nextPerm + } + } + Write-Warning "Permission '$perm' not found in '$($cachedNamespaces.$NamespaceID.Name)'. +$($cachedNamespaces.$namespaceID.actions | Format-Table -Property Name, DisplayName | Out-String)" + } + }) + + + $c++ + + + if (-not $Descriptors) { + Write-Error "No -Descriptor or -Identity provided" + return + } + + if (-not $realPermission) { + Write-Error "Must provide valid -Permission" + return + } + + # We want to decorate our return value. Handily enough, both URIs contain a distinct name in the last URL segment. + $typename = @($parameterSet -split '/' -notlike '{*}')[-1] -replace 'ies', 'y' # We just need to drop the 's' + $typeNames = @( + "$organization.$typename" + if ($Project) { "$organization.$Project.$typename" } + "PSDevOps.$typename" + ) + $invokeParams.Method = 'DELETE' + foreach ($desc in $Descriptors) { + Write-Progress "Removing Permissions for $desc" " (Removing: $friendlyPermission on $SecurityToken ) " -Id $progId -PercentComplete ($c * 100/$t) + if ($invokeParams.Uri -notlike "*/$realPermission") { + $invokeParams.Uri += "/*/$realPermission" + } + + $invokeParams.QueryParameter = @{ + token = $SecurityToken + descriptor = $Descriptor + } + + $additionalProperties = @{Organization=$Organization;Server=$Server;SecurityToken=$SecurityToken} + if ($WhatIfPreference) { + $invokeParams + continue + } + + if ($psCmdlet.ShouldProcess("Remove $($cachedNamespaces.$namespaceID.Name) Permissions")) { + Invoke-ADORestAPI -Uri $uri @invokeParams -PSTypeName $typenames -Property $additionalProperties + } + } + } + + Write-Progress "Remove Permissions" " " -Id $progId -Completed + } +} \ No newline at end of file diff --git a/Remove-ADOPicklist.ps1 b/Functions/AzureDevOps/Remove-ADOPicklist.ps1 similarity index 100% rename from Remove-ADOPicklist.ps1 rename to Functions/AzureDevOps/Remove-ADOPicklist.ps1 diff --git a/Remove-ADOProject.ps1 b/Functions/AzureDevOps/Remove-ADOProject.ps1 similarity index 100% rename from Remove-ADOProject.ps1 rename to Functions/AzureDevOps/Remove-ADOProject.ps1 diff --git a/Remove-ADORepository.ps1 b/Functions/AzureDevOps/Remove-ADORepository.ps1 similarity index 100% rename from Remove-ADORepository.ps1 rename to Functions/AzureDevOps/Remove-ADORepository.ps1 diff --git a/Remove-ADOServiceEndpoint.ps1 b/Functions/AzureDevOps/Remove-ADOServiceEndpoint.ps1 similarity index 100% rename from Remove-ADOServiceEndpoint.ps1 rename to Functions/AzureDevOps/Remove-ADOServiceEndpoint.ps1 diff --git a/Remove-ADOTeam.ps1 b/Functions/AzureDevOps/Remove-ADOTeam.ps1 similarity index 100% rename from Remove-ADOTeam.ps1 rename to Functions/AzureDevOps/Remove-ADOTeam.ps1 diff --git a/Remove-ADOWiki.ps1 b/Functions/AzureDevOps/Remove-ADOWiki.ps1 similarity index 100% rename from Remove-ADOWiki.ps1 rename to Functions/AzureDevOps/Remove-ADOWiki.ps1 diff --git a/Remove-ADOWorkItem.ps1 b/Functions/AzureDevOps/Remove-ADOWorkItem.ps1 similarity index 100% rename from Remove-ADOWorkItem.ps1 rename to Functions/AzureDevOps/Remove-ADOWorkItem.ps1 diff --git a/Remove-ADOWorkItemType.ps1 b/Functions/AzureDevOps/Remove-ADOWorkItemType.ps1 similarity index 100% rename from Remove-ADOWorkItemType.ps1 rename to Functions/AzureDevOps/Remove-ADOWorkItemType.ps1 diff --git a/Set-ADOArtifactFeed.ps1 b/Functions/AzureDevOps/Set-ADOArtifactFeed.ps1 similarity index 100% rename from Set-ADOArtifactFeed.ps1 rename to Functions/AzureDevOps/Set-ADOArtifactFeed.ps1 diff --git a/Set-ADOBuild.ps1 b/Functions/AzureDevOps/Set-ADOBuild.ps1 similarity index 100% rename from Set-ADOBuild.ps1 rename to Functions/AzureDevOps/Set-ADOBuild.ps1 diff --git a/Set-ADOEndpoint.ps1 b/Functions/AzureDevOps/Set-ADOEndpoint.ps1 similarity index 100% rename from Set-ADOEndpoint.ps1 rename to Functions/AzureDevOps/Set-ADOEndpoint.ps1 diff --git a/Set-ADOExtension.ps1 b/Functions/AzureDevOps/Set-ADOExtension.ps1 similarity index 100% rename from Set-ADOExtension.ps1 rename to Functions/AzureDevOps/Set-ADOExtension.ps1 diff --git a/Set-ADOPermission.ps1 b/Functions/AzureDevOps/Set-ADOPermission.ps1 similarity index 99% rename from Set-ADOPermission.ps1 rename to Functions/AzureDevOps/Set-ADOPermission.ps1 index 68da958e..0c96ec82 100644 --- a/Set-ADOPermission.ps1 +++ b/Functions/AzureDevOps/Set-ADOPermission.ps1 @@ -4,7 +4,7 @@ .Synopsis Sets Azure DevOps Permissions .Description - Gets Azure DevOps security permissions. + Sets Azure DevOps security permissions. .Example Set-ADOPermission -Organization MyOrganization -Project MyProject -PersonalAccessToken $pat .Link @@ -325,8 +325,7 @@ 'RepositoryID|AllRepositories|ProjectRepository' { $q.Enqueue(@{ NamespaceID = '2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87' - SecurityToken = "repo$( -if ($psCmdlet.ParameterSetName -eq 'AllRepositories') {'s'})V2$( + SecurityToken = "repoV2$( if ($ProjectID) { '/' + $projectId} )$( if ($repositoryID) {'/' + $repositoryID} diff --git a/Set-ADOProject.ps1 b/Functions/AzureDevOps/Set-ADOProject.ps1 similarity index 100% rename from Set-ADOProject.ps1 rename to Functions/AzureDevOps/Set-ADOProject.ps1 diff --git a/Set-ADOTeam.ps1 b/Functions/AzureDevOps/Set-ADOTeam.ps1 similarity index 100% rename from Set-ADOTeam.ps1 rename to Functions/AzureDevOps/Set-ADOTeam.ps1 diff --git a/Set-ADOWorkItem.ps1 b/Functions/AzureDevOps/Set-ADOWorkItem.ps1 similarity index 100% rename from Set-ADOWorkItem.ps1 rename to Functions/AzureDevOps/Set-ADOWorkItem.ps1 diff --git a/Set-ADOWorkProcess.ps1 b/Functions/AzureDevOps/Set-ADOWorkProcess.ps1 similarity index 100% rename from Set-ADOWorkProcess.ps1 rename to Functions/AzureDevOps/Set-ADOWorkProcess.ps1 diff --git a/Start-ADOBuild.ps1 b/Functions/AzureDevOps/Start-ADOBuild.ps1 similarity index 100% rename from Start-ADOBuild.ps1 rename to Functions/AzureDevOps/Start-ADOBuild.ps1 diff --git a/Stop-ADOBuild.ps1 b/Functions/AzureDevOps/Stop-ADOBuild.ps1 similarity index 100% rename from Stop-ADOBuild.ps1 rename to Functions/AzureDevOps/Stop-ADOBuild.ps1 diff --git a/Trace-ADOCommand.ps1 b/Functions/AzureDevOps/Trace-ADOCommand.ps1 similarity index 100% rename from Trace-ADOCommand.ps1 rename to Functions/AzureDevOps/Trace-ADOCommand.ps1 diff --git a/Uninstall-ADOExtension.ps1 b/Functions/AzureDevOps/Uninstall-ADOExtension.ps1 similarity index 100% rename from Uninstall-ADOExtension.ps1 rename to Functions/AzureDevOps/Uninstall-ADOExtension.ps1 diff --git a/Update-ADOBuild.ps1 b/Functions/AzureDevOps/Update-ADOBuild.ps1 similarity index 100% rename from Update-ADOBuild.ps1 rename to Functions/AzureDevOps/Update-ADOBuild.ps1 diff --git a/Update-ADODashboard.ps1 b/Functions/AzureDevOps/Update-ADODashboard.ps1 similarity index 100% rename from Update-ADODashboard.ps1 rename to Functions/AzureDevOps/Update-ADODashboard.ps1 diff --git a/Update-ADOPicklist.ps1 b/Functions/AzureDevOps/Update-ADOPicklist.ps1 similarity index 100% rename from Update-ADOPicklist.ps1 rename to Functions/AzureDevOps/Update-ADOPicklist.ps1 diff --git a/Wait-ADOBuild.ps1 b/Functions/AzureDevOps/Wait-ADOBuild.ps1 similarity index 100% rename from Wait-ADOBuild.ps1 rename to Functions/AzureDevOps/Wait-ADOBuild.ps1 diff --git a/Write-ADODebug.ps1 b/Functions/AzureDevOps/Write-ADODebug.ps1 similarity index 100% rename from Write-ADODebug.ps1 rename to Functions/AzureDevOps/Write-ADODebug.ps1 diff --git a/Write-ADOError.ps1 b/Functions/AzureDevOps/Write-ADOError.ps1 similarity index 100% rename from Write-ADOError.ps1 rename to Functions/AzureDevOps/Write-ADOError.ps1 diff --git a/Write-ADOOutput.ps1 b/Functions/AzureDevOps/Write-ADOOutput.ps1 similarity index 100% rename from Write-ADOOutput.ps1 rename to Functions/AzureDevOps/Write-ADOOutput.ps1 diff --git a/Write-ADOProgress.ps1 b/Functions/AzureDevOps/Write-ADOProgress.ps1 similarity index 100% rename from Write-ADOProgress.ps1 rename to Functions/AzureDevOps/Write-ADOProgress.ps1 diff --git a/Write-ADOVariable.ps1 b/Functions/AzureDevOps/Write-ADOVariable.ps1 similarity index 100% rename from Write-ADOVariable.ps1 rename to Functions/AzureDevOps/Write-ADOVariable.ps1 diff --git a/Write-ADOWarning.ps1 b/Functions/AzureDevOps/Write-ADOWarning.ps1 similarity index 100% rename from Write-ADOWarning.ps1 rename to Functions/AzureDevOps/Write-ADOWarning.ps1 diff --git a/Convert-BuildStep.ps1 b/Functions/Convert-BuildStep.ps1 similarity index 100% rename from Convert-BuildStep.ps1 rename to Functions/Convert-BuildStep.ps1 diff --git a/Expand-BuildStep.ps1 b/Functions/Expand-BuildStep.ps1 similarity index 100% rename from Expand-BuildStep.ps1 rename to Functions/Expand-BuildStep.ps1 diff --git a/Get-BuildStep.ps1 b/Functions/Get-BuildStep.ps1 similarity index 100% rename from Get-BuildStep.ps1 rename to Functions/Get-BuildStep.ps1 diff --git a/Get-PSDevOps.ps1 b/Functions/Get-PSDevOps.ps1 similarity index 100% rename from Get-PSDevOps.ps1 rename to Functions/Get-PSDevOps.ps1 diff --git a/Add-Git.ps1 b/Functions/Git/Add-Git.ps1 similarity index 100% rename from Add-Git.ps1 rename to Functions/Git/Add-Git.ps1 diff --git a/Push-Git.ps1 b/Functions/Git/Push-Git.ps1 similarity index 100% rename from Push-Git.ps1 rename to Functions/Git/Push-Git.ps1 diff --git a/Submit-Git.ps1 b/Functions/Git/Submit-Git.ps1 similarity index 100% rename from Submit-Git.ps1 rename to Functions/Git/Submit-Git.ps1 diff --git a/Connect-GitHub.ps1 b/Functions/GitHub/Connect-GitHub.ps1 similarity index 100% rename from Connect-GitHub.ps1 rename to Functions/GitHub/Connect-GitHub.ps1 diff --git a/Disconnect-GitHub.ps1 b/Functions/GitHub/Disconnect-GitHub.ps1 similarity index 100% rename from Disconnect-GitHub.ps1 rename to Functions/GitHub/Disconnect-GitHub.ps1 diff --git a/Hide-GitHubOutput.ps1 b/Functions/GitHub/Hide-GitHubOutput.ps1 similarity index 100% rename from Hide-GitHubOutput.ps1 rename to Functions/GitHub/Hide-GitHubOutput.ps1 diff --git a/Invoke-GitHubRESTApi.ps1 b/Functions/GitHub/Invoke-GitHubRESTApi.ps1 similarity index 100% rename from Invoke-GitHubRESTApi.ps1 rename to Functions/GitHub/Invoke-GitHubRESTApi.ps1 diff --git a/New-GitHubAction.ps1 b/Functions/GitHub/New-GitHubAction.ps1 similarity index 100% rename from New-GitHubAction.ps1 rename to Functions/GitHub/New-GitHubAction.ps1 diff --git a/New-GitHubWorkflow.ps1 b/Functions/GitHub/New-GitHubWorkflow.ps1 similarity index 100% rename from New-GitHubWorkflow.ps1 rename to Functions/GitHub/New-GitHubWorkflow.ps1 diff --git a/Trace-GitHubCommand.ps1 b/Functions/GitHub/Trace-GitHubCommand.ps1 similarity index 100% rename from Trace-GitHubCommand.ps1 rename to Functions/GitHub/Trace-GitHubCommand.ps1 diff --git a/Write-GitHubDebug.ps1 b/Functions/GitHub/Write-GitHubDebug.ps1 similarity index 100% rename from Write-GitHubDebug.ps1 rename to Functions/GitHub/Write-GitHubDebug.ps1 diff --git a/Write-GitHubError.ps1 b/Functions/GitHub/Write-GitHubError.ps1 similarity index 100% rename from Write-GitHubError.ps1 rename to Functions/GitHub/Write-GitHubError.ps1 diff --git a/Write-GitHubOutput.ps1 b/Functions/GitHub/Write-GitHubOutput.ps1 similarity index 100% rename from Write-GitHubOutput.ps1 rename to Functions/GitHub/Write-GitHubOutput.ps1 diff --git a/Write-GitHubWarning.ps1 b/Functions/GitHub/Write-GitHubWarning.ps1 similarity index 100% rename from Write-GitHubWarning.ps1 rename to Functions/GitHub/Write-GitHubWarning.ps1 diff --git a/Import-BuildStep.ps1 b/Functions/Import-BuildStep.ps1 similarity index 100% rename from Import-BuildStep.ps1 rename to Functions/Import-BuildStep.ps1 diff --git a/Functions/README.md b/Functions/README.md new file mode 100644 index 00000000..5b2ed6f9 --- /dev/null +++ b/Functions/README.md @@ -0,0 +1,9 @@ +This directory and it's subdirectories contains the functions exported from PSDevOps. + +Common functionality resides in this directory. + +There are many functions in categorized subdirectories: + +* [AzureDevOps](AzureDevOps) +* [Git](Git) +* [GitHub](GitHub) diff --git a/GitHub/Actions/PSDevOpsAction.ps1 b/GitHub/Actions/PSDevOpsAction.ps1 new file mode 100644 index 00000000..26724fb6 --- /dev/null +++ b/GitHub/Actions/PSDevOpsAction.ps1 @@ -0,0 +1,172 @@ +<# +.Synopsis + GitHub Action for PSDevOps +.Description + GitHub Action for PSDevOps. This will: + + * Import PSDevOps and Connect-GitHub (giving easy access to every GitHub API) + * Run all *.PSDevOps.ps1 files beneath the workflow directory + * Run a .PSDevOpsScript parameter. + + + If you will be making changes using the GitHubAPI, you should provide a -GitHubToken + If none is provided, and ENV:GITHUB_TOKEN is set, this will be used instead. + Any files changed can be outputted by the script, and those changes can be checked back into the repo. + Make sure to use the "persistCredentials" option with checkout. + +#> + +param( +# A PowerShell Script that uses PSDevOps. +# Any files outputted from the script will be added to the repository. +# If those files have a .Message attached to them, they will be committed with that message. +[string] +$PSDevOpsScript, + +# If set, will not process any files named *.PSDevOps.ps1 +[switch] +$SkipPSDevOpsPS1, + +# If provided, will use this GitHubToken when running Connect-GitHub +[string] +$GitHubToken, + +[PSObject] +$Parameter, + +# If provided, will commit any remaining changes made to the workspace with this commit message. +[string] +$CommitMessage, + +# The user email associated with a git commit. +[string] +$UserEmail, + +# The user name associated with a git commit. +[string] +$UserName +) + +"::group::Parameters" | Out-Host +[PSCustomObject]$PSBoundParameters | Format-List | Out-Host +"::endgroup::" | Out-Host + +if ($env:GITHUB_ACTION_PATH) { + $PSDevOpsModulePath = Join-Path $env:GITHUB_ACTION_PATH 'PSDevOps.psd1' + if (Test-path $PSDevOpsModulePath) { + Import-Module $PSDevOpsModulePath -Force -PassThru | Out-String + } else { + throw "PSDevOps not found" + } +} elseif (-not (Get-Module PSDevOps)) { + throw "Action Path not found" +} + +"::notice title=ModuleLoaded::PSDevOps Loaded from Path - $($PSDevOpsModulePath)" | Out-Host + + +$ght = + if ($GitHubToken) { + $GitHubToken + } elseif ($env:GITHUB_TOKEN) { + $env:GITHUB_TOKEN + } +"::group::Connecting to Github" | Out-Host +$connectStart = [DateTime]::now +Connect-GitHub -PersonalAccessToken $GitHubToken -PassThru | + ForEach-Object { + $githubModule = $_ + "::notice title=Connected::Connect-GitHub finished - $($githubModule.ExportedCommands.Count) Commands Imported" | Out-Host + $githubModule.ExportedCommands.Keys -join [Environment]::Newline | Out-Host + } | + Out-Host +"::endgroup::" | Out-Host + +$anyFilesChanged = $false +$processScriptOutput = { process { + $out = $_ + $outItem = Get-Item -Path $out -ErrorAction SilentlyContinue + $fullName, $shouldCommit = + if ($out -is [IO.FileInfo]) { + $out.FullName, (git status $out.Fullname -s) + } elseif ($outItem) { + $outItem.FullName, (git status $outItem.Fullname -s) + } + if ($shouldCommit) { + git add $fullName + if ($out.Message) { + git commit -m "$($out.Message)" + } elseif ($out.CommitMessage) { + git commit -m "$($out.CommitMessage)" + } + $anyFilesChanged = $true + } + $out +} } + + +if (-not $UserName) { $UserName = $env:GITHUB_ACTOR } +if (-not $UserEmail) { $UserEmail = "$UserName@github.com" } +git config --global user.email $UserEmail +git config --global user.name $UserName + +if (-not $env:GITHUB_WORKSPACE) { throw "No GitHub workspace" } + +git pull | Out-Host + +$PSDevOpsScriptStart = [DateTime]::Now +if ($PSDevOpsScript) { + Invoke-Expression -Command $PSDevOpsScript | + . $processScriptOutput | + Out-Host +} +$PSDevOpsScriptTook = [Datetime]::Now - $PSDevOpsScriptStart +"::set-output name=PSDevOpsScriptRuntime::$($PSDevOpsScriptTook.TotalMilliseconds)" | Out-Host + +$PSDevOpsPS1Start = [DateTime]::Now +$PSDevOpsPS1List = @() +if (-not $SkipPSDevOpsPS1) { + Get-ChildItem -Recurse -Path $env:GITHUB_WORKSPACE | + Where-Object Name -Match '\.PSDevOps\.ps1$' | + + ForEach-Object { + $PSDevOpsPS1List += $_.FullName.Replace($env:GITHUB_WORKSPACE, '').TrimStart('/') + $PSDevOpsPS1Count++ + "::notice title=Running::$($_.Fullname)" | Out-Host + . $_.FullName | + . $processScriptOutput | + Out-Host + } +} +$PSDevOpsPS1EndStart = [DateTime]::Now +$PSDevOpsPS1Took = [Datetime]::Now - $PSDevOpsPS1Start +"::set-output name=PSDevOpsPS1Count::$($PSDevOpsPS1List.Length)" | Out-Host +"::set-output name=PSDevOpsPS1Files::$($PSDevOpsPS1List -join ';')" | Out-Host +"::set-output name=PSDevOpsPS1Runtime::$($PSDevOpsPS1Took.TotalMilliseconds)" | Out-Host +if ($CommitMessage -or $anyFilesChanged) { + if ($CommitMessage) { + dir $env:GITHUB_WORKSPACE -Recurse | + ForEach-Object { + $gitStatusOutput = git status $_.Fullname -s + if ($gitStatusOutput) { + git add $_.Fullname + } + } + + git commit -m $ExecutionContext.SessionState.InvokeCommand.ExpandString($CommitMessage) + } + + + + + $checkDetached = git symbolic-ref -q HEAD + if (-not $LASTEXITCODE) { + "::notice::Pushing Changes" | Out-Host + $gitPushed = git push + "Git Push Output: $($gitPushed | Out-String)" + } else { + "::notice::Not pushing changes (on detached head)" | Out-Host + $LASTEXITCODE = 0 + exit 0 + } +} diff --git a/GitHub/Jobs/HelpOut.psd1 b/GitHub/Jobs/HelpOut.psd1 new file mode 100644 index 00000000..81f04a75 --- /dev/null +++ b/GitHub/Jobs/HelpOut.psd1 @@ -0,0 +1,14 @@ +@{ + "runs-on" = "ubuntu-latest" + if = '${{ success() }}' + steps = @( + @{ + name = 'Check out repository' + uses = 'actions/checkout@v2' + }, + 'RunHelpOut' + ) +} + + + diff --git a/GitHub/Jobs/HelpOutWiki.psd1 b/GitHub/Jobs/HelpOutWiki.psd1 new file mode 100644 index 00000000..54b37e22 --- /dev/null +++ b/GitHub/Jobs/HelpOutWiki.psd1 @@ -0,0 +1,25 @@ +@{ + "runs-on" = "ubuntu-latest" + if = '${{ success() }}' + steps = @( + @{ + name = 'Check out repository' + uses = 'actions/checkout@v2' + with = @{ + repository = '${{ github.repository }}.wiki' + path = 'wiki' + persistCredentials = $true + } + + }, + @{ + name = 'Check out repository' + uses = 'actions/checkout@v2' + persistCredentials = $true + } + 'RunHelpOut' + ) +} + + + diff --git a/GitHub/Jobs/RunEZOut.psd1 b/GitHub/Jobs/RunEZOut.psd1 new file mode 100644 index 00000000..e99e0a4e --- /dev/null +++ b/GitHub/Jobs/RunEZOut.psd1 @@ -0,0 +1,17 @@ +@{ + "runs-on" = "ubuntu-latest" + if = '${{ success() }}' + steps = @( + @{ + name = 'Check out repository' + uses = 'actions/checkout@v2' + }, 'RunEZOut', @{ + name = 'Push Changes' + shell = 'pwsh' + run = 'git push; exit 0' + } + ) +} + + + diff --git a/GitHub/Steps/RunEZOut.psd1 b/GitHub/Steps/RunEZOut.psd1 new file mode 100644 index 00000000..6536c1b4 --- /dev/null +++ b/GitHub/Steps/RunEZOut.psd1 @@ -0,0 +1,4 @@ +@{ + name = "UseEZOut" + uses = "StartAutomating/EZOut@master" +} diff --git a/GitHub/Steps/RunHelpOut.psd1 b/GitHub/Steps/RunHelpOut.psd1 new file mode 100644 index 00000000..2ddc3c3b --- /dev/null +++ b/GitHub/Steps/RunHelpOut.psd1 @@ -0,0 +1,4 @@ +@{ + name = "UseHelpOut" + uses = "StartAutomating/HelpOut@master" +} diff --git a/PSDevOps.GitHubWorkflow.psdevops.ps1 b/PSDevOps.GitHubWorkflow.psdevops.ps1 index 03d1407b..8faea620 100644 --- a/PSDevOps.GitHubWorkflow.psdevops.ps1 +++ b/PSDevOps.GitHubWorkflow.psdevops.ps1 @@ -1,7 +1,7 @@ #requires -Module PSDevOps Push-Location $PSScriptRoot -New-GitHubWorkflow -Name "Analyze, Test, Tag, and Publish" -On Push, PullRequest, Demand -Job PowerShellStaticAnalysis, TestPowerShellOnLinux, TagReleaseAndPublish -Environment @{ +New-GitHubWorkflow -Name "Analyze, Test, Tag, and Publish" -On Push, PullRequest, Demand -Job PowerShellStaticAnalysis, TestPowerShellOnLinux, TagReleaseAndPublish, HelpOut, RunEZOut -Environment @{ SYSTEM_ACCESSTOKEN = '${{ secrets.AZUREDEVOPSPAT }}' NoCoverage = $true }| diff --git a/PSDevOps.HelpOut.ps1 b/PSDevOps.HelpOut.ps1 new file mode 100644 index 00000000..77df575f --- /dev/null +++ b/PSDevOps.HelpOut.ps1 @@ -0,0 +1,13 @@ +$PSDevOpsLoaded = Get-Module PSDevOps +if (-not $PSDevOpsLoaded) { + $PSDevOpsLoaded = Get-ChildItem -Recurse -Filter "*.psd1" | Where-Object Name -like 'PSDevOps*' | Import-Module -Name { $_.FullName } -Force -PassThru +} +if ($PSDevOpsLoaded) { + "::notice title=ModuleLoaded::PSDevOps Loaded" | Out-Host +} else { + "::error:: PSDevOps not loaded" |Out-Host +} +if ($PSDevOpsLoaded) { + Save-MarkdownHelp -Module $PSDevOpsLoaded.Name -PassThru | + Add-Member ScriptProperty CommitMessage {"Updating $($this.Name)" } -Force -PassThru +} 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.psd1 b/PSDevOps.psd1 index bc671d87..01936d36 100644 --- a/PSDevOps.psd1 +++ b/PSDevOps.psd1 @@ -1,5 +1,5 @@ @{ - ModuleVersion = '0.5.7' + ModuleVersion = '0.5.8' RootModule = 'PSDevOps.psm1' Description = 'PowerShell Tools for DevOps' Guid = 'e6b56c5f-41ac-4ba4-8b88-2c063f683176' @@ -9,6 +9,22 @@ ProjectURI = 'https://github.com/StartAutomating/PSDevOps' LicenseURI = 'https://github.com/StartAutomating/PSDevOps/blob/master/LICENSE' ReleaseNotes = @' +0.5.8: +* Running EZOut in Workflow (#148) +* Adding support for HelpOut (#147) +* Updating action (pushing changes) #144 +* Updating GitHub Workflow steps/jobs - adding support for HelpOut and EZOut +* Initial Version of PSDevOps Action (#144) +* Adding Remove-ADOPermission (#143) +* Set-ADOPermission: Fixing help typo +* Adding FlushRequestQueue Part +* Fixing Refactoring Related Import Issue +* Adding Initial Extensions (related to -ADOTest commands) +* Add-ADOTest: Initial Commit +* Get-ADOBuild: Passing along ProjectID and ProjectName +* Get/Set-ADOPermission: Repov2 issue (#140) +* Recategorizing Functions +--- 0.5.7: --- * Fixing issue with setting branch permissions (#136) @@ -16,19 +32,6 @@ * Set-ADOPermission: Exposing specialized parameter sets (#138) * PSDevOps.WorkProcess objects now return .ProcessName and .ProcessID as alias properties -0.5.6: ---- -### Azure DevOps Improvements -* Get-ADOPermission : Can now get permissions related to Dashboards, Analytics, AreaPaths, and IterationPaths -* Set-ADOPermission : Now can easily set permissions based off of a variety of pipeline inputs (Fixes #128 and #91) -* Get-ADOAreaPath : Removing "Area" from paths passed in, formatting returns with 'AreaPath' instead of 'Path' -* Get-ADOIterationPath : Removing "Iteration" from paths passed in, formatting returns with 'IterationPath' instead of 'Path' -* Get-ADOBuild : Extended Type Definitions now contain an alias property of BuildPath -### GitHub Workflow Improvements -* Adding "On" files for issue creation, deletion, or modification (Fixes #132) -* Adding "On" files for common scheduling needs (Fixes #134) -* ReleaseNameFormat can not be customized in ReleaseModule step (Fixes #130) - Previous Release Notes available in [CHANGELOG.md](https://github.com/StartAutomating/PSDevOps/blob/master/CHANGELOG.md) '@ } diff --git a/PSDevOps.psm1 b/PSDevOps.psm1 index ca3569a9..36ab64dd 100644 --- a/PSDevOps.psm1 +++ b/PSDevOps.psm1 @@ -2,7 +2,8 @@ [Diagnostics.CodeAnalysis.SuppressMessageAttribute("Test-ForSlowScript", "", Justification="Performance is not a priority for this module")] param() #region Import Functions -foreach ($file in Get-ChildItem -Path $psScriptRoot -Filter *-*.ps1) { +$functionsRoot = Join-Path $psScriptRoot Functions +foreach ($file in Get-ChildItem -Path "$functionsRoot" -Filter *-*.ps1 -Recurse) { . $file.FullName } #endregion Import Functions 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 + + + + diff --git a/Parts/FlushRequestQueue.ps1 b/Parts/FlushRequestQueue.ps1 new file mode 100644 index 00000000..304f4fa4 --- /dev/null +++ b/Parts/FlushRequestQueue.ps1 @@ -0,0 +1,83 @@ +<# +.Synopsis + Flushes the Request Queue +.Description + Flushes the Queue of pending Invoke-ADORestApi calls. +#> +param( +# The name of the invoker command +[Parameter(Mandatory)] +[ValidateSet('Invoke-ADORestAPI','Invoke-GitHubRESTApi')] +[string] +$Invoker +) +if ((-not $t) -or (-not $progId)) { + $c, $t, $progId = 0, $rq.Count, $(Get-Random) +} + +while ($rq.Count) { + $invokeSplat = $rq.Dequeue() + + if ($invokeParams) { + $invokeSplat += $invokeParams + } + $invokeSplatUrl = $invokeSplat.Url, $invokeSplat.uri -ne $null + if ("$invokeSplatUrl".StartsWith('/')) { + $invokeSplatUrl = + @( + "$server".TrimEnd('/') # * The Server + "/$organization" + $invokeSplatUrl + ) -join '' + $invokeSplat.Remove('Url') + $invokeSplat.Remove('Uri') + $invokeSplat.Url = $invokeSplatUrl + } + if ($ApiVersion -and -not $invokeSplat.QueryParameter.apiVersion) { + if (-not $invokeSplat.QueryParameter) { + $invokeSplat.QueryParameter = @{} + } + $invokeSplat.QueryParameter.'api-version' = $ApiVersion + } + + $status = + if ($invokeSplat.Status) { + $invokeSplat.Status + $invokeSplat.Remove('Status') + } + elseif ($invokeSplat.Method) { + $invokeSplat.Method + } else + { + "GET" + } + + $activity = + if ($invokeSplat.Activity) { + $invokeSplat.Activity + $invokeSplat.Remove('Activity') + } + elseif ($invokeSplatUrl) { + $invokeSplatUrl + } else + { + " " + } + + if (-not $InvokeSplat.Property) { + $InvokeSplat.Property = [Ordered]@{} + } + if ($organization -and -not $InvokeSplat.Property.Organization) { + $InvokeSplat.Property.Organization = $organization + } + if ($ProjectID -and -not $InvokeSplat.Property.Organization) { + $InvokeSplat.Property.ProjectID = $ProjectID + } + $c++ + $p = $c* 100/$t + Write-Progress $status $activity -PercentComplete $p -Id $progId + & $ExecutionContext.SessionState.InvokeCommand.GetCommand($Invoker, 'Function') @invokeSplat +} +if ($c -eq $t) { + Write-Progress $status $activity -Completed $progId +} \ No newline at end of file diff --git a/Parts/GetInvokeParameters.ps1 b/Parts/GetInvokeParameters.ps1 index 649a2267..52037b82 100644 --- a/Parts/GetInvokeParameters.ps1 +++ b/Parts/GetInvokeParameters.ps1 @@ -14,7 +14,11 @@ $InvokeParameter, [Parameter(Mandatory,ParameterSetName='GetDynamicParameters')] [Alias('DynamicParameters')] [switch] -$DynamicParameter +$DynamicParameter, + +[Parameter(ParameterSetName='GetDynamicParameters')] +[string] +$CommandName ) begin { @@ -47,8 +51,10 @@ process { if ($attr.ValueFromPipelineByPropertyName) {$attr.ValueFromPipelineByPropertyName = $false} } } + } + if (-not $CommandName) { + return $script:InvokeADORestAPIParams } - return $script:InvokeADORestAPIParams } if ($PSCmdlet.ParameterSetName -eq 'GetParameterValues') { $invokeParams = [Ordered]@{} + $InvokeParameter # Then we copy our parameters diff --git a/ReleaseNotes.md b/ReleaseNotes.md deleted file mode 100644 index 8477aebf..00000000 --- a/ReleaseNotes.md +++ /dev/null @@ -1,280 +0,0 @@ -0.5.3 ---- -* Get-ADORepository : Adding -PullRequestID -* New/Set-ADOWorkItem: Fixing pipelining issue - -0.5.2 ---- -* Get-ADOTeam: Adding alias -AreaPath for -TeamFieldValue, carrying on team property -* Set-ADOTeam: Support for -DefaultAreaPath/-AreaPath (TeamFieldValues api, fixing issue #92) -* Get-ADOTest: Enabling pagination and filtering of results. -** Invoke-ADORestAPI: Fixing -Cache(ing) correctly (#88) -** Invoke-GitHubRESTAPI: Only using .ContentEncoding if present in results (PowerShell core fix) -* Get-ADOWorkItem: -** Fixing -Related (#79) -** Fixing -Comment errors when there are no commments (#80) -* New/Set-ADOWorkItem: -** Adding -Relationship and -Comment (#81) -** Improving Formatting of Work Items (#82) -** Adding -Tag -* Invoke-ADORestAPI: Fixing issue with -QueryParameter - -0.5.1 ---- -* Bugfixes: -** Get-ADOTest: Fixing parameter sets and adding formatting. -** Invoke-GitHubRESTAPI: Only using .ContentEncoding when present. -0.5 ---- -* Improved Git Functionality -** New-GitHubAction -** Invoke-GitHubRESTApi -** Connect/Disconnect-GitHub (enabling smart aliases like api.github.com/zen and api.github.com/repos//) -** Formatting for GitHub Issues and Repos -* Azure DevOps Additions/Fixes -** Invoke-ADORestAPI -AsJob - -** Get-ADOArtifactFeed now has -Metric, -PackageList, -PackageVersionList, -Provenance -** Get-ADOIdentity [new] -** Get-ADOProject now has -Board, -TestVariable, -TestConfiguration -** Get-ADOPermission is now more API-complete and has parameter sets for permission types -** Set-ADOPermission -** Get-ADOExtension can now read extension data -** Set-ADOExtension can now set extension data -** Get-ADOTest [new] -** New-ADOPipeline now has -RootDirectory -** Tons of New Type Definitions and Formatters - -0.4.9 ---- -* New Command: Wait-ADOBuild -* Start-ADOBuild -** Supports -Debug (to start a build with extra tracing) -** Allows parameters as PSObject -* Get-ADORepository: Added -IncludeHidden, -IncludeRemoteURL, -IncludeLink -* Improvements to Pipelines and Workflows: -** Pester, PSScriptAnalyzer, and ScriptCop now produce output variables -** PSDevOps now includes a file to generate it's own build -** PublishTest/CodeCoverage Results steps will always() run -** Convert-BuildStep will add a .Name to each script step. -0.4.8 ---- -* Improved Tracing -** New Commands: Write-ADOOutput, Trace-ADOCommand/GitHubCommand -** Renaming Command / Adding Parameters: Set-ADOVariable -> Write-ADOVariable. Added -IsOutput & -IsReadOnly. -** Adding Trace-GitHubCommand/ADOCommand -** Improved logging of parameters in Convert-BuildStep -* New Functionality in Azure DevOps: -** Get-ADOProject now has -TestRun, -TestPlan, -Release, and -PendingApproval (and better progress bars) -** Get-ADOWorkItemType now has -Field -** Commands for Picklists: Add/Get/Remove/Update-ADOPicklist -0.4.7 ----- -* New Commands: -** Add/Get/Remove-ADOWiki -** Get-ADOPermission -* Bugfixes: -** Honoring Get-ADOBuild -DefinitionName -* Disconnect-ADO is now run prior at the start of Connect-ADO, and on module unload. -0.4.6 ---- -* New-ADOPipeline/New-GitHubWorkflow: Adding -BuildScript -* Connect-ADO: Auto-detecting connected user's teams and adding tab completion for -Project/-ProjectID/-Team/-TeamID -* Convert-BuildStep: Re-ordering YAML for GitHub Workflows (putting .runs last) -* Convert-ADOPipeline: Not returning .inputs when there are no .inputs -* Get-ADOProject: Adding -PolicyType and -PolicyConfiguration -* Get-ADORepository: Adding -PullRequest, -SourceReference, -TargetReference, -ReviewerIdentity, -CreatorIdentity. -* Get-ADOBuild: Adding -DefinitionName -* Invoke-ADORestAPI: Passing content length of 0 when body is empty. -* Updating README - - -0.4.5 ---- -* New Commands: -** Connect/Disconnect-ADO: Caching connection info and saving default parameters! -** New-ADOBuild : Create build definitions! -** Remove-ADOAgentPool : Cleaning up pools, queues, and agents. -* Core Improvements -** Invoke-ADORestApi -*** Now supports -ContinuationToken (and auto-continues unless passed a $first or $top query parameter) -*** Caches access tokens. -*** BREAKING: Invoke-ADORestApi No longer has -Proxy* parameters. -* Updated Commands: -** Get-ADOUser/Get-ADOTeam : Additional Graph scenarios added. -** New/Set-ADOWorkItem : Added -BypassRule, -ValidateOnly, -SkipNotification -0.4.4 ---- -* Get-ADOTask: Adding -YAMLSchema. -* Get-ADOTeam: Adding -Setting/-FieldValue/-Iteration/-Board. -* Get-ADOAreaPath/ADOIterationPath: Making parameter names match cmdlet. Honoring -AreaPath/-IterationPath. -* Get-ADOProject: Adding -ProcessConfiguration, -Plan, -PlanID, and -DeliveryTimeline. -* New Command: Set-ADOTeam -0.4.3 ---- -*Renaming commands: -** New-ADODashboard -> Add-ADODashboard -** New-ADOTeam -> Add-ADOTeam -* Add-ADOTeam can now add members to a team -* Get-ADOTeam can now get an -Identity -* New Command: Get-ADOUser -* Get-ADOAgentPool: Fixed pipelining bug, added -AgentName/-IncludeCapability/-IncludeLastCompletedRequest/-IncludeAssignedRequest. -* Set-ADOProject: Can now -EnableFeature and -DisableFeature -0.4.2 ---- -* Build Step Improvements: -** New-ADOPipeline now has -PowerShellCore and -WindowsPowerShell -** Import-BuildStep now has parameter sets -** New-ADOPipeline/New-GitHubWorkflow now refer to a metadata collection based off of their noun. -** BuildStep directories can be aliased: -*** ADOPipeline directories can be: ADOPipeline, ADO, AzDo, and AzureDevOps. -*** GitHubWorkflow directories can be: GitHubWorkflow, GitHubWorkflows, and GitHub. -* New Dashboard Commands: Clear/Update-ADODashboard -* New Extension Commands: Enable/Disbale-ADOExtension -* Improved formatting/types for Extensions. -* Breaking change: Install/Uninstall-ADOExtension now accept -PublisherID and -ExtensionID, not -PublisherName and -ExtensionName. -0.4.1 ---- -* More GitHub Functionality: -** Write-GitHubDebug -** Write-GitHubOutput -** Hide-GitHubOutput -** New-GitHubWorkflow allows for more complex event mapping. -* Azure DevOps Pipeline Changes -** Convert-BuildStep once again converts using ${{parameters}} syntax -* New/Improved Azure DevOps Cmdlets -** Get/New/Remove-ADODashboard -** Get-ADOAgentPool now supports -PoolID -** Set-ADOProject -** Repositories returned from a build definition are now decorated as PSDevOps.Repository -* Improved testing and static analysis compliance -0.4 ---- -* Overhaul of GitHub Workflow functionality. -** New-GitHubAction renamed to New-GitHubWorkflow -** /GitHubActions renamed to /GitHub -** Added -EventParameter to allow for parameters from events such as workflow_dispatch -** Added Write-GitHubError/GitHubWarning (updating Write-ADOError/Write-ADOWarning for consistency) -** Cleaning up GitHub Workflow parts -* Get-ADOTask no longer has -ApiVersion parameter -0.3.9 ---- -* New/Get/Remove-ADOWorkItemType: Create/get/remove work custom work item types, states, rules, and behaviors. -* Added Get-ADOBuild -IncludeAllProperty/-IncludeLatestBuild. -* ScriptCop Integration: PowerShelllStaticAnalysis stage now runs ScriptCop as well. -* Improved ScriptAnalyzer Integration: Rule name is now outputted. -0.3.8 ---- -* Add/Remove-ADOAreaPath -* Formatter for AreaPaths - -0.3.7 ---- -* Convert-ADOPipeline now has -Passthru and -Wherefore -* Get-ADOWorkProcess now has -Behavior and -WorkItemType -* Get-ADOWorkItem now has -Mine, -CurrentIteration, -Comment, -Update, -Revision. - -0.3.6.1 ---- -* Convert-ADOPipeline now binds to .Variables property -* Fixing bug in PSDevOps.WorkItem types file, which displayed in formatting. -0.3.6 ---- -* Added: Get-ADOTask, Convert-ADOPipeline -0.3.5 ---- -* New Command: Get-ADOTeam -* Get-ADOBuild -CodeCoverage -* Progress bars on Get-ADORepository -* Slight refactoring to make progress bars easier in any function - -0.3.4.1 ---- -* Removing supplied parameters in commands generated by Import-ADOProxy. -0.3.4 ---- -* New capability: Import-ADOProxy (Import a proxy module with for your ADO / TFS instance) -* New REST Commands: Get-ADOAreaPath, Get-ADOIterationPath, Get-ADOExtension -* More Features: Get-ADORepository -FileList -* Massive Internal Refactoring (switching to dynamic parameters for -PersonalAccessToken etc, standardizing pstypenames) -0.3.3 ---- -* Now Caching Personal Access Tokens! -* URLEncoding all segments in Parts/ReplaceRouteParameter. -* Ensuring all Azure DevOps YAML Parameters are wrapped in a string. -0.3.2 ---- -* Pester workarounds - Steps/InstallPester and Steps/RunPester now accept a PesterMaxVersion (defaulting to 4.99.99) -* Convert-BuildStep handles blank parameter defaults correctly -* Get-ADOBuild can get yaml definitions directly, e.g Get-ADOBuild -DefinitionID 123 -DefinitionYaml -0.3.1 ---- -* Bugfixes and Improvements to Convert/Import/Expand-BuildStep: -1. Enforcing pluralization of certain fields within Azure DevOps -2. Handling [string[]], [int[]], [float[]], or [ScriptBlock] parameters -* Allowing lists of primitives to not be indented in YAML. -0.3.0 ---- -* Added Convert/Import/Expand-BuildStep -* Allowing build steps to be defined in functions -* Automagically importing build step parameters -0.2.9 ---- -* Get/New/Remove-ADORepository -* Get/New/Remove-ADOServiceEndpoint -* Get-ADOAgentPool -** Improvements to New-ADOPipeline to avoid unexpected singletons -0.2.8 ---- -* Get/New/Update-ADOBuild -* Improving New-ADOPipeline: -** Unknown -InputObject properties will no longer be pluralized -** Added 'Pool' to list of known singletons -0.2.7 ---- -* New Cmdlet: Set-ADOArtifactFeed -* Improvements to New/Get/Remove-ADOArtifactFeed (better pipelining, renaming -FullyQualifiedID to -FeedID) -0.2.6 ---- -* New Cmdlets: -** New/Get/Remove-ADOArtifactFeed -** New/Remove-ADOProject -** New-GitHubAction -0.2.5 ---- -* Improving Get-ADOWorkItem: -** -Title allows getting work items by title -** -NoDetail allows for queries to only return IDs -** Passing -Field will skip formatting -** WorkItemsBatch will be used for query results. -** Passing an old -ApiVersion will not use workItemsBatch -** Formatting improved -* Adding Get-ADOWorkProcess -* Fixing issues with -ADOField commands when not provided a -Project -0.2.4 ---- -* Adding Adding -CanSortBy, -IsQueryable, and -ReadOnly to New-ADOField. -* Adding parameter help to New-ADOField -0.2.3 ---- -* Adding New/Remove-ADOField -* Adding help to Get-ADOField -* Adding formatting for fields -0.2.2 ---- -* Adding New/Set/Remove-ADOWorkItem -* Adding Get-ADOField -* New Parameter: Get-ADOWorkItem -WorkItemType -* New Parameter: New-ADOPipeline -Option -* Initial formatting -* Switching Parts to use latest VMImage - -0.2.1 : -* Added Get-ADOWorkItem ---- -0.2 : ---- -* Added Invoke-ADORestAPI -0.1 : ---- -Initial Commit diff --git a/action.yml b/action.yml new file mode 100644 index 00000000..9f62403c --- /dev/null +++ b/action.yml @@ -0,0 +1,251 @@ + +name: UsePSDevOps +description: PowerShell Tools for DevOps (including a PowerShell wrapper for the GitHub REST API) +inputs: + PSDevOpsScript: + required: false + description: | + A PowerShell Script that uses PSDevOps. + Any files outputted from the script will be added to the repository. + If those files have a .Message attached to them, they will be committed with that message. + SkipPSDevOpsPS1: + required: false + description: 'If set, will not process any files named *.PSDevOps.ps1' + GitHubToken: + required: false + description: If provided, will use this GitHubToken when running Connect-GitHub + Parameter: + required: false + CommitMessage: + required: false + description: If provided, will commit any remaining changes made to the workspace with this commit message. + UserEmail: + required: false + description: The user email associated with a git commit. + UserName: + required: false + description: The user name associated with a git commit. +branding: + icon: github + color: blue +outputs: + + PSDevOpsScriptRuntime: + description: The time it took the .PSDevOpsScript parameter to run + value: ${{steps.PSDevOpsAction.outputs.PSDevOpsScriptRuntime}} + PSDevOpsPS1Runtime: + description: The time it took all .PSDevOps.ps1 files to run + value: ${{steps.PSDevOpsAction.outputs.PSDevOpsPS1Runtime}} + PSDevOpsPS1Files: + description: The .PSDevOps.ps1 files that were run (separated by semicolons) + value: ${{steps.PSDevOpsAction.outputs.PSDevOpsPS1Files}} + PSDevOpsPS1Count: + description: The number of .PSDevOps.ps1 files that were run + value: ${{steps.PSDevOpsAction.outputs.PSDevOpsPS1Count}} +runs: + using: composite + steps: + - name: PSDevOpsAction + id: PSDevOpsAction + shell: pwsh + env: + GitHubToken: ${{inputs.GitHubToken}} + Parameter: ${{inputs.Parameter}} + UserEmail: ${{inputs.UserEmail}} + CommitMessage: ${{inputs.CommitMessage}} + PSDevOpsScript: ${{inputs.PSDevOpsScript}} + UserName: ${{inputs.UserName}} + SkipPSDevOpsPS1: ${{inputs.SkipPSDevOpsPS1}} + run: | + $Parameters = @{} + $Parameters.PSDevOpsScript = ${env:PSDevOpsScript} + $Parameters.SkipPSDevOpsPS1 = ${env:SkipPSDevOpsPS1} + $Parameters.SkipPSDevOpsPS1 = $parameters.SkipPSDevOpsPS1 -match 'true'; + $Parameters.GitHubToken = ${env:GitHubToken} + $Parameters.Parameter = ${env:Parameter} + $Parameters.Parameter = ConvertFrom-JSON @' + ${{parameters.$ParameterName}} + '@ + $Parameters.CommitMessage = ${env:CommitMessage} + $Parameters.UserEmail = ${env:UserEmail} + $Parameters.UserName = ${env:UserName} + foreach ($k in @($parameters.Keys)) { + if ([String]::IsNullOrEmpty($parameters[$k])) { + $parameters.Remove($k) + } + } + Write-Host "::debug:: PSDevOpsAction $(@(foreach ($p in $Parameters.GetEnumerator()) {'-' + $p.Key + ' ' + $p.Value}) -join ' ')" + & {<# + .Synopsis + GitHub Action for PSDevOps + .Description + GitHub Action for PSDevOps. This will: + + * Import PSDevOps and Connect-GitHub (giving easy access to every GitHub API) + * Run all *.PSDevOps.ps1 files beneath the workflow directory + * Run a .PSDevOpsScript parameter. + + + If you will be making changes using the GitHubAPI, you should provide a -GitHubToken + If none is provided, and ENV:GITHUB_TOKEN is set, this will be used instead. + Any files changed can be outputted by the script, and those changes can be checked back into the repo. + Make sure to use the "persistCredentials" option with checkout. + + #> + + param( + # A PowerShell Script that uses PSDevOps. + # Any files outputted from the script will be added to the repository. + # If those files have a .Message attached to them, they will be committed with that message. + [string] + $PSDevOpsScript, + + # If set, will not process any files named *.PSDevOps.ps1 + [switch] + $SkipPSDevOpsPS1, + + # If provided, will use this GitHubToken when running Connect-GitHub + [string] + $GitHubToken, + + [PSObject] + $Parameter, + + # If provided, will commit any remaining changes made to the workspace with this commit message. + [string] + $CommitMessage, + + # The user email associated with a git commit. + [string] + $UserEmail, + + # The user name associated with a git commit. + [string] + $UserName + ) + + "::group::Parameters" | Out-Host + [PSCustomObject]$PSBoundParameters | Format-List | Out-Host + "::endgroup::" | Out-Host + + if ($env:GITHUB_ACTION_PATH) { + $PSDevOpsModulePath = Join-Path $env:GITHUB_ACTION_PATH 'PSDevOps.psd1' + if (Test-path $PSDevOpsModulePath) { + Import-Module $PSDevOpsModulePath -Force -PassThru | Out-String + } else { + throw "PSDevOps not found" + } + } elseif (-not (Get-Module PSDevOps)) { + throw "Action Path not found" + } + + "::notice title=ModuleLoaded::PSDevOps Loaded from Path - $($PSDevOpsModulePath)" | Out-Host + + + $ght = + if ($GitHubToken) { + $GitHubToken + } elseif ($env:GITHUB_TOKEN) { + $env:GITHUB_TOKEN + } + "::group::Connecting to Github" | Out-Host + $connectStart = [DateTime]::now + Connect-GitHub -PersonalAccessToken $GitHubToken -PassThru | + ForEach-Object { + $githubModule = $_ + "::notice title=Connected::Connect-GitHub finished - $($githubModule.ExportedCommands.Count) Commands Imported" | Out-Host + $githubModule.ExportedCommands.Keys -join [Environment]::Newline | Out-Host + } | + Out-Host + "::endgroup::" | Out-Host + + $anyFilesChanged = $false + $processScriptOutput = { process { + $out = $_ + $outItem = Get-Item -Path $out -ErrorAction SilentlyContinue + $fullName, $shouldCommit = + if ($out -is [IO.FileInfo]) { + $out.FullName, (git status $out.Fullname -s) + } elseif ($outItem) { + $outItem.FullName, (git status $outItem.Fullname -s) + } + if ($shouldCommit) { + git add $fullName + if ($out.Message) { + git commit -m "$($out.Message)" + } elseif ($out.CommitMessage) { + git commit -m "$($out.CommitMessage)" + } + $anyFilesChanged = $true + } + $out + } } + + + if (-not $UserName) { $UserName = $env:GITHUB_ACTOR } + if (-not $UserEmail) { $UserEmail = "$UserName@github.com" } + git config --global user.email $UserEmail + git config --global user.name $UserName + + if (-not $env:GITHUB_WORKSPACE) { throw "No GitHub workspace" } + + git pull | Out-Host + + $PSDevOpsScriptStart = [DateTime]::Now + if ($PSDevOpsScript) { + Invoke-Expression -Command $PSDevOpsScript | + . $processScriptOutput | + Out-Host + } + $PSDevOpsScriptTook = [Datetime]::Now - $PSDevOpsScriptStart + "::set-output name=PSDevOpsScriptRuntime::$($PSDevOpsScriptTook.TotalMilliseconds)" | Out-Host + + $PSDevOpsPS1Start = [DateTime]::Now + $PSDevOpsPS1List = @() + if (-not $SkipPSDevOpsPS1) { + Get-ChildItem -Recurse -Path $env:GITHUB_WORKSPACE | + Where-Object Name -Match '\.PSDevOps\.ps1$' | + + ForEach-Object { + $PSDevOpsPS1List += $_.FullName.Replace($env:GITHUB_WORKSPACE, '').TrimStart('/') + $PSDevOpsPS1Count++ + "::notice title=Running::$($_.Fullname)" | Out-Host + . $_.FullName | + . $processScriptOutput | + Out-Host + } + } + $PSDevOpsPS1EndStart = [DateTime]::Now + $PSDevOpsPS1Took = [Datetime]::Now - $PSDevOpsPS1Start + "::set-output name=PSDevOpsPS1Count::$($PSDevOpsPS1List.Length)" | Out-Host + "::set-output name=PSDevOpsPS1Files::$($PSDevOpsPS1List -join ';')" | Out-Host + "::set-output name=PSDevOpsPS1Runtime::$($PSDevOpsPS1Took.TotalMilliseconds)" | Out-Host + if ($CommitMessage -or $anyFilesChanged) { + if ($CommitMessage) { + dir $env:GITHUB_WORKSPACE -Recurse | + ForEach-Object { + $gitStatusOutput = git status $_.Fullname -s + if ($gitStatusOutput) { + git add $_.Fullname + } + } + + git commit -m $ExecutionContext.SessionState.InvokeCommand.ExpandString($CommitMessage) + } + + + + + $checkDetached = git symbolic-ref -q HEAD + if (-not $LASTEXITCODE) { + "::notice::Pushing Changes" | Out-Host + $gitPushed = git push + "Git Push Output: $($gitPushed | Out-String)" + } else { + "::notice::Not pushing changes (on detached head)" | Out-Host + $LASTEXITCODE = 0 + exit 0 + } + } + } @Parameters + diff --git a/docs/Add-ADOAreaPath.md b/docs/Add-ADOAreaPath.md new file mode 100644 index 00000000..503c1739 --- /dev/null +++ b/docs/Add-ADOAreaPath.md @@ -0,0 +1,107 @@ + +Add-ADOAreaPath +--------------- +### Synopsis +Adds an Azure DevOps AreaPath + +--- +### Description + +Adds an Azure DevOps AreaPath. AreaPaths are used to logically group work items within a project. + +--- +### Related Links +* [Get-ADOAreaPath](Get-ADOAreaPath.md) +* [Remove-ADOAreaPath](Remove-ADOAreaPath.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Add-ADOAreaPath -Organization MyOrg -Project MyProject -AreaPath MyAreaPath +``` + +#### EXAMPLE 2 +```PowerShell +Add-ADOAreaPath -Organization MyOrg -Project MyProject -AreaPath MyAreaPath\MyNestedPath +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **Project** + +The Project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |2 |true (ByPropertyName)| +--- +#### **AreaPath** + +The AreaPath. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |3 |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |4 |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |5 |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.AreaPath + + +--- +### Syntax +```PowerShell +Add-ADOAreaPath [-Organization] [-Project] [-AreaPath] [[-Server] ] [[-ApiVersion] ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/Add-ADOAttachment.md b/docs/Add-ADOAttachment.md new file mode 100644 index 00000000..27e2a1a7 --- /dev/null +++ b/docs/Add-ADOAttachment.md @@ -0,0 +1,127 @@ + +Add-ADOAttachment +----------------- +### Synopsis +Adds an ADO Attachment + +--- +### Description + +Adds an Azure DevOps Attachment + +--- +### Related Links +* [https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands](https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Add-ADOAttachment -Path .\a.zip +``` + +#### EXAMPLE 2 +```PowerShell +Add-ADOAttachment -Path .\summary.md -IsSummary +``` + +#### EXAMPLE 3 +```PowerShell +Add-ADOAttachment -Path .\log.txt -IsLog +``` + +--- +### Parameters +#### **Path** + +The attachment path. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Name** + +The Attachment name. This is used to upload information for an Azure DevOps extension. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **Type** + +The Attachment type. This is used to upload information for an Azure DevOps extension. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |2 |true (ByPropertyName)| +--- +#### **ContainerFolder** + +The Container Folder. This is required when uploading artifacts. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **ArtifactName** + +The Artifact Name. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **IsSummary** + +If set, the upload will be treated as a summary. Summary uploads must be markdown. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **IsLog** + +If set, the upload will be treated as a log file. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +### Outputs +System.String + + +--- +### Syntax +```PowerShell +Add-ADOAttachment -Path [] +``` +```PowerShell +Add-ADOAttachment -Path -ContainerFolder -ArtifactName [] +``` +```PowerShell +Add-ADOAttachment -Path -IsLog [] +``` +```PowerShell +Add-ADOAttachment -Path -IsSummary [] +``` +```PowerShell +Add-ADOAttachment -Path [-Name] [-Type] [] +``` +--- + + diff --git a/docs/Add-ADODashboard.md b/docs/Add-ADODashboard.md new file mode 100644 index 00000000..0dbdc341 --- /dev/null +++ b/docs/Add-ADODashboard.md @@ -0,0 +1,214 @@ + +Add-ADODashboard +---------------- +### Synopsis +Creates Dashboards and Widgets + +--- +### Description + +Creates Dashboards from Azure DevOps, or Creates Widgets in a Dashboard in Azure Devops. + +--- +### Related Links +* [Get-ADODashboard](Get-ADODashboard.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Add-ADODashboard -Organization MyOrg -Project MyProject -Team MyTeam -Name MyDashboard +``` + +#### EXAMPLE 2 +```PowerShell +Get-ADODashboard -Organization MyOrg -Project MyProject -Team MyTeam | + Select-Object -First 1 | + Add-ADODashboard -Name BuildHistory -ContributionID ms.vss-dashboards-web.Microsoft.VisualStudioOnline.Dashboards.BuildHistogramWidget -ColumnSpan 2 +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The Project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Team** + +The Team. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Name** + +The name of the dashboard or widget. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Description** + +A description of the dashboard + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Widget** + +Widgets created with the dashboard. + + + +|Type |Requried|Postion|PipelineInput | +|------------------|--------|-------|---------------------| +|```[PSObject[]]```|false |named |true (ByPropertyName)| +--- +#### **DashboardID** + +The DashboardID. This dashboard will contain the new widgets. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **ContributionID** + +The ContributionID. This describes the exact extension contribution the widget will use. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Row** + +The row of the widget. + + + +|Type |Requried|Postion|PipelineInput | +|-------------|--------|-------|---------------------| +|```[Int32]```|false |named |true (ByPropertyName)| +--- +#### **Column** + +The column of the widget. + + + +|Type |Requried|Postion|PipelineInput | +|-------------|--------|-------|---------------------| +|```[Int32]```|false |named |true (ByPropertyName)| +--- +#### **RowSpan** + +The number of rows the widget should occupy. + + + +|Type |Requried|Postion|PipelineInput | +|-------------|--------|-------|---------------------| +|```[Int32]```|false |named |true (ByPropertyName)| +--- +#### **ColumnSpan** + +The number of columns the widget should occupy. + + + +|Type |Requried|Postion|PipelineInput | +|-------------|--------|-------|---------------------| +|```[Int32]```|false |named |true (ByPropertyName)| +--- +#### **Setting** + +The widget settings. Settings are specific to each widget. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[PSObject]```|false |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.Dashboard + + +PSDevOps.Widget + + +--- +### Syntax +```PowerShell +Add-ADODashboard -Organization -Project [-Team ] -Name [-Description ] [-Widget ] [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +```PowerShell +Add-ADODashboard -Organization -Project [-Team ] -Name -DashboardID -ContributionID [-Row ] [-Column ] [-RowSpan ] [-ColumnSpan ] [-Setting ] [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/Add-ADOIterationPath.md b/docs/Add-ADOIterationPath.md new file mode 100644 index 00000000..c15f592e --- /dev/null +++ b/docs/Add-ADOIterationPath.md @@ -0,0 +1,127 @@ + +Add-ADOIterationPath +-------------------- +### Synopsis +Adds an Azure DevOps IterationPath + +--- +### Description + +Adds an Azure DevOps IterationPath. IterationPaths are used to logically group work items within a project. + +--- +### Related Links +* [Get-ADOIterationPath](Get-ADOIterationPath.md) +* [Remove-ADOIterationPath](Remove-ADOIterationPath.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Add-ADOIterationPath -Organization MyOrg -Project MyProject -IterationPath MyIterationPath +``` + +#### EXAMPLE 2 +```PowerShell +Add-ADOIterationPath -Organization MyOrg -Project MyProject -IterationPath MyIterationPath\MyNestedPath +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **Project** + +The Project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |2 |true (ByPropertyName)| +--- +#### **IterationPath** + +The IterationPath. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |3 |true (ByPropertyName)| +--- +#### **StartDate** + +The start date of the iteration. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[DateTime]```|false |4 |true (ByPropertyName)| +--- +#### **EndDate** + +The end date of the iteration. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[DateTime]```|false |5 |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |6 |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |7 |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.IterationPath + + +--- +### Syntax +```PowerShell +Add-ADOIterationPath [-Organization] [-Project] [-IterationPath] [[-StartDate] ] [[-EndDate] ] [[-Server] ] [[-ApiVersion] ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/Add-ADOPicklist.md b/docs/Add-ADOPicklist.md new file mode 100644 index 00000000..68e66fe2 --- /dev/null +++ b/docs/Add-ADOPicklist.md @@ -0,0 +1,141 @@ + +Add-ADOPicklist +--------------- +### Synopsis +Creates Picklists + +--- +### Description + +Creates Picklists in Azure DevOps. + +--- +### Related Links +* [Get-ADOPicklist](Get-ADOPicklist.md) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/processes/lists/create](https://docs.microsoft.com/en-us/rest/api/azure/devops/processes/lists/create) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Add-ADOPicklist -Organization MyOrg -PicklistName TShirtSize -Item S, M, L, XL +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **PicklistName** + +The name of the picklist + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|true |named |false | +--- +#### **DateType** + +The data type of the picklist. By default, String. + + + +Valid Values: + +* Double +* Integer +* String +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **IsSuggested** + +If set, will make the items in the picklist "suggested", and allow user input. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **Item** + +A list of items. By default, these are the initial contents of the picklist. +If a PicklistID is provided, or -PicklistName already exists, will add these items to the picklist. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|true |named |true (ByPropertyName)| +--- +#### **PicklistID** + +The PicklistID of an existing picklist. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.Picklist.Detail + + +--- +### Syntax +```PowerShell +Add-ADOPicklist -Organization -PicklistName [-DateType ] [-IsSuggested] -Item [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +```PowerShell +Add-ADOPicklist -Organization [-DateType ] [-IsSuggested] -Item -PicklistID [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/Add-ADOTeam.md b/docs/Add-ADOTeam.md new file mode 100644 index 00000000..381dd718 --- /dev/null +++ b/docs/Add-ADOTeam.md @@ -0,0 +1,135 @@ + +Add-ADOTeam +----------- +### Synopsis +Gets Azure DevOps Teams + +--- +### Description + +Gets teams from Azure DevOps or TFS + +--- +### Related Links +* [Get-ADOTeam](Get-ADOTeam.md) +* [Get-ADOProject](Get-ADOProject.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Add-ADOTeam -Organization StartAutomating -Project PSDevOps -Team MyNewTeam -WhatIf +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The project name or identifier. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Team** + +The Team Name. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Description** + +The Team Description. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **UserDescriptor** + +The Security Descriptor of the User. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|true |named |false | +--- +#### **TeamDescriptor** + +The Security Descriptor of the Team. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|true |named |false | +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.Team + + +--- +### Syntax +```PowerShell +Add-ADOTeam -Organization -Project -Team [-Description ] [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +```PowerShell +Add-ADOTeam -Organization -UserDescriptor -TeamDescriptor [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/Add-ADOWiki.md b/docs/Add-ADOWiki.md new file mode 100644 index 00000000..1447cab3 --- /dev/null +++ b/docs/Add-ADOWiki.md @@ -0,0 +1,143 @@ + +Add-ADOWiki +----------- +### Synopsis +Creates Azure DevOps Wikis + +--- +### Description + +Creates Wikis in Azure DevOps. + +--- +### Related Links +* [Get-ADOWiki](Get-ADOWiki.md) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/wiki/wikis/create](https://docs.microsoft.com/en-us/rest/api/azure/devops/wiki/wikis/create) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Add-ADOWiki -Organization MyOrg -Project MyProject -Name MyWiki +``` + +#### EXAMPLE 2 +```PowerShell +Get-ADORepository -Organization MyOrg -Project MyProject | + Add-ADOWiki -Name BuildHistory +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **Project** + +The Project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |2 |true (ByPropertyName)| +--- +#### **Name** + +The name of the wiki. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |3 |true (ByPropertyName)| +--- +#### **RepositoryID** + +The ID of the repository used for the wiki. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |4 |true (ByPropertyName)| +--- +#### **WikiType** + +The type of the wiki. This can be either 'ProjectWiki' or 'CodeWiki'. +If a -RepositoryID is provided, this will be ignored as it must be a CodeWiki. + + + +Valid Values: + +* ProjectWiki +* CodeWiki +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |5 |true (ByPropertyName)| +--- +#### **RootPath** + +The root path of the wiki within the repository. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |6 |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |7 |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |8 |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.Wiki + + +--- +### Syntax +```PowerShell +Add-ADOWiki [-Organization] [-Project] [-Name] [[-RepositoryID] ] [[-WikiType] ] [[-RootPath] ] [[-Server] ] [[-ApiVersion] ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/Add-Git.md b/docs/Add-Git.md new file mode 100644 index 00000000..ef78c297 --- /dev/null +++ b/docs/Add-Git.md @@ -0,0 +1,185 @@ + +Add-Git +------- +### Synopsis +PowerShell wrapper around git add + +--- +### Description + +Adds changes to a git changelist + +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Add-Git AddGit.ps1 +``` + +--- +### Parameters +#### **Path** + +The path to add to git. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **DryRun** + +Don't actually add the file(s), just show if they exist and/or will +be ignored. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Force** + +Allow adding otherwise ignored files. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Interactive** + +Add modified contents in the working tree interactively to +the index. Optional path arguments may be supplied to limit +operation to a subset of the working tree. See Interactive +mode for details. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Patch** + +Interactively choose hunks of patch between the index and the +work tree and add them to the index. This gives the user a chance +to review the difference before adding modified contents to the +index. + +This effectively runs add --interactive, but bypasses the +initial command menu and directly jumps to the patch subcommand. +See 'Interactive mode' for details. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Edit** + +Open the diff vs. the index in an editor and let the user +edit it. After the editor was closed, adjust the hunk headers +and apply the patch to the index. + +The intent of this option is to pick and choose lines of the patch to +apply, or even to modify the contents of lines to be staged. This can be +quicker and more flexible than using the interactive hunk selector. +However, it is easy to confuse oneself and create a patch that does not +apply to the index. See EDITING PATCHES below. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **IntentToAdd** + +Record only the fact that the path will be added later. An entry +for the path is placed in the index with no content. This is +useful for, among other things, showing the unstaged content of +such files with git diff and committing them with git commit +-a. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Refresh** + +Don't add the file(s), but only refresh their stat() +information in the index. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **IgnoreErrors** + +If some files could not be added because of errors indexing +them, do not abort the operation, but continue adding the +others. The command shall still exit with non-zero status. +The configuration variable add.ignoreErrors can be set to +true to make this the default behaviour. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **IgnoreMissing** + +This option can only be used together with --dry-run. By using +this option the user can check if any of the given files would +be ignored, no matter if they are already present in the work +tree or not. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Renormalize** + +Apply the "clean" process freshly to all tracked files to +forcibly add them again to the index. This is useful after +changing core.autocrlf configuration or the text attribute +in order to correct files added with wrong CRLF/LF line endings. +This option implies -u. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Syntax +```PowerShell +Add-Git [-Path ] [-DryRun] [-Force] [-Interactive] [-Patch] [-Edit] [-IntentToAdd] [-Refresh] [-IgnoreErrors] [-IgnoreMissing] [-Renormalize] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/Clear-ADODashboard.md b/docs/Clear-ADODashboard.md new file mode 100644 index 00000000..5e57bce4 --- /dev/null +++ b/docs/Clear-ADODashboard.md @@ -0,0 +1,130 @@ + +Clear-ADODashboard +------------------ +### Synopsis +Clears Azure DevOps Dashboards + +--- +### Description + +Clears Azure DevOps Dashboards, and Clears settings of Widgets on a dashboard. + +--- +### Related Links +* [Get-ADODashboard](Get-ADODashboard.md) +* [Remove-ADODashboard](Remove-ADODashboard.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOTeam -Organization MyOrganization -PersonalAccessToken $pat | + Get-ADODashboard | + Clear-ADODashboard +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The Project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Team** + +The Team. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **DashboardID** + +The DashboardID + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **WidgetID** + +The WidgetID. If provided, will get details about a given Azure DevOps Widget. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.Dashboard + + +PSDevOps.Widget + + +--- +### Syntax +```PowerShell +Clear-ADODashboard -Organization -Project [-Team ] -DashboardID -WidgetID [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +```PowerShell +Clear-ADODashboard -Organization -Project [-Team ] -DashboardID [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/Connect-ADO.md b/docs/Connect-ADO.md new file mode 100644 index 00000000..4882f3a8 --- /dev/null +++ b/docs/Connect-ADO.md @@ -0,0 +1,90 @@ + +Connect-ADO +----------- +### Synopsis +Connects to Azure DeVOps + +--- +### Description + +Connects the current PowerShell session to Azure DeVOps or a Team Foundation Server. + +Information passed to Connect-ADO will be used as the default parameters to all -ADO* commands from PSDevOps. + +PersonalAccessTokens will be cached separately to improve security. + +--- +### Related Links +* [Disconnect-ADO](Disconnect-ADO.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Connect-ADO -Organization StartAutomating -PersonalAccessToken $myPat +``` + +--- +### Parameters +#### **Organization** + +The organization. +When connecting to TFS, this is the Project Collection. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **PersonalAccessToken** + +The Personal Access Token. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |2 |true (ByPropertyName)| +--- +#### **UseDefaultCredentials** + +If set, will use default credentials when connecting. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Credential** + +The credential used to connect. + + + +|Type |Requried|Postion|PipelineInput | +|--------------------|--------|-------|---------------------| +|```[PSCredential]```|false |3 |true (ByPropertyName)| +--- +#### **Server** + +The Server. If this points to a TFS server, it should be the root TFS url, i.e. http://localhost:8080/tfs + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |4 |true (ByPropertyName)| +--- +### Outputs +PSDevOps.Connection + + +--- +### Syntax +```PowerShell +Connect-ADO [-Organization] [[-PersonalAccessToken] ] [-UseDefaultCredentials] [[-Credential] ] [[-Server] ] [] +``` +--- + + diff --git a/docs/Connect-GitHub.md b/docs/Connect-GitHub.md new file mode 100644 index 00000000..4086b67c --- /dev/null +++ b/docs/Connect-GitHub.md @@ -0,0 +1,100 @@ + +Connect-GitHub +-------------- +### Synopsis +Connects to GitHub + +--- +### Description + +Connects to GitHub, automatically creating smart aliases for all GitHub URLs. + +--- +### Related Links +* [Invoke-GitHubRESTAPI](Invoke-GitHubRESTAPI.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Connect-GitHub +``` + +--- +### Parameters +#### **GitHubOpenAPIUrl** + +A URL that contains the GitHub OpenAPI definition + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |1 |true (ByPropertyName)| +--- +#### **PassThru** + +If set, will output the dynamically imported module. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **Force** + +If set, will force a reload of the module. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **PersonalAccessToken** + +The personal access token used to connect to GitHub. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |2 |true (ByPropertyName)| +--- +#### **Owner** + +If provided, will default the [owner] in GitHub API requests + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |3 |false | +--- +#### **UserName** + +If provided, will default the [username] in GitHub API requests + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |4 |false | +--- +#### **Repo** + +If provided, will default the [repo] in GitHub API requests + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |5 |false | +--- +### Syntax +```PowerShell +Connect-GitHub [[-GitHubOpenAPIUrl] ] [-PassThru] [-Force] [[-PersonalAccessToken] ] [[-Owner] ] [[-UserName] ] [[-Repo] ] [] +``` +--- + + diff --git a/docs/Convert-ADOPipeline.md b/docs/Convert-ADOPipeline.md new file mode 100644 index 00000000..313708d7 --- /dev/null +++ b/docs/Convert-ADOPipeline.md @@ -0,0 +1,94 @@ + +Convert-ADOPipeline +------------------- +### Synopsis +Converts builds to Azure DevOps Pipelines + +--- +### Description + +Converts builds TFS or "Classic" builds to Azure DevOps YAML Pipelines. + +--- +### Related Links +* [New-ADOPipeline](New-ADOPipeline.md) +* [Get-ADOTask](Get-ADOTask.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +$taskList = (Get-ADOTask -Server $tfsRootUrl -Org $projectCollectionName) +Get-ADOBuild -Definition -Server $tfsRootUrl -Org $projectCollection | + Convert-ADOPipeline -TaskList $taskList +``` + +--- +### Parameters +#### **BuildStep** + +A list of build steps. +This will be automatically populated when piping in a TFS Build definition. + + + +|Type |Requried|Postion|PipelineInput | +|------------------|--------|-------|---------------------| +|```[PSObject[]]```|true |1 |true (ByPropertyName)| +--- +#### **BuildVariable** + +An object containing build variables. +This will be automatically populated when piping in a TFS build definition. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[PSObject]```|false |2 |true (ByPropertyName)| +--- +#### **TaskList** + +A list of task definitions. This will normally be the output from Get-ADOTask. + + + +|Type |Requried|Postion|PipelineInput| +|------------------|--------|-------|-------------| +|```[PSObject[]]```|true |3 |false | +--- +#### **WhereFore** + +A dictionary of conditional transformations. + + + +|Type |Requried|Postion|PipelineInput| +|-------------------|--------|-------|-------------| +|```[IDictionary]```|false |4 |false | +--- +#### **Passthru** + +If set, will output the dictionary used to create each pipeline. +If not set, will output the pipeline YAML. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +### Outputs +System.String + + +System.Management.Automation.PSObject + + +--- +### Syntax +```PowerShell +Convert-ADOPipeline [-BuildStep] [[-BuildVariable] ] [-TaskList] [[-WhereFore] ] [-Passthru] [] +``` +--- + + diff --git a/docs/Convert-BuildStep.md b/docs/Convert-BuildStep.md new file mode 100644 index 00000000..399f0728 --- /dev/null +++ b/docs/Convert-BuildStep.md @@ -0,0 +1,180 @@ + +Convert-BuildStep +----------------- +### Synopsis +Converts Build Steps into build system input + +--- +### Description + +Converts Build Steps defined in a PowerShell script into build steps in a build system + +--- +### Related Links +* [Import-BuildStep](Import-BuildStep.md) +* [Expand-BuildStep](Expand-BuildStep.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-Command Convert-BuildStep | Convert-BuildStep +``` + +--- +### Parameters +#### **Name** + +The name of the build step + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **ScriptBlock** + +The Script Block that will be converted into a build step + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|------------------------------| +|```[ScriptBlock]```|false |named |true (ByValue, ByPropertyName)| +--- +#### **Module** + +The module that -ScriptBlock is declared in. If piping in a command, this will be bound automatically + + + +|Type |Requried|Postion|PipelineInput | +|--------------------|--------|-------|---------------------| +|```[PSModuleInfo]```|false |named |true (ByPropertyName)| +--- +#### **Path** + +The path to the file + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Extension** + +The extension of the file + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **InputParameter** + +The name of parameters that should be supplied from event input. +Wildcards accepted. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **VariableParameter** + +The name of parameters that should be supplied from build variables. +Wildcards accepted. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **EnvironmentParameter** + +The name of parameters that should be supplied from the environment. +Wildcards accepted. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **UniqueParameter** + +The name of parameters that should be referred to uniquely. +For instance, if converting function foo($bar) {} and -UniqueParameter is 'bar' +The build parameter would be foo_bar. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **ExcludeParameter** + +The name of parameters that should be excluded. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **DefaultParameter** + +Default parameters for a build step + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **BuildSystem** + +The build system. Currently supported options, ADO and GitHub. Defaulting to ADO. + + + +Valid Values: + +* ADOPipeline +* ADOExtension +* GitHubWorkflow +* GitHubAction +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **BuildOption** + +Options for the build system. The can contain any additional parameters passed to the build system. + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[PSObject]```|false |named |false | +--- +### Outputs +System.Collections.IDictionary + + +--- +### Syntax +```PowerShell +Convert-BuildStep -Name [-ScriptBlock ] [-Module ] [-Path ] [-InputParameter ] [-VariableParameter ] [-EnvironmentParameter ] [-UniqueParameter ] [-ExcludeParameter ] [-DefaultParameter ] [-BuildSystem ] [-BuildOption ] [] +``` +```PowerShell +Convert-BuildStep -Name -Path -Extension [-InputParameter ] [-VariableParameter ] [-EnvironmentParameter ] [-UniqueParameter ] [-ExcludeParameter ] [-DefaultParameter ] [-BuildSystem ] [-BuildOption ] [] +``` +--- + + diff --git a/docs/Disable-ADOExtension.md b/docs/Disable-ADOExtension.md new file mode 100644 index 00000000..a3c85b03 --- /dev/null +++ b/docs/Disable-ADOExtension.md @@ -0,0 +1,102 @@ + +Disable-ADOExtension +-------------------- +### Synopsis +Disables Azure DevOps Extensions. + +--- +### Description + +Disables one or more Azure DevOps Extensions. + +--- +### Related Links +* [Get-ADOExtension](Get-ADOExtension.md) +* [Enable-ADOExtension](Enable-ADOExtension.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Disable-ADOExtension -Organization StartAutomating -PublisherID ms-samples -ExtensionID samples-contributions-guide +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **PublisherID** + +The Publisher of an Extension. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |2 |true (ByPropertyName)| +--- +#### **ExtensionID** + +The name of the Extension. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |3 |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |4 |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |5 |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.InstalledExtension + + +--- +### Syntax +```PowerShell +Disable-ADOExtension [-Organization] [-PublisherID] [-ExtensionID] [[-Server] ] [[-ApiVersion] ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/Disconnect-ADO.md b/docs/Disconnect-ADO.md new file mode 100644 index 00000000..7e7e7bc3 --- /dev/null +++ b/docs/Disconnect-ADO.md @@ -0,0 +1,51 @@ + +Disconnect-ADO +-------------- +### Synopsis +Disconnects from Azure DevOps + +--- +### Description + +Disconnects from Azure DevOps, clearing parameter value defaults and cached access tokens. + +--- +### Related Links +* [Connect-ADO](Connect-ADO.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Disconnect-ADO +``` + +--- +### Parameters +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +System.Nullable + + +System.Management.Automation.PSObject + + +--- +### Syntax +```PowerShell +Disconnect-ADO [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/Disconnect-GitHub.md b/docs/Disconnect-GitHub.md new file mode 100644 index 00000000..0eab1c7d --- /dev/null +++ b/docs/Disconnect-GitHub.md @@ -0,0 +1,31 @@ + +Disconnect-GitHub +----------------- +### Synopsis +Disconnects from GitHub + +--- +### Description + +Disconnects from GitHub. + +This unloads any dynamically imported commands and clears the cached PersonalAccessToken. + +--- +### Related Links +* [Connect-GitHub](Connect-GitHub.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Disconnect-GitHub +``` + +--- +### Syntax +```PowerShell +Disconnect-GitHub [] +``` +--- + + diff --git a/docs/Enable-ADOExtension.md b/docs/Enable-ADOExtension.md new file mode 100644 index 00000000..05b9ac96 --- /dev/null +++ b/docs/Enable-ADOExtension.md @@ -0,0 +1,102 @@ + +Enable-ADOExtension +------------------- +### Synopsis +Enables Azure DevOps Extensions. + +--- +### Description + +Enables one or more Azure DevOps Extensions. + +--- +### Related Links +* [Get-ADOExtension](Get-ADOExtension.md) +* [Disable-ADOExtension](Disable-ADOExtension.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Enable-ADOExtension -Organization StartAutomating -PublisherID ms-samples -ExtensionID samples-contributions-guide +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **PublisherID** + +The Publisher of an Extension. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |2 |true (ByPropertyName)| +--- +#### **ExtensionID** + +The name of the Extension. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |3 |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |4 |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |5 |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.InstalledExtension + + +--- +### Syntax +```PowerShell +Enable-ADOExtension [-Organization] [-PublisherID] [-ExtensionID] [[-Server] ] [[-ApiVersion] ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/Expand-BuildStep.md b/docs/Expand-BuildStep.md new file mode 100644 index 00000000..1c245247 --- /dev/null +++ b/docs/Expand-BuildStep.md @@ -0,0 +1,199 @@ + +Expand-BuildStep +---------------- +### Synopsis +Expands Build Steps in a single build object + +--- +### Description + +Component Files are .ps1 or datafiles within a directory that tells you what type they are. + +--- +### Related Links +* [Convert-BuildStep](Convert-BuildStep.md) +* [Import-BuildStep](Import-BuildStep.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Expand-BuildStep -StepMap @{Steps='InstallPester','RunPester'} +``` + +--- +### Parameters +#### **StepMap** + +A map of step properties to underlying data. +Each key is the name of a property the output. +Each value may contain the name of another Step or StepMap + + + +|Type |Requried|Postion|PipelineInput| +|-------------------|--------|-------|-------------| +|```[IDictionary]```|true |1 |false | +--- +#### **Parent** + +The immediate parent object + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[PSObject]```|false |2 |false | +--- +#### **Root** + +The absolute root object + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[PSObject]```|false |3 |false | +--- +#### **Singleton** + +If set, the component will be expanded as a singleton (single object) + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **SingleItemName** + +A list of item names that automatically become singletons + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[String[]]```|false |4 |false | +--- +#### **PluralItemName** + +A list of item names that automatically become plurals + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[String[]]```|false |5 |false | +--- +#### **DictionaryItemName** + +A list of item names that automatically become dictionaries. + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[String[]]```|false |6 |false | +--- +#### **BuildSystem** + +The build system, either ADO or GitHub. + + + +Valid Values: + +* ADOPipeline +* ADOExtension +* GitHubWorkflow +* GitHubAction +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |7 |false | +--- +#### **VariableParameter** + +The name of parameters that should be supplied from build variables. +Wildcards accepted. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |8 |true (ByPropertyName)| +--- +#### **InputParameter** + +The name of parameters that should be supplied from webhook events. +Wildcards accepted. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |9 |true (ByPropertyName)| +--- +#### **EnvironmentParameter** + +The name of parameters that should be supplied from the environment. +Wildcards accepted. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |10 |true (ByPropertyName)| +--- +#### **UniqueParameter** + +The name of parameters that should be referred to uniquely. +For instance, if converting function foo($bar) {} and -UniqueParameter is 'bar' +The build parameter would be foo_bar. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |11 |true (ByPropertyName)| +--- +#### **ExcludeParameter** + +The name of parameters that should be excluded. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |12 |true (ByPropertyName)| +--- +#### **DefaultParameter** + +A collection of default parameters. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |13 |true (ByPropertyName)| +--- +#### **BuildOption** + +Options for the build system. The can contain any additional parameters passed to the build system. + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[PSObject]```|false |14 |false | +--- +### Outputs +System.Management.Automation.PSObject + + +--- +### Syntax +```PowerShell +Expand-BuildStep [-StepMap] [[-Parent] ] [[-Root] ] [-Singleton] [[-SingleItemName] ] [[-PluralItemName] ] [[-DictionaryItemName] ] [[-BuildSystem] ] [[-VariableParameter] ] [[-InputParameter] ] [[-EnvironmentParameter] ] [[-UniqueParameter] ] [[-ExcludeParameter] ] [[-DefaultParameter] ] [[-BuildOption] ] [] +``` +--- + + diff --git a/docs/Get-ADOAgentPool.md b/docs/Get-ADOAgentPool.md new file mode 100644 index 00000000..00cb9a56 --- /dev/null +++ b/docs/Get-ADOAgentPool.md @@ -0,0 +1,142 @@ + +Get-ADOAgentPool +---------------- +### Synopsis +Gets Azure DevOps Agent Pools + +--- +### Description + +Gets Agent Pools and their associated queues from Azure DevOps. + +Queues associate a given project with a pool. +Pools are shared by organization. + +Thus providing a project will return the queues associated with the project, +and just providing the organization will return all of the common pools. + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/pools/get%20agent%20pools](https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/pools/get%20agent%20pools) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/queues/get%20agent%20queues](https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/queues/get%20agent%20queues) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/agents/list](https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/agents/list) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOAgentPool -Organization MyOrganization -PersonalAccessToken $pat +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **PoolID** + +The Pool ID. When this is provided, will return agents associated with a given pool ID. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **AgentName** + +If provided, will return agents of a given name. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **IncludeCapability** + +If set, will return the capabilities of each returned agent. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **IncludeLastCompletedRequest** + +If set, will return the last completed request of each returned agent. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **IncludeAssignedRequest** + +If set, will return the requests queued for an agent. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Project** + +The project name or identifier. When this is provided, will return queues associated with the project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevops.Pool + + +--- +### Syntax +```PowerShell +Get-ADOAgentPool -Organization -PoolID [-AgentName ] [-IncludeCapability] [-IncludeLastCompletedRequest] [-IncludeAssignedRequest] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOAgentPool -Organization -Project [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOAgentPool -Organization [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOAreaPath.md b/docs/Get-ADOAreaPath.md new file mode 100644 index 00000000..cdb3efc7 --- /dev/null +++ b/docs/Get-ADOAreaPath.md @@ -0,0 +1,100 @@ + +Get-ADOAreaPath +--------------- +### Synopsis +Gets area paths + +--- +### Description + +Get area paths from Azure DevOps + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/Classification%20Nodes/Get%20Classification%20Nodes?view=azure-devops-rest-5.1#get-the-root-area-tree](https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/Classification%20Nodes/Get%20Classification%20Nodes?view=azure-devops-rest-5.1#get-the-root-area-tree) +* [Add-ADOAreaPath](Add-ADOAreaPath.md) +* [Remove-ADOAreaPath](Remove-ADOAreaPath.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOAreaPath -Organization StartAutomating -Project PSDevOps +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **Project** + +The project name or identifier. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |2 |true (ByPropertyName)| +--- +#### **AreaPath** + +The AreaPath + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |3 |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |4 |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 2.0. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |5 |false | +--- +#### **Depth** + +The depth of items to get. By default, one. + + + +|Type |Requried|Postion|PipelineInput| +|-------------|--------|-------|-------------| +|```[Int32]```|false |6 |false | +--- +### Outputs +PSDevOps.AreaPath + + +--- +### Syntax +```PowerShell +Get-ADOAreaPath [-Organization] [-Project] [[-AreaPath] ] [[-Server] ] [[-ApiVersion] ] [[-Depth] ] [] +``` +--- + + diff --git a/docs/Get-ADOArtifactFeed.md b/docs/Get-ADOArtifactFeed.md new file mode 100644 index 00000000..3ff2ebdb --- /dev/null +++ b/docs/Get-ADOArtifactFeed.md @@ -0,0 +1,343 @@ + +Get-ADOArtifactFeed +------------------- +### Synopsis +Gets artifact feeds from Azure DevOps + +--- +### Description + +Gets artifact feeds from Azure DevOps. Artifact feeds can be used to publish packages. + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/artifacts/feed%20%20management/get%20feeds?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/artifacts/feed%20%20management/get%20feeds?view=azure-devops-rest-5.1) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOArtifactFeed -Organization myOrganization -Project MyProject +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The Project + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **FeedID** + +The name or ID of the feed. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **View** + +If set, will Get Artifact Feed Views + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Permission** + +If set, will get artifact permissions + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **RetentionPolicy** + +If set, will get artifact retention policies + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **PackageVersionList** + +If set, will list versions of a particular package. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Provenance** + +If set, will get provenance for a package version + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **VersionID** + +A package version ID. Only required when getting version provenance. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **PackageList** + +If set, will list packages within a feed. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **IncludeAllVersion** + +If set, will include all versions of packages within a feed. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **IncludeDescription** + +If set, will include descriptions of a package. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **ProtocolType** + +If provided, will return packages of a given protocol. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **NPM** + +If set, will get information about a Node Package Manager module. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **NuGet** + +If set, will get information about a Nuget module. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Python** + +If set, will get information about a Python module. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Universal** + +If set, will get information about a Universal package module. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **PackageName** + +The Package Name. Must be used with -NPM, -NuGet, -Python, or -Universal. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **PackageVersion** + +The Package Version. Must be used with -NPM, -NuGet, -Python, or -Universal. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **FeedRole** + +The Feed Role + + + +Valid Values: + +* Administrator +* Collaborator +* Contributor +* Reader +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **PackageID** + +A -PackageID. This can be used to get Packages -Metrics, -ListPackageVersion, or get -Provenance of a particular version. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Metric** + +If set, will get package metrics. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **IncludeDeleted** + +If set, will include deleted feeds. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **Change** + +If set, will get changes in artifact feeds. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **Server** + +The server. By default https://feeds.dev.azure.com/. + + + +|Type |Requried|Postion|PipelineInput| +|-----------|--------|-------|-------------| +|```[Uri]```|false |named |false | +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.ArtfiactFeed + + +PSDevOps.ArtfiactFeed.View + + +PSDevOps.ArtfiactFeed.Change + + +--- +### Syntax +```PowerShell +Get-ADOArtifactFeed -Organization [-Project ] [-FeedID ] [-IncludeDeleted] [-Change] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOArtifactFeed -Organization [-Project ] [-FeedID ] -View [-IncludeDeleted] [-Change] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOArtifactFeed -Organization [-Project ] [-FeedID ] -Permission [-IncludeDeleted] [-Change] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOArtifactFeed -Organization [-Project ] [-FeedID ] -RetentionPolicy [-IncludeDeleted] [-Change] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOArtifactFeed -Organization [-Project ] [-FeedID ] -PackageVersionList [-IncludeDeleted] [-Change] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOArtifactFeed -Organization [-Project ] [-FeedID ] -Provenance -VersionID [-IncludeDeleted] [-Change] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOArtifactFeed -Organization [-Project ] [-FeedID ] -PackageList [-IncludeAllVersion] [-IncludeDescription] [-ProtocolType ] [-PackageName ] [-IncludeDeleted] [-Change] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOArtifactFeed -Organization [-Project ] [-FeedID ] -NPM -PackageName -PackageVersion [-IncludeDeleted] [-Change] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOArtifactFeed -Organization [-Project ] [-FeedID ] -NuGet -PackageName -PackageVersion [-IncludeDeleted] [-Change] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOArtifactFeed -Organization [-Project ] [-FeedID ] -Python -PackageName -PackageVersion [-IncludeDeleted] [-Change] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOArtifactFeed -Organization [-Project ] [-FeedID ] -Universal -PackageName -PackageVersion [-IncludeDeleted] [-Change] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOArtifactFeed -Organization [-Project ] [-FeedID ] [-FeedRole ] [-IncludeDeleted] [-Change] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOArtifactFeed -Organization [-Project ] [-FeedID ] -PackageID -Metric [-IncludeDeleted] [-Change] [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOBuild.md b/docs/Get-ADOBuild.md new file mode 100644 index 00000000..291279fe --- /dev/null +++ b/docs/Get-ADOBuild.md @@ -0,0 +1,472 @@ + +Get-ADOBuild +------------ +### Synopsis +Gets Azure DevOps Builds, Definitions, and associated information. + +--- +### Description + +Gets Azure DevOps Builds or Definitions and associated information. + +Gets builds by default. To get build definitions, use -Definition + +Given a -BuildID, we can can get associated information: + +|Parameter | Effect | +|----------|----------------------------------------------| +|-Artfiact | Get a list of all build artifacts | +|-ChangeSet | Get the build's associated changeset | +|-Log | Get a list of all build logs | +|-LogID | Get the content of a specific LogID | +|-Timeline | Gets the build timeline | +|-BuildMetaData | Returns system metadata about the build | + +Given a -Definition ID, we can get associated information: + +|Parameter | Effect | +|----------|--------------------------------------------------| +|-Status | Gets the status of the build definition | +|-Metric | Gets metrics about the build definition | +|-Revision | Gets the revisions of a build definition| +|-DefinitionMetadata| Gets metadata about a build definition | + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/get?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/get?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/build/artifacts/list?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/build/artifacts/list?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/get%20build%20logs?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/get%20build%20logs?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/build/timeline/get?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/build/timeline/get?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/build/properties/get%20build%20properties?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/build/properties/get%20build%20properties?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/build/definitions/get?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/build/definitions/get?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/build/properties/get%20definition%20properties?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/build/properties/get%20definition%20properties?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/build/metrics/get%20definition%20metrics?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/build/metrics/get%20definition%20metrics?view=azure-devops-rest-5.1) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOBuild -Organization StartAutomating -Project PSDevOps +``` + +#### EXAMPLE 2 +```PowerShell +Get-ADOBuild -Organization StartAutomating -Project PSDevOps -Definition +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The Project + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://feeds.dev.azure.com/. + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **BuildID** + +Build ID + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Detail** + +If set + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **BuildMetadata** + +If set, returns system metadata about the -BuildID. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Artifact** + +If set, will get artifacts from -BuildID. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Log** + +If set, will get a list of logs associated with -BuildID + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **LogID** + +If provided, will retreive the specific log content of -BuildID + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **ChangeSet** + +If set, will return the changeset associated with the build -BuildID. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Report** + +If set, will return the build report associated with -BuildID. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Timeline** + +If set, will return the timeline for build -BuildID + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **CodeCoverage** + +If set, will return the code coverage associated with -BuildID + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Definition** + +If set, will get build definitions. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **DefinitionID** + +If set, will get a specific build by definition ID + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Status** + +If set, will get the status of a defined build. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **DefinitionMetadata** + +If set, will get definition properties + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Revision** + +If set, will get revisions to a build definition. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Resource** + +If set, will get authorized resources for a build definition. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Metric** + +If set, will get metrics about a build definition. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **First** + +If provided, will get the first N builds or build definitions + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[UInt32]```|false |named |false | +--- +#### **BranchName** + +If provided, will only return builds for a given branch. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **Tag** + +If provided, will only return builds one of these tags. + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[String[]]```|false |named |false | +--- +#### **After** + +If provided, will only return builds queued after this point in time. + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[DateTime]```|false |named |false | +--- +#### **Before** + +If provided, will only return builds queued before this point in time. + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[DateTime]```|false |named |false | +--- +#### **BuildResult** + +If provided, will only return builds with this result. + + + +Valid Values: + +* Canceled +* Failed +* None +* Succeeded +* PartiallySucceeded +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **DefinitionName** + +Will only return build definitions with the specified name. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **BuiltAfter** + +If provided, will only return build definitions that have been built after this date. + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[DateTime]```|false |named |false | +--- +#### **NotBuiltSince** + +If provided, will only return build definitions that have not been built since this date. + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[DateTime]```|false |named |false | +--- +#### **IncludeAllProperty** + +If set, will return extended properities of a build definition. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **IncludeLatestBuild** + +If set, will include the latest build and latest completed build in a given build definition. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **DefinitionYAML** + +If provided, will return build definition YAML. No other information will be returned. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +### Outputs +PSDevOps.Build + + +PSDevOps.Build.Definition + + +PSDevOps.Build.Timeline + + +PSDevOps.Build.Change + + +PSDevOps.Build.Report + + +PSDevOps.Build.Artifact + + +PSDevOps.Build.CodeCoverage + + +--- +### Syntax +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] [-First ] [-BranchName ] [-Tag ] [-After ] [-Before ] [-BuildResult ] [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -BuildID -CodeCoverage [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -BuildID -Report [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -BuildID -Timeline [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -BuildID -Artifact [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -BuildID -ChangeSet [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -BuildID -LogID [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -BuildID -Log [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -BuildID -BuildMetadata [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -BuildID [-Detail] [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -Definition [-First ] [-DefinitionName ] [-BuiltAfter ] [-NotBuiltSince ] [-IncludeAllProperty] [-IncludeLatestBuild] [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -DefinitionID -Resource [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -DefinitionID -Status [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -DefinitionID -Revision [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -DefinitionID -Metric [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -DefinitionID -DefinitionMetadata [] +``` +```PowerShell +Get-ADOBuild -Organization -Project [-Server ] [-ApiVersion ] -DefinitionID [-DefinitionYAML] [] +``` +--- + + diff --git a/docs/Get-ADODashboard.md b/docs/Get-ADODashboard.md new file mode 100644 index 00000000..091e34b1 --- /dev/null +++ b/docs/Get-ADODashboard.md @@ -0,0 +1,131 @@ + +Get-ADODashboard +---------------- +### Synopsis +Gets Azure DevOps Dashboards + +--- +### Description + +Gets Azure DevOps Team Dashboards and Widgets within a dashboard. + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/dashboard/dashboards/list](https://docs.microsoft.com/en-us/rest/api/azure/devops/dashboard/dashboards/list) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOTeam -Organization MyOrganization -PersonalAccessToken $pat | + Get-ADODashboard +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The Project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Team** + +The Team. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **DashboardID** + +The DashboardID + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Widget** + +If set, will widgets within a dashboard. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **WidgetID** + +The WidgetID. If provided, will get details about a given Azure DevOps Widget. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.Dashboard + + +PSDevOps.Widget + + +--- +### Syntax +```PowerShell +Get-ADODashboard -Organization -Project [-Team ] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADODashboard -Organization -Project [-Team ] -DashboardID -WidgetID [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADODashboard -Organization -Project [-Team ] -DashboardID -Widget [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADODashboard -Organization -Project [-Team ] -DashboardID [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOExtension.md b/docs/Get-ADOExtension.md new file mode 100644 index 00000000..89f479b6 --- /dev/null +++ b/docs/Get-ADOExtension.md @@ -0,0 +1,238 @@ + +Get-ADOExtension +---------------- +### Synopsis +Gets Azure DevOps Extensions + +--- +### Description + +Gets Extensions to Azure DevOps. + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/extensionmanagement/installed%20extensions/list?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/extensionmanagement/installed%20extensions/list?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/extensionmanagement/installed%20extensions/get?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/extensionmanagement/installed%20extensions/get?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/azure/devops/extend/develop/data-storage?view=azure-devops#how-settings-are-stored](https://docs.microsoft.com/en-us/azure/devops/extend/develop/data-storage?view=azure-devops#how-settings-are-stored) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOExtension -Organization StartAutomating +``` + +--- +### Parameters +#### **Organization** + +The organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **ExtensionNameLike** + +A wildcard of the extension name. Only extensions where the Extension Name or ID matches the wildcard will be returned. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **ExtensionNameMatch** + +A regular expression of the extension name. Only extensions where the Extension Name or ID matches the wildcard will be returned. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **PublisherNameLike** + +A wildcard of the publisher name. Only extensions where the Publisher Name or ID matches the wildcard will be returned. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **PublisherNameMatch** + +A regular expression of the publisher name. Only extensions where the Publisher Name or ID matches the wildcard will be returned. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **PublisherID** + +The Publisher of the Extension. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **ExtensionID** + +The Extension Identifier. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **DataCollection** + +The data collection + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **DataID** + +The data identifier + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **ScopeType** + +The scope type. By default, the value "default" (which maps to Project Collection) + + + +Valid Values: + +* Default +* Project +* User +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **ScopeModifier** + +The scope modifier. By default, the value "current" (which maps to the current project collection or project) + + + +Valid Values: + +* Current +* Me +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **AssetType** + +A list of asset types + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[String[]]```|false |named |false | +--- +#### **IncludeDisabled** + +If set, will include disabled extensions + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **InstallationIssue** + +If set, will include extension installation issues + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **IncludeError** + +If set, will include errors + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **Contribution** + +If set, will expand contributions. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.InstalledExtension + + +--- +### Syntax +```PowerShell +Get-ADOExtension -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOExtension -Organization [-ExtensionNameLike ] [-ExtensionNameMatch ] [-PublisherNameLike ] [-PublisherNameMatch ] [-AssetType ] [-IncludeDisabled] [-InstallationIssue] [-IncludeError] [-Contribution] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOExtension -Organization [-ExtensionNameLike ] [-ExtensionNameMatch ] [-PublisherNameLike ] [-PublisherNameMatch ] -PublisherID -ExtensionID [-AssetType ] [-IncludeDisabled] [-InstallationIssue] [-IncludeError] [-Contribution] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOExtension -Organization -PublisherID -ExtensionID -DataCollection [-DataID ] [-ScopeType ] [-ScopeModifier ] [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOField.md b/docs/Get-ADOField.md new file mode 100644 index 00000000..5a6051ab --- /dev/null +++ b/docs/Get-ADOField.md @@ -0,0 +1,123 @@ + +Get-ADOField +------------ +### Synopsis +Gets fields from Azure DevOps + +--- +### Description + +Gets fields from Azure DevOps or Team Foundation Server. + +--- +### Related Links +* [New-ADOField](New-ADOField.md) +* [Remove-ADOField](Remove-ADOField.md) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/fields/list](https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/fields/list) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOField -Organization StartAutomating -Project PSDevOps +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The Project + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **FieldName** + +The name of the field. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **ProcessID** + +The processs identifier. This is used to get field information related to a particular work process template. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **WorkItemTypeName** + +The name of the work item type. This is used to get field information related to a particular work process template. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **Force** + +If set, will force a refresh of the cached results. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.Field + + +--- +### Syntax +```PowerShell +Get-ADOField -Organization [-Project ] [-FieldName ] [-Server ] [-Force] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOField -Organization [-Project ] [-FieldName ] -ProcessID -WorkItemTypeName [-Server ] [-Force] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOIdentity.md b/docs/Get-ADOIdentity.md new file mode 100644 index 00000000..3c5d0255 --- /dev/null +++ b/docs/Get-ADOIdentity.md @@ -0,0 +1,138 @@ + +Get-ADOIdentity +--------------- +### Synopsis +Gets Azure DevOps Identities + +--- +### Description + +Gets Identities from Azure Devops. Identities can be either users or groups. + +--- +### Related Links +* [Get-ADOUser](Get-ADOUser.md) +* [Get-ADOTeam](Get-ADOTeam.md) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/ims/identities/read%20identities](https://docs.microsoft.com/en-us/rest/api/azure/devops/ims/identities/read%20identities) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOIdentity -Organization StartAutomating -Filter 'GitHub' +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **AceDictionary** + +A dictionary of Access Control Entries + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[PSObject]```|false |2 |true (ByPropertyName)| +--- +#### **Descriptors** + +A list of descriptors + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |3 |true (ByPropertyName)| +--- +#### **DescriptorBatchSize** + +The maximum number of specific descriptors to request in one batch. + + + +|Type |Requried|Postion|PipelineInput| +|-------------|--------|-------|-------------| +|```[Int32]```|false |4 |false | +--- +#### **Membership** + +If set, will get membership information. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **Recurse** + +If set, will recursively expand any group memberships discovered. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **Filter** + +The filter used for a query + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |5 |false | +--- +#### **SearchType** + +The search type. Can be: AccountName, DisplayName, MailAddress, General, LocalGroupName + + + +Valid Values: + +* AccountName +* DisplayName +* MailAddress +* General +* LocalGroupName +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |6 |false | +--- +#### **ApiVersion** + +The api version. By default, 6.0. +This API does not exist in TFS. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |7 |false | +--- +### Outputs +PSDevOps.Team + + +PSDevOps.TeamMember + + +--- +### Syntax +```PowerShell +Get-ADOIdentity [-Organization] [[-AceDictionary] ] [[-Descriptors] ] [[-DescriptorBatchSize] ] [-Membership] [-Recurse] [[-Filter] ] [[-SearchType] ] [[-ApiVersion] ] [] +``` +--- + + diff --git a/docs/Get-ADOIterationPath.md b/docs/Get-ADOIterationPath.md new file mode 100644 index 00000000..ba0c5117 --- /dev/null +++ b/docs/Get-ADOIterationPath.md @@ -0,0 +1,99 @@ + +Get-ADOIterationPath +-------------------- +### Synopsis +Gets iteration paths + +--- +### Description + +Get iteration paths from Azure DevOps + +--- +### Related Links +* [Get-ADOAreaPath](Get-ADOAreaPath.md) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/Classification%20Nodes/Get%20Classification%20Nodes?view=azure-devops-rest-5.1#get-the-root-area-tree](https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/Classification%20Nodes/Get%20Classification%20Nodes?view=azure-devops-rest-5.1#get-the-root-area-tree) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOIterationPath -Organization StartAutomating -Project PSDevOps +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **Project** + +The project name or identifier. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |2 |true (ByPropertyName)| +--- +#### **IterationPath** + +The IterationPath + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |3 |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |4 |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 2.0. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |5 |false | +--- +#### **Depth** + +The depth of items to get. By default, one. + + + +|Type |Requried|Postion|PipelineInput| +|-------------|--------|-------|-------------| +|```[Int32]```|false |6 |false | +--- +### Outputs +PSDevOps.IterationPath + + +--- +### Syntax +```PowerShell +Get-ADOIterationPath [-Organization] [-Project] [[-IterationPath] ] [[-Server] ] [[-ApiVersion] ] [[-Depth] ] [] +``` +--- + + diff --git a/docs/Get-ADOPermission.md b/docs/Get-ADOPermission.md new file mode 100644 index 00000000..5e305c7c --- /dev/null +++ b/docs/Get-ADOPermission.md @@ -0,0 +1,403 @@ + +Get-ADOPermission +----------------- +### Synopsis +Gets Azure DevOps Permissions + +--- +### Description + +Gets Azure DevOps security permissions. + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/security/access%20control%20lists/query](https://docs.microsoft.com/en-us/rest/api/azure/devops/security/access%20control%20lists/query) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/security/security%20namespaces/query](https://docs.microsoft.com/en-us/rest/api/azure/devops/security/security%20namespaces/query) +* [https://docs.microsoft.com/en-us/azure/devops/organizations/security/namespace-reference](https://docs.microsoft.com/en-us/azure/devops/organizations/security/namespace-reference) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOPermission -Organization MyOrganization -Project MyProject -PersonalAccessToken $pat +``` + +#### EXAMPLE 2 +```PowerShell +Get-ADOProject -Organization MyOrganization -Project MyProject | # Get the project + Get-ADOTeam | # get the teams within the project + Get-ADOPermission -Dashboard # get the dashboard permissions of each team within the project. +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **PermissionType** + +If set, will list the type of permisssions. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **NamespaceID** + +The Security Namespace ID. +For details about each namespace, see: +https://docs.microsoft.com/en-us/azure/devops/organizations/security/namespace-reference + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **SecurityToken** + +The Security Token. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **ProjectID** + +The Project ID. +If this is provided without anything else, will get permissions for the projectID + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **TeamID** + +If provided, will get permissions related to a given teamID. ( see Get-ADOTeam) + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **AreaPath** + +If provided, will get permissions related to an Area Path. ( see Get-ADOAreaPath ) + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **IterationPath** + +If provided, will get permissions related to an Iteration Path. ( see Get-ADOIterationPath ) + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Overview** + +If set, will get common permissions related to a project. +These are: +* Builds +* Boards +* Dashboards +* Git Repositories +* ServiceEndpoints +* Project Permissions +* Service Endpoints +* ServiceHooks + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Tagging** + +If set, will get permissions for tagging related to the current project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Analytics** + +If set, will get permissions for analytics related to the current project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **ManageTFVC** + +If set, will get permissions for Team Foundation Version Control related to the current project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Plan** + +If set, will get permissions for Delivery Plans. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Dashboard** + +If set, will get dashboard permissions related to the current project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **ServiceEndpoint** + +If set, will get all service endpoints permissions. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **EndpointID** + +If set, will get endpoint permissions related to a particular endpoint. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **DefinitionID** + +The Build Definition ID + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **BuildPath** + +The path to the build. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **BuildPermission** + +If set, will get build and release permissions for a given project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **RepositoryID** + +If provided, will get build and release permissions for a given project's repositoryID + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **BranchName** + +If provided, will get permissions for a given branch within a repository + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **ProjectRepository** + +If set, will get permissions for repositories within a project + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **AllRepository** + +If set, will get permissions for repositories within a project + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Descriptor** + +The Descriptor + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **Recurse** + +If set and this is a hierarchical namespace, return child ACLs of the specified token. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **IncludeExtendedInfo** + +If set, populate the extended information properties for the access control entries in the returned lists. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **ExpandACL** + +If set, will expand the ACE dictionary returned + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.SecurityNamespace + + +PSDevOps.AccessControlList + + +--- +### Syntax +```PowerShell +Get-ADOPermission -Organization [-PermissionType] [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization -NamespaceID [-SecurityToken ] [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization -ProjectID -Overview [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization -ProjectID -ProjectRepository [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization -ProjectID -RepositoryID [-BranchName ] [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization -ProjectID -IterationPath [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization -ProjectID -BuildPermission [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization -ProjectID -DefinitionID [-BuildPath ] [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization -ProjectID -ManageTFVC [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization -ProjectID -Tagging [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization -ProjectID [-TeamID ] -Dashboard [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization -ProjectID -AreaPath [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization [-ProjectID ] -EndpointID [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization [-ProjectID ] -Analytics [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization -ProjectID [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization -Plan [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization -ServiceEndpoint [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPermission -Organization [-BranchName ] -AllRepository [-Descriptor ] [-Recurse] [-IncludeExtendedInfo] [-ExpandACL] [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOPicklist.md b/docs/Get-ADOPicklist.md new file mode 100644 index 00000000..8f611cf6 --- /dev/null +++ b/docs/Get-ADOPicklist.md @@ -0,0 +1,115 @@ + +Get-ADOPicklist +--------------- +### Synopsis +Gets picklists from Azure DevOps. + +--- +### Description + +Gets picklists from Azure DevOps. + +Picklists are lists of values that can be associated with a field, for example, a list of T-shirt sizes. + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/processes/lists/list](https://docs.microsoft.com/en-us/rest/api/azure/devops/processes/lists/list) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/processes/lists/get](https://docs.microsoft.com/en-us/rest/api/azure/devops/processes/lists/get) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOPicklist -Organization StartAutomating -PersonalAccessToken $pat +``` + +#### EXAMPLE 2 +```PowerShell +Get-ADOPicklist -Organization StartAutomating +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **PickListID** + +The Picklist Identifier. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **PicklistName** + +The name of the picklist + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Orphan** + +If set, will return orphan picklists. These picklists are not associated with any field. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.Project + + +PSDevOps.Property + + +--- +### Syntax +```PowerShell +Get-ADOPicklist -Organization [-PicklistName ] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPicklist -Organization [-PicklistName ] -Orphan [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOPicklist -Organization -PickListID [-PicklistName ] [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOProject.md b/docs/Get-ADOProject.md new file mode 100644 index 00000000..940dd135 --- /dev/null +++ b/docs/Get-ADOProject.md @@ -0,0 +1,307 @@ + +Get-ADOProject +-------------- +### Synopsis +Gets projects from Azure DevOps. + +--- +### Description + +Gets projects from Azure DevOps or TFS. + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/core/projects/list](https://docs.microsoft.com/en-us/rest/api/azure/devops/core/projects/list) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/wiki/wikis/list](https://docs.microsoft.com/en-us/rest/api/azure/devops/wiki/wikis/list) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOProject -Organization StartAutomating -PersonalAccessToken $pat +``` + +#### EXAMPLE 2 +```PowerShell +Get-ADOProject -Organization StartAutomating -Project PSDevOps +``` + +#### EXAMPLE 3 +```PowerShell +Get-ADOProject -Organization StartAutomating -Project PSDevOps | + Get-ADOProject -Metadata +``` + +--- +### Parameters +#### **Project** + +The project name. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **ProjectID** + +The project identifier. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Metadata** + +If set, will get project metadta + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **ProcessConfiguration** + +If set, will return the process configuration of a project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **PolicyConfiguration** + +If set, will return the policy configuration of a project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **PolicyType** + +If set, will return the policy types available in a given project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Plan** + +If set, will return the plans related to a project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **TestRun** + +If set, will return the test runs associated with a project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **TestPlan** + +If set, will return the test plans associated with a project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **TestVariable** + +If set, will return the test variables associated with a project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **TestConfiguration** + +If set, will return the test variables associated with a project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **PlanID** + +If set, will a specific project plan. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|true |named |false | +--- +#### **DeliveryTimeline** + +If set, will return the project delivery timeline associated with a given planID. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|true |named |false | +--- +#### **Wiki** + +If set, will return any wikis associated with the project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Board** + +If set, will return any boards associated with the project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Release** + +If set, will return releases associated with the project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **PendingApproval** + +If set, will return pending approvals associated with the project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.Project + + +PSDevOps.Property + + +--- +### Syntax +```PowerShell +Get-ADOProject -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -Project -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -Board -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -TestConfiguration -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -TestVariable -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -PendingApproval -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -Release -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -TestPlan -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -TestRun -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -Wiki -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -PolicyConfiguration -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -PolicyType -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -PlanID -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -Plan -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -ProcessConfiguration -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -Metadata -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -ProjectID -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOProject -PlanID -DeliveryTimeline -Organization [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADORepository.md b/docs/Get-ADORepository.md new file mode 100644 index 00000000..74b2bbb4 --- /dev/null +++ b/docs/Get-ADORepository.md @@ -0,0 +1,508 @@ + +Get-ADORepository +----------------- +### Synopsis +Gets repositories from Azure DevOps + +--- +### Description + +Gets the repositories from Azure DevOps. + +By default, this will return the project's git repositories. + +You can get additional details by piping back into Get-ADORepository with a number of switches: + +* ```Get-ADORepository | Get-ADORepository -PullRequest # Lists pull requests``` +* ```Get-ADORepository | Get-ADORepository -FileList # Lists files in a repository``` +* ```Get-ADORepository | Get-ADORepository -GitRef # Lists git refs for a repository``` + + +Azure DevOps repositories can have more than one type of SourceProvider. + +To list the Source Providers, use -SourceProvider + +We can get repositories for a given -ProviderName. + +--- +### Related Links +* [Remove-ADORepository](Remove-ADORepository.md) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/build/source%20providers/list%20repositories](https://docs.microsoft.com/en-us/rest/api/azure/devops/build/source%20providers/list%20repositories) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADORepository -Organization StartAutomating -Project PSDevOps +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The Project + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **RepositoryID** + +The Repository ID + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **CommitList** + +If set, will list commits associated with a given repository. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Skip** + +If provided, will -Skip N items. + + + +|Type |Requried|Postion|PipelineInput| +|-------------|--------|-------|-------------| +|```[Int32]```|false |named |false | +--- +#### **First** + +If provided, will return the -First N items. + + + +|Type |Requried|Postion|PipelineInput| +|-------------|--------|-------|-------------| +|```[Int32]```|false |named |false | +--- +#### **FileList** + +If set, will get the file list from a repository + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **RecursionLevel** + +When getting a -FileList, the recursion level. By default, full. + + + +Valid Values: + +* full +* None +* oneLevel +* oneLevelPlusNestedEmptyFolders +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **ScopePath** + +When getting a -FileList, the path scope. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **VersionDescriptor** + +The version string identifier (name of tag/branch, SHA1 of commit) + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **VersionOption** + +The version options (e.g. firstParent, previousChange) + + + +Valid Values: + +* none +* firstParent +* previousChange +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **VersionType** + +The version type (e.g. branch, commit, or tag) + + + +Valid Values: + +* branch +* commit +* tag +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **IncludeMetadata** + +If -IncludeContentMetadata is set a -FileList will include content metadata. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Download** + +If set, will include the parent repository + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **PullRequest** + +If set, will list pull requests related to a git repository. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **GitRef** + +If set, will list git references related to a repository. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **BranchStatistic** + +If set, will list git branch statistics related to a repository. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **TreeId** + +If provided, will output a tree of commits. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **CreatorIdentity** + +Filters pull requests, returning requests created by the -CreatorIdentity. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **ReviewerIdentity** + +Filters pull requests where the -ReviewerIdentity is a reviewer. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **SourceReference** + +Filters pull requests where the source branch is the -SourceReference. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **TargetReference** + +Filters pull requests where the target branch is the -TargetReference. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **PullRequestStatus** + +Filters pull requests with a paricular status. If not specified, will default to Active. + + + +Valid Values: + +* abandoned +* active +* all +* completed +* notset +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **PullRequestID** + +Get pull request with a specific id + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **PushList** + +If set, will list pushes associated with a repository + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **IncludeParent** + +If set, will include the parent repository + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Recycled** + +If set, will get repositories from the recycle bin + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **IncludeHidden** + +If set, will include hidden repositories. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **IncludeLink** + +If set, will include all related links to a repository. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **IncludeRemoteUrl** + +If set, will return all GitHub remote URLs associated with a repository. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **SourceProvider** + +If set, will list repository source providers + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **ProviderName** + +The name of the Source Provider. This will get all repositories associated with the project. +If the -ProviderName is not TFVC or TFGit, an -EndpointID is also required + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **EndpointID** + +The name of the Source Provider. This will get all repositories associated with the project. +If the -ProviderName is not TFVC or TFGit, an -EndpointID is also required + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **RepositoryName** + +The name of the repository + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Path** + +The path within the repository. +To use this parameter, -ProviderName is also required, and -EndpointID will be required if the -ProviderName is not TFVC or TFGit + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **CommitOrBranch** + +The commit or branch. By default, Master. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.Repository + + +PSDevOps.Repository.SourceProvider + + +PSDevOps.Repository.File + + +PSDevOps.Repoistory.Recycled + + +--- +### Syntax +```PowerShell +Get-ADORepository -Organization -Project [-IncludeHidden] [-IncludeLink] [-IncludeRemoteUrl] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADORepository -Organization -Project -RepositoryID -TreeId [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADORepository -Organization -Project -RepositoryID -BranchStatistic [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADORepository -Organization -Project -RepositoryID [-First ] -GitRef [-IncludeLink] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADORepository -Organization -Project -RepositoryID [-Skip ] [-First ] -PushList [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADORepository -Organization -Project -RepositoryID -PullRequestID [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADORepository -Organization -Project -RepositoryID [-Skip ] [-First ] -PullRequest [-CreatorIdentity ] [-ReviewerIdentity ] [-SourceReference ] [-TargetReference ] [-PullRequestStatus ] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADORepository -Organization -Project -RepositoryID -FileList [-RecursionLevel ] [-ScopePath ] [-VersionDescriptor ] [-VersionOption ] [-VersionType ] [-IncludeMetadata] [-Download] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADORepository -Organization -Project -RepositoryID -CommitList [-Skip ] [-First ] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADORepository -Organization -Project -RepositoryID [-IncludeParent] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADORepository -Organization -Project -Recycled [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADORepository -Organization -Project -SourceProvider [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADORepository -Organization -Project -ProviderName [-EndpointID ] -RepositoryName -Path [-CommitOrBranch ] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADORepository -Organization -Project -ProviderName [-EndpointID ] [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOServiceEndpoint.md b/docs/Get-ADOServiceEndpoint.md new file mode 100644 index 00000000..9d147806 --- /dev/null +++ b/docs/Get-ADOServiceEndpoint.md @@ -0,0 +1,133 @@ + +Get-ADOServiceEndpoint +---------------------- +### Synopsis +Gets Azure DevOps Service Endpoints + +--- +### Description + +Gets Service Endpoints from Azure DevOps. + +Service Endpoints are used to connect an Azure DevOps project to one or more web services. + +To see the types of service endpoints, use Get-ADOServiceEndpoint -GetEndpointType + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints/get%20service%20endpoints?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints/get%20service%20endpoints?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints/get?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints/get?view=azure-devops-rest-5.1) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOServiceEndpoint -Organization MyOrg -Project MyProject -PersonalAccessToken $myPersonalAccessToken +``` + +#### EXAMPLE 2 +```PowerShell +Get-ADOServiceEndpoint -Organization MyOrg -GetEndpointType -PersonalAccessToken $myPersonalAccessToken +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The Project + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **EndpointID** + +The Endpoint ID + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **History** + +If set, will get the execution history of the endpoint. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **GetEndpointType** + +If set, will get the types of endpoints. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.ServiceEndpoint + + +StartAutomating.PSDevOps.ServiceEndpoint.History + + +StartAutomating.PSDevOps.ServiceEndpoint.Type + + +--- +### Syntax +```PowerShell +Get-ADOServiceEndpoint -Organization -Project [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOServiceEndpoint -Organization -GetEndpointType [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOServiceEndpoint -Organization -Project -EndpointID -History [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOServiceEndpoint -Organization -Project -EndpointID [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOServiceHook.md b/docs/Get-ADOServiceHook.md new file mode 100644 index 00000000..ff8946c9 --- /dev/null +++ b/docs/Get-ADOServiceHook.md @@ -0,0 +1,191 @@ + +Get-ADOServiceHook +------------------ +### Synopsis +Gets Azure DevOps Service Hooks + +--- +### Description + +Gets Azure DevOps Service Hook Subscriptions, Consumers, and Publishers. + +A subscription maps a publisher of events to a consumer of events. + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/hooks/subscriptions/list?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/hooks/subscriptions/list?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/hooks/consumers/list?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/hooks/consumers/list?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/hooks/consumers/list%20consumer%20actions?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/hooks/consumers/list%20consumer%20actions?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/hooks/publishers/list?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/hooks/publishers/list?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/hooks/publishers/list%20event%20types?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/hooks/publishers/list%20event%20types?view=azure-devops-rest-5.1) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +# Gets subscriptions. If none exist, nothing is returned. +Get-ADOServiceHook -Organization MyOrganization -PersonalAccessToken $pat +``` + +#### EXAMPLE 2 +```PowerShell +# Gets potential consumers +Get-ADOServiceHook -Organization MyOrganization -PersonalAccessToken $pat -Consumer +``` + +#### EXAMPLE 3 +```PowerShell +# Gets the actions of all consumers +Get-ADOServiceHook -Organization MyOrganization -PersonalAccessToken $pat -Consumer | + Get-ADOServiceHook -Action +``` + +#### EXAMPLE 4 +```PowerShell +# Gets potential publishers +Get-ADOServiceHook -Organization MyOrganization -PersonalAccessToken $pat -Publisher +``` + +#### EXAMPLE 5 +```PowerShell +# Gets the event types of all publishers +Get-ADOServiceHook -Organization MyOrganization -PersonalAccessToken $pat -Publisher| + Get-ADOServiceHook -EventType +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Consumer** + +If set, will list consumers. Consumers can receive events from a publisher. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **ConsumerID** + +The Consumer ID. This can be provided to get details of an event consumer, or to list actions related to the event consumer. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Action** + +If set, will list actions available in a given event consumer. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Publisher** + +If set, will list publishers. Publishers can provide events to a consumer. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **PublisherID** + +The Publisher ID. This can be provided to get details of an event publisher, or to list actions related to the event publisher. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **EventType** + +If set, will list event types available from a given event publisher. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevops.Subscription + + +PSDevops.Consumer + + +PSDevops.Publisher + + +PSDevops.EventType + + +PSDevops.Action + + +--- +### Syntax +```PowerShell +Get-ADOServiceHook -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOServiceHook -Organization -Consumer [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOServiceHook -Organization -ConsumerID -Action [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOServiceHook -Organization -ConsumerID [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOServiceHook -Organization -Publisher [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOServiceHook -Organization -PublisherID -EventType [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOServiceHook -Organization -PublisherID [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOTask.md b/docs/Get-ADOTask.md new file mode 100644 index 00000000..ffcb77c1 --- /dev/null +++ b/docs/Get-ADOTask.md @@ -0,0 +1,97 @@ + +Get-ADOTask +----------- +### Synopsis +Gets Azure DevOps Tasks + +--- +### Description + +Gets Tasks and Task Groups from Azure DevOps + +--- +### Related Links +* [Convert-ADOPipeline](Convert-ADOPipeline.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOTask -Organization StartAutomating +``` + +#### EXAMPLE 2 +```PowerShell +Get-ADOTask -Organization StartAutomating -YAMLSchema +``` + +--- +### Parameters +#### **Organization** + +The organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The project. Required to get task groups. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **TaskGroup** + +If set, will get task groups related to a project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **YAMLSchema** + +If set, will get the schema for YAML tasks within an organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +### Outputs +PSDevOps.Task + + +--- +### Syntax +```PowerShell +Get-ADOTask -Organization [-Server ] [] +``` +```PowerShell +Get-ADOTask -Organization -Project -TaskGroup [-Server ] [] +``` +```PowerShell +Get-ADOTask -Organization -YAMLSchema [-Server ] [] +``` +--- + + diff --git a/docs/Get-ADOTeam.md b/docs/Get-ADOTeam.md new file mode 100644 index 00000000..a9cc5560 --- /dev/null +++ b/docs/Get-ADOTeam.md @@ -0,0 +1,211 @@ + +Get-ADOTeam +----------- +### Synopsis +Gets Azure DevOps Teams + +--- +### Description + +Gets teams from Azure DevOps or TFS + +--- +### Related Links +* [Get-ADOProject](Get-ADOProject.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOTeam -Organization StartAutomating +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The project name or identifier + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **Mine** + +If set, will return teams in which the current user is a member. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **TeamID** + +The Team Identifier + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **Member** + +If set, will return members of a team. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **SecurityDescriptor** + +The Security Descriptor. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Identity** + +If set, will return the team identity. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Setting** + +If set, will return the team settings. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **FieldValue** + +If set, will return the team field values. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Iteration** + +If set, will return iterations for the team. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Board** + +If set, will list team workboards. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **SecurityGroup** + +If set, will list the security groups. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.Team + + +PSDevOps.TeamMember + + +--- +### Syntax +```PowerShell +Get-ADOTeam -Organization [-Mine] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTeam -Organization [-Project ] [-TeamID ] -Identity [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTeam -Organization -Project -TeamID -Board [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTeam -Organization -Project -TeamID -Iteration [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTeam -Organization -Project -TeamID -FieldValue [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTeam -Organization -Project -TeamID -Setting [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTeam -Organization -Project -TeamID -Member [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTeam -Organization -Project -TeamID [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTeam -Organization -Project [-Mine] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTeam -Organization -Member -SecurityDescriptor [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTeam -Organization -SecurityGroup [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOTest.md b/docs/Get-ADOTest.md new file mode 100644 index 00000000..98af4d7d --- /dev/null +++ b/docs/Get-ADOTest.md @@ -0,0 +1,309 @@ + +Get-ADOTest +----------- +### Synopsis +Gets tests from Azure DevOps. + +--- +### Description + +Gets test plans, suites, points, and results from Azure DevOps or TFS. + +--- +### Related Links +* [Get-ADOProject](Get-ADOProject.md) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/test/runs/list](https://docs.microsoft.com/en-us/rest/api/azure/devops/test/runs/list) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/test/results/list](https://docs.microsoft.com/en-us/rest/api/azure/devops/test/results/list) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/test/test%20%20suites/list](https://docs.microsoft.com/en-us/rest/api/azure/devops/test/test%20%20suites/list) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/testplan/test%20%20suites/get%20test%20suites%20for%20plan](https://docs.microsoft.com/en-us/rest/api/azure/devops/testplan/test%20%20suites/get%20test%20suites%20for%20plan) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOProject -Organization StartAutomating -Project PSDevOps | + Get-ADOTest -Run +``` + +--- +### Parameters +#### **ProjectID** + +The project identifier. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **TestRun** + +If set, will return the test runs associated with a project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **TestRunID** + +If set, will return results related to a specific test run. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **TestPlan** + +If set, will return the test plans associated with a project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **TestPlanID** + +If set, will return results related to a specific test plan. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **TestVariable** + +If set, will return the test variables associated with a project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **TestConfiguration** + +If set, will return the test variables associated with a project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **TestSuite** + +If set, will list test suites related to a plan. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **TestSuiteID** + +If set, will return results related to a particular test suite. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **TestPoint** + +If set, will return test points within a suite. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **TestResult** + +If set, will return test results within a run. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **First** + +If set, will return the first N results within a test run. + + + +|Type |Requried|Postion|PipelineInput | +|-------------|--------|-------|---------------------| +|```[Int32]```|false |named |true (ByPropertyName)| +--- +#### **Total** + +If provided, will return the continue to return results of the maximum batch size until the total is reached. + + + +|Type |Requried|Postion|PipelineInput | +|-------------|--------|-------|---------------------| +|```[Int32]```|false |named |true (ByPropertyName)| +--- +#### **Skip** + +If set, will return the skip N results within a test run. + + + +|Type |Requried|Postion|PipelineInput | +|-------------|--------|-------|---------------------| +|```[Int32]```|false |named |true (ByPropertyName)| +--- +#### **Outcome** + +If provided, will only return test results with one of the provided outcomes. + + + +Valid Values: + +* Unspecified +* None +* Passed +* Failed +* Inconclusive +* Timeout +* Aborted +* Blocked +* NotExecuted +* Warning +* Error +* NotApplicable +* Passed +* InProgress +* NotImpacted +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **ResultDetail** + +Details to include with the test results. + + + +Valid Values: + +* None +* Iterations +* WorkItems +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **TestAttachment** + +If set, will return test attachments to a run. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Force** + +If set, will always retrieve fresh data. +By default, cached data will be returned. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.Project + + +PSDevOps.Property + + +--- +### Syntax +```PowerShell +Get-ADOTest -ProjectID [-TestRun] -Organization [-Force] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTest -ProjectID -TestRunID -TestResult [-First ] [-Total ] [-Skip ] [-Outcome ] [-ResultDetail ] -Organization [-Force] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTest -ProjectID -TestRunID -TestAttachment -Organization [-Force] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTest -ProjectID -TestRunID -Organization [-Force] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTest -ProjectID -TestPlan -Organization [-Force] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTest -ProjectID -TestPlanID -TestSuiteID -TestPoint -Organization [-Force] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTest -ProjectID -TestPlanID -TestSuite -Organization [-Force] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTest -ProjectID -TestPlanID -Organization [-Force] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTest -ProjectID -TestVariable -Organization [-Force] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTest -ProjectID -TestConfiguration -Organization [-Force] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOTest -ProjectID -TestSuiteID -Organization [-Force] [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOUser.md b/docs/Get-ADOUser.md new file mode 100644 index 00000000..7dcb8718 --- /dev/null +++ b/docs/Get-ADOUser.md @@ -0,0 +1,178 @@ + +Get-ADOUser +----------- +### Synopsis +Gets Azure DevOps Users + +--- +### Description + +Gets users from Azure DevOps. + +--- +### Related Links +* [Get-ADOTeam](Get-ADOTeam.md) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/graph/users/list?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/graph/users/list?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/memberentitlementmanagement/user%20entitlements/search%20user%20entitlements](https://docs.microsoft.com/en-us/rest/api/azure/devops/memberentitlementmanagement/user%20entitlements/search%20user%20entitlements) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOUser -Organization StartAutomating +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **StorageKey** + +If set, will get details about a particular user storage key + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **MemberURL** + +If set, will get details about a particular member URL. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The project name or identifier. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **TeamID** + +The Team Identifier + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Entitlement** + +If set, will get user entitlement data. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Filter** + +If provided, will filter user entitlement data. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **OrderBy** + +If provided, will order user entitlement data. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Select** + +If provided, will select given properties of user entitlement data. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **SubjectType** + +If provided, will get graph users of one or more subject types. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.Team + + +PSDevOps.TeamMember + + +--- +### Syntax +```PowerShell +Get-ADOUser -Organization [-SubjectType ] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOUser -Organization -StorageKey [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOUser -Organization -MemberURL [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOUser -Organization [-Project ] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOUser -Organization -Project -TeamID [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOUser -Organization -Entitlement [-Filter ] [-OrderBy ] [-Select ] [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOWiki.md b/docs/Get-ADOWiki.md new file mode 100644 index 00000000..7ce09e29 --- /dev/null +++ b/docs/Get-ADOWiki.md @@ -0,0 +1,91 @@ + +Get-ADOWiki +----------- +### Synopsis +Gets Azure DevOps Wikis + +--- +### Description + +Gets Azure DevOps Wikis related to a project. + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/wiki/wikis/list](https://docs.microsoft.com/en-us/rest/api/azure/devops/wiki/wikis/list) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOWiki -Organization MyOrganization -Project MyProject -PersonalAccessToken $pat +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The Project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **WikiID** + +The Wiki Identifier. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.Wiki + + +--- +### Syntax +```PowerShell +Get-ADOWiki -Organization -Project [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWiki -Organization -Project -WikiID [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOWorkItem.md b/docs/Get-ADOWorkItem.md new file mode 100644 index 00000000..9aa99d21 --- /dev/null +++ b/docs/Get-ADOWorkItem.md @@ -0,0 +1,304 @@ + +Get-ADOWorkItem +--------------- +### Synopsis +Gets work items from Azure DevOps + +--- +### Description + +Gets work item from Azure DevOps or Team Foundation Server. + +--- +### Related Links +* [Invoke-ADORestAPI](Invoke-ADORestAPI.md) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/get%20work%20item?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/get%20work%20item?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/wiql/query%20by%20wiql?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/wiql/query%20by%20wiql?view=azure-devops-rest-5.1) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOWorkItem -Organization StartAutomating -Project PSDevOps -ID 1 +``` + +#### EXAMPLE 2 +```PowerShell +Get-ADOWorkItem -Organization StartAutomating -Project PSDevOps -Query 'Select [System.ID] from WorkItems' +``` + +--- +### Parameters +#### **Title** + +The Work Item Title + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Query** + +A query. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **Mine** + +Gets work items assigned to me. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **CurrentIteration** + +Gets work items in the current iteration. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **NoDetail** + +If set, queries will output the IDs of matching work items. +If not provided, details will be retreived for all work items. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **ID** + +The Work Item ID + + + +|Type |Requried|Postion|PipelineInput | +|-------------|--------|-------|---------------------| +|```[Int32]```|true |named |true (ByPropertyName)| +--- +#### **Comment** + +If set, will get comments related to a work item. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Revision** + +If set, will get revisions of a work item. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Update** + +If set, will get updates of a work item. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The Project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Team** + +The Team. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **First** + +If provided, will only return the first N results from a query. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[UInt32]```|false |named |true (ByPropertyName)| +--- +#### **WorkItemType** + +If set, will return work item types. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **SharedQuery** + +If set, will return work item shared queries + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **IncludeDeleted** + +If set, will return shared queries that have been deleted. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Depth** + +If provided, will return shared queries up to a given depth. + + + +|Type |Requried|Postion|PipelineInput | +|-------------|--------|-------|---------------------| +|```[Int32]```|false |named |true (ByPropertyName)| +--- +#### **SharedQueryFilter** + +If provided, will filter the shared queries returned + + + +|Type |Requried|Postion|PipelineInput | +|-------------|--------|-------|---------------------| +|```[Int32]```|false |named |true (ByPropertyName)| +--- +#### **ExpandSharedQuery** + +Determines how data from shared queries will be expanded. By default, expands all data. + + + +Valid Values: + +* All +* Clauses +* Minimal +* None +* Wiql +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Field** + +One or more fields. + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[String[]]```|false |named |false | +--- +#### **Related** + +If set, will get related items + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.WorkItem + + +--- +### Syntax +```PowerShell +Get-ADOWorkItem [-Title ] [-Mine] [-CurrentIteration] -ID -Organization [-Project ] [-Field ] [-Related] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkItem [-Title ] [-Query] [-Mine] [-CurrentIteration] [-NoDetail] -Organization [-Project ] [-Team ] [-First ] [-Field ] [-Related] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkItem [-Title ] [-Mine] [-CurrentIteration] [-ID ] -Update -Organization [-Project ] [-Field ] [-Related] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkItem [-Title ] [-Mine] [-CurrentIteration] [-ID ] -Revision -Organization [-Project ] [-Field ] [-Related] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkItem [-Title ] [-Mine] [-CurrentIteration] [-ID ] -Organization [-Project ] [-Field ] [-Related] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkItem [-Title ] [-Mine] [-CurrentIteration] -Comment -Organization [-Project ] [-Field ] [-Related] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkItem [-Title ] [-Mine] [-CurrentIteration] -Organization [-Project ] [-First ] -SharedQuery [-IncludeDeleted] [-Depth ] [-SharedQueryFilter ] [-ExpandSharedQuery ] [-Field ] [-Related] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkItem [-Title ] [-Mine] [-CurrentIteration] -Organization [-Project ] -WorkItemType [-Field ] [-Related] [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOWorkItemType.md b/docs/Get-ADOWorkItemType.md new file mode 100644 index 00000000..13ce7c82 --- /dev/null +++ b/docs/Get-ADOWorkItemType.md @@ -0,0 +1,218 @@ + +Get-ADOWorkItemType +------------------- +### Synopsis +Gets work item types + +--- +### Description + +Gets work item types from Azure DevOps + +--- +### Related Links +* [Get-ADOWorkProcess](Get-ADOWorkProcess.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOWorkProcess -Organization StartAutomating -Project PSDevOps | + Get-ADOWorkItemType +``` + +#### EXAMPLE 2 +```PowerShell +Get-ADOWorkItemType -Organization StartAutomating -Icon +``` + +#### EXAMPLE 3 +```PowerShell +Get-ADOWorkItemType -Organization StartAutomating -Project PSDevOps +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **ProcessID** + +The ProcessID. This is returned from Get-ADOWorkProcess. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **ReferenceName** + +The Reference Name of the Work Item Type. This can be provided by piping Get-ADOWorkItemType to itself. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Layout** + +If set, will get the layout associated with a given work item type. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Page** + +If set, will get the pages within a given work item type layout. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **State** + +If set, will get the states associated with a given work item type. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Rule** + +If set, will get the rules associated with a given work item type. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Behavior** + +If set, will get the behaviors associated with a given work item type. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Field** + +If set, will get the fields associated with a given work item type. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Project** + +The name of the project. If provided, will get work item type information related to the project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Icon** + +If set, will get work item icons available to the organization. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.WorkItemType + + +PSDevOps.State + + +PSDevOps.Rule + + +PSDevOps.Behavior + + +PSDevOps.Layout + + +PSDevOps.ProcessField + + +--- +### Syntax +```PowerShell +Get-ADOWorkItemType -Organization -ProcessID -ReferenceName -Behavior [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkItemType -Organization -ProcessID -ReferenceName -Field [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkItemType -Organization -ProcessID -ReferenceName -Rule [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkItemType -Organization -ProcessID -ReferenceName -State [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkItemType -Organization -ProcessID -ReferenceName -Layout [-Page] [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkItemType -Organization -ProcessID -ReferenceName [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkItemType -Organization -ProcessID [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkItemType -Organization -Project [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkItemType -Organization -Icon [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-ADOWorkProcess.md b/docs/Get-ADOWorkProcess.md new file mode 100644 index 00000000..6dea8cc6 --- /dev/null +++ b/docs/Get-ADOWorkProcess.md @@ -0,0 +1,125 @@ + +Get-ADOWorkProcess +------------------ +### Synopsis +Gets work processes from ADO. + +--- +### Description + +Gets work processes from Azure DevOps. + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/processes/processes/list?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/processes/processes/list?view=azure-devops-rest-5.1) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOWorkProcess -Organization StartAutomating -PersonalAccessToken $pat +``` + +#### EXAMPLE 2 +```PowerShell +Get-ADOProject -Organization StartAutomating -PersonalAccessToken $pat | Get-ADOWorkProcess +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **ProjectID** + +The Project Identifier. If this is provided, will get the work process associated with that project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **ProcessID** + +The process identifier + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **WorkItemType** + +If set, will list work item types in a given Work process. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Behavior** + +If set, will list behaviors associated with a given work process. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +PSDevOps.WorkProcess + + +--- +### Syntax +```PowerShell +Get-ADOWorkProcess -Organization [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkProcess -Organization -ProjectID [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkProcess -Organization -ProcessID -Behavior [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkProcess -Organization -ProcessID -WorkItemType [-Server ] [-ApiVersion ] [] +``` +```PowerShell +Get-ADOWorkProcess -Organization -ProcessID [-Server ] [-ApiVersion ] [] +``` +--- + + diff --git a/docs/Get-BuildStep.md b/docs/Get-BuildStep.md new file mode 100644 index 00000000..8030c119 --- /dev/null +++ b/docs/Get-BuildStep.md @@ -0,0 +1,77 @@ + +Get-BuildStep +------------- +### Synopsis +Gets BuildSteps + +--- +### Description + +Gets Build Steps. + +Build Steps are scripts or data fragments used to compose a build. + +--- +### Related Links +* [Import-BuildStep](Import-BuildStep.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-BuildStep +``` + +--- +### Parameters +#### **Name** + +If provided, only return build steps that are like this name. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |1 |true (ByPropertyName)| +--- +#### **Extension** + +If provided, only return build steps matching this extension. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |2 |true (ByPropertyName)| +--- +#### **Type** + +If provided, only return build steps of a given type. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |3 |true (ByPropertyName)| +--- +#### **BuildSystem** + +If provided, only return build steps for a given build system. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |4 |true (ByPropertyName)| +--- +### Outputs +PSDevOps.BuildStep + + +--- +### Syntax +```PowerShell +Get-BuildStep [[-Name] ] [[-Extension] ] [[-Type] ] [[-BuildSystem] ] [] +``` +--- + + diff --git a/docs/Get-PSDevOps.md b/docs/Get-PSDevOps.md new file mode 100644 index 00000000..1e80d8a8 --- /dev/null +++ b/docs/Get-PSDevOps.md @@ -0,0 +1,106 @@ + +Get-PSDevOps +------------ +### Synopsis +Gets PSDevOps commands. + +--- +### Description + +Gets PSDevOps commands. + +PSDevOps commands are self-contained scripts that complete end-to-end scenarios. + +They are traditionally named with the patterns *.*.ps1 or *.*.*.ps1. + +For example: + *.psdevops.ps1 files are used to run commands in PSDevOps. + *.GitHubAction.PSDevOps.ps1 would indicate creating a GitHubAction. + *.tests.ps1 files are used by Pester + *.ezout|ezformat|format|view.ps1 files are used by EZOut + +To name a few examples of where the technique is used. + +Using Get-PSDevOps will return extended command information and addtional methods. + +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-PSDevOps # Get *.*.ps1 commands in the current directory +``` + +#### EXAMPLE 2 +```PowerShell +Get-Module PSDevops | Get-PSDevOps # Gets related commands +``` + +--- +### Parameters +#### **Name** + +The name of the script. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |1 |true (ByPropertyName)| +--- +#### **ScriptPath** + +One or more paths to scripts. +If these paths resolve to directories, all files that match \.(?.+)\.ps1$ +If the paths resolve to scripts or commands + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |2 |true (ByPropertyName)| +--- +#### **ModuleInfo** + +One or more modules. This can be passed via the pipeline, for example: +Get-Module PSDevOps | Get-PSDevOps + + + +|Type |Requried|Postion|PipelineInput | +|----------------------|--------|-------|------------------------------| +|```[PSModuleInfo[]]```|false |3 |true (ByValue, ByPropertyName)| +--- +#### **Pattern** + +The Regular Expression Pattern used to search for files. +If a -Pattern is provided, named capture groups in that pattern will become noteproperties of the output object. +By default: + (?\.\w+.)?\.(?\w+)\.ps1$ + This roughly translates as: + Any *.*.ps1 file + The Named Capture 'Type' the type of .ps1 + The Optional Named Capture, Subtype, will match an additional '.Something' + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |4 |false | +--- +#### **Recurse** + +If set, will search directories recursively. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +### Syntax +```PowerShell +Get-PSDevOps [[-Name] ] [[-ScriptPath] ] [[-ModuleInfo] ] [[-Pattern] ] [-Recurse] [] +``` +--- + + diff --git a/docs/Hide-GitHubOutput.md b/docs/Hide-GitHubOutput.md new file mode 100644 index 00000000..d8cd47ad --- /dev/null +++ b/docs/Hide-GitHubOutput.md @@ -0,0 +1,47 @@ + +Hide-GitHubOutput +----------------- +### Synopsis +Masks output + +--- +### Description + +Prevents a message from being printed in a GitHub Workflow log. + +--- +### Related Links +* [Write-GitHubOutput](Write-GitHubOutput.md) +* [https://docs.github.com/en/actions/reference/workflow-commands-for-GitHubhub-actions](https://docs.github.com/en/actions/reference/workflow-commands-for-GitHubhub-actions) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Hide-GitHubOutput 'IsItSecret?' +'IsItSecret?' | Out-Host +``` + +--- +### Parameters +#### **Message** + +The message to hide. Any time this string would appear in logs, it will be replaced by asteriks. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +### Outputs +System.String + + +--- +### Syntax +```PowerShell +Hide-GitHubOutput [-Message] [] +``` +--- + + diff --git a/docs/Import-ADOProxy.md b/docs/Import-ADOProxy.md new file mode 100644 index 00000000..0d7a086e --- /dev/null +++ b/docs/Import-ADOProxy.md @@ -0,0 +1,132 @@ + +Import-ADOProxy +--------------- +### Synopsis +Imports an Azure DevOps Proxy + +--- +### Description + +Imports a Proxy Module for Azure DevOps or TFS. + +A Proxy module will wrap all commands, but will always provide one or more default parameters. + +--- +### Related Links +* [Connect-ADO](Connect-ADO.md) +* [Disconnect-ADO](Disconnect-ADO.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Import-ADOProxy -Organization StartAutomating +``` + +#### EXAMPLE 2 +```PowerShell +Import-ADOProxy -Organization StartAutomating -Prefix SA +``` + +#### EXAMPLE 3 +```PowerShell +Import-ADOProxy -Organization StartAutomating -Project PSDevOps -IncludeCommand *Build* -Prefix SADO +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **Project** + +The project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |2 |true (ByPropertyName)| +--- +#### **Server** + +The server. This can be used to provide a TFS instance + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |3 |true (ByPropertyName)| +--- +#### **Prefix** + +The prefix for all commands in the proxy module. +If not provided, this will be the -Server + -Organization + -Project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |4 |true (ByPropertyName)| +--- +#### **IncludeCommand** + +A list of command wildcards to include. By default, all applicable commands. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |5 |true (ByPropertyName)| +--- +#### **ExcludeCommand** + +A list of commands to exclude. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |6 |true (ByPropertyName)| +--- +#### **PassThru** + +If set, will return the imported module. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **Force** + +If set, will unload a previously loaded copy of the module. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +### Outputs +System.Nullable + + +System.Management.Automation.PSModuleInfo + + +--- +### Syntax +```PowerShell +Import-ADOProxy [-Organization] [[-Project] ] [[-Server] ] [[-Prefix] ] [[-IncludeCommand] ] [[-ExcludeCommand] ] [-PassThru] [-Force] [] +``` +--- + + diff --git a/docs/Import-BuildStep.md b/docs/Import-BuildStep.md new file mode 100644 index 00000000..1a2d9740 --- /dev/null +++ b/docs/Import-BuildStep.md @@ -0,0 +1,120 @@ + +Import-BuildStep +---------------- +### Synopsis +Imports Build Steps + +--- +### Description + +Imports Build Steps defined in a module. + +--- +### Related Links +* [Convert-BuildStep](Convert-BuildStep.md) +* [Expand-BuildStep](Expand-BuildStep.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Import-BuildStep -ModuleName PSDevOps +``` + +--- +### Parameters +#### **ModuleName** + +The name of the module containing build steps. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **SourcePath** + +The source path. This path contains definitions for a given single build system. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **IncludeCommand** + +A list of commands to include. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **ExcludeCommand** + +A list of commands to exclude + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **BuildSystem** + +The different build systems supported. +Each buildsystem is the name of a subdirectory that can contain steps or other components. + + + +Valid Values: + +* ADOPipeline +* ADOExtension +* GitHubAction +* GitHubWorkflow +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[String[]]```|false |named |false | +--- +#### **BuildSystemAlias** + +A list of valid directory aliases for a given build system. +By default, ADOPipelines can exist within a directory named ADOPipeline, ADO, AzDO, or AzureDevOps. +By default, GitHubWorkflows can exist within a directory named GitHubWorkflow, GitHubWorkflows, or GitHub. + + + +|Type |Requried|Postion|PipelineInput| +|-------------------|--------|-------|-------------| +|```[IDictionary]```|false |named |false | +--- +#### **BuildSystemInclude** + +|Type |Requried|Postion|PipelineInput| +|-------------------|--------|-------|-------------| +|```[IDictionary]```|false |named |false | +--- +#### **BuildCommandType** + +|Type |Requried|Postion|PipelineInput| +|-------------------|--------|-------|-------------| +|```[IDictionary]```|false |named |false | +--- +### Outputs +System.Nullable + + +--- +### Syntax +```PowerShell +Import-BuildStep -ModuleName [-IncludeCommand ] [-ExcludeCommand ] [-BuildSystem ] [-BuildSystemAlias ] [-BuildSystemInclude ] [-BuildCommandType ] [] +``` +```PowerShell +Import-BuildStep -SourcePath [-BuildSystem ] [-BuildSystemAlias ] [-BuildSystemInclude ] [-BuildCommandType ] [] +``` +--- + + diff --git a/docs/Install-ADOExtension.md b/docs/Install-ADOExtension.md new file mode 100644 index 00000000..84300b1d --- /dev/null +++ b/docs/Install-ADOExtension.md @@ -0,0 +1,112 @@ + +Install-ADOExtension +-------------------- +### Synopsis +Installs Azure DevOps Extensions + +--- +### Description + +Installs Azure DevOps Extensions from the Marketplace + +--- +### Related Links +* [Get-ADOExtension](Get-ADOExtension.md) +* [Uninstall-ADOExtension](Uninstall-ADOExtension.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Install-ADOExtension -PublisherID YodLabs -ExtensionID yodlabs-githubstats -Organization MyOrg +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **PublisherID** + +The Publisher of an Extension. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |2 |true (ByPropertyName)| +--- +#### **ExtensionID** + +The name of the Extension. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |3 |true (ByPropertyName)| +--- +#### **Version** + +The version of the extension. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |4 |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |5 |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |6 |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.Extension + + +--- +### Syntax +```PowerShell +Install-ADOExtension [-Organization] [-PublisherID] [-ExtensionID] [[-Version] ] [[-Server] ] [[-ApiVersion] ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/Invoke-ADORestAPI.md b/docs/Invoke-ADORestAPI.md new file mode 100644 index 00000000..5241cf99 --- /dev/null +++ b/docs/Invoke-ADORestAPI.md @@ -0,0 +1,284 @@ + +Invoke-ADORestAPI +----------------- +### Synopsis +Invokes the ADO Rest API + +--- +### Description + +Invokes the Azure DevOps REST API + +--- +### Related Links +* [Invoke-RestMethod](https://docs.microsoft.com/powershell/module/Microsoft.PowerShell.Utility/Invoke-RestMethod) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +# Uses the Azure DevOps REST api to get builds from a project +$org = 'StartAutomating' +$project = 'PSDevOps' +Invoke-ADORestAPI "https://dev.azure.com/$org/$project/_apis/build/builds/?api-version=5.1" +``` + +--- +### Parameters +#### **Uri** + +The REST API Url + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|true |1 |true (ByPropertyName)| +--- +#### **Method** + +Specifies the method used for the web request. The acceptable values for this parameter are: + - Default + - Delete + - Get + - Head + - Merge + - Options + - Patch + - Post + - Put + - Trace + + + +Valid Values: + +* GET +* DELETE +* HEAD +* MERGE +* OPTIONS +* PATCH +* POST +* PUT +* TRACE +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Body** + +Specifies the body of the request. +If this value is a string, it will be passed as-is +Otherwise, this value will be converted into JSON. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Object]```|false |named |true (ByPropertyName)| +--- +#### **UrlParameter** + +Parameters provided as part of the URL (in segments or a query string). + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **QueryParameter** + +Additional parameters provided after the URL. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **ContentType** + +Specifies the content type of the web request. +If this parameter is omitted and the request method is POST, Invoke-RestMethod sets the content type to application/x-www-form-urlencoded. Otherwise, the content type is not specified in the call. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Headers** + +Specifies the headers of the web request. Enter a hash table or dictionary. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **PersonalAccessToken** + +A Personal Access Token + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **Credential** + +Specifies a user account that has permission to send the request. The default is the current user. +Type a user name, such as User01 or Domain01\User01, or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. + + + +|Type |Requried|Postion|PipelineInput| +|--------------------|--------|-------|-------------| +|```[PSCredential]```|false |named |false | +--- +#### **UseDefaultCredentials** + +Indicates that the cmdlet uses the credentials of the current user to send the web request. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **ContinuationToken** + +A continuation token. This is appended as a query parameter, and can be used to continue a request. +Invoke-ADORestAPI will call recursively invoke itself until a response does not have a ContinuationToken + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **PSTypeName** + +The typename of the results. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **Property** + +A set of additional properties to add to an object + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **RemoveProperty** + +A list of property names to remove from an object + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **ExpandProperty** + +If provided, will expand a given property returned from the REST api. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **DecorateProperty** + +If provided, will decorate the values within a property in the return object. +This allows nested REST properties to work with the PowerShell Extended Type System. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **Cache** + +If set, will cache results from a request. Only HTTP GET results will be cached. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **AsByte** + +If set, will return results as a byte array. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **AsJob** + +If set, will run as a background job. +This parameter will be ignored if the caller is piping the results of Invoke-ADORestAPI. +This parameter will also be ignore when calling with -DynamicParameter or -MapParameter. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **DynamicParameter** + +If set, will get the dynamic parameters that should be provided to any function that wraps Invoke-ADORestApi + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **MapParameter** + +If set, will return the parameters for any function that can be passed to Invoke-ADORestApi. +Unmapped parameters will be added as a noteproperty of the returned dictionary. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|true |named |true (ByPropertyName)| +--- +### Outputs +System.Management.Automation.PSObject + + +--- +### Syntax +```PowerShell +Invoke-ADORestAPI [-Uri] [-Method ] [-Body ] [-UrlParameter ] [-QueryParameter ] [-ContentType ] [-Headers ] [-PersonalAccessToken ] [-Credential ] [-UseDefaultCredentials] [-ContinuationToken ] [-PSTypeName ] [-Property ] [-RemoveProperty ] [-ExpandProperty ] [-DecorateProperty ] [-Cache] [-AsByte] [-AsJob] [] +``` +```PowerShell +Invoke-ADORestAPI [-PersonalAccessToken ] [-Credential ] [-UseDefaultCredentials] [-Cache] [-AsByte] [-AsJob] -DynamicParameter [] +``` +```PowerShell +Invoke-ADORestAPI [-PersonalAccessToken ] [-Credential ] [-UseDefaultCredentials] [-Cache] [-AsByte] [-AsJob] -MapParameter [] +``` +--- + + diff --git a/docs/Invoke-GitHubRestAPI.md b/docs/Invoke-GitHubRestAPI.md new file mode 100644 index 00000000..65a7715f --- /dev/null +++ b/docs/Invoke-GitHubRestAPI.md @@ -0,0 +1,284 @@ + +Invoke-GitHubRestAPI +-------------------- +### Synopsis +Invokes the Git Rest API + +--- +### Description + +Invokes the GitHub REST API + +--- +### Related Links +* [Invoke-RestMethod](https://docs.microsoft.com/powershell/module/Microsoft.PowerShell.Utility/Invoke-RestMethod) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +# Uses the Azure DevOps REST api to get builds from a project +$org = 'StartAutomating' +$repo = 'PSDevOps' +Invoke-GitRestAPI "https://api.github.com/repos/StartAutomating/PSDevOps" +``` + +--- +### Parameters +#### **Uri** + +The REST API Url + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **Method** + +Specifies the method used for the web request. The acceptable values for this parameter are: + - Default + - Delete + - Get + - Head + - Merge + - Options + - Patch + - Post + - Put + - Trace + + + +Valid Values: + +* GET +* DELETE +* HEAD +* MERGE +* OPTIONS +* PATCH +* POST +* PUT +* TRACE +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Body** + +Specifies the body of the request. +If this value is a string, it will be passed as-is +Otherwise, this value will be converted into JSON. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Object]```|false |named |true (ByPropertyName)| +--- +#### **UrlParameter** + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **QueryParameter** + +Additional parameters provided in the query string. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **PersonalAccessToken** + +A Personal Access Token + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Page** + +The page number. If provided, will only get one page of results. +If this is not provided, additional results will be fetched until they are exhausted. + + + +|Type |Requried|Postion|PipelineInput| +|-------------|--------|-------|-------------| +|```[Int32]```|false |named |false | +--- +#### **PerPage** + +The number of items to retreive on a single page. + + + +|Type |Requried|Postion|PipelineInput| +|-------------|--------|-------|-------------| +|```[Int32]```|false |named |false | +--- +#### **PSTypeName** + +The typename of the results. +If not set, will be the depluralized last non-variable segment of a URL. +(i.e. "https://api.github.com/user/repos" would use a typename of 'repos' +so would: "https://api.github.com/users/{UserName}/repos") + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **Property** + +A set of additional properties to add to an object + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **RemoveProperty** + +A list of property names to remove from an object + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **ExpandProperty** + +If provided, will expand a given property returned from the REST api. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **DecorateProperty** + +If provided, will decorate the values within a property in the return object. +This allows nested REST properties to work with the PowerShell Extended Type System. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **Cache** + +If set, will cache results from a request. Only HTTP GET results will be cached. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **AsJob** + +If set, will run as a background job. +This parameter will be ignored if the caller is piping the results of Invoke-ADORestAPI. +This parameter will also be ignore when calling with -DynamicParameter or -MapParameter. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **DynamicParameter** + +If set, will get the dynamic parameters that should be provided to any function that wraps Invoke-ADORestApi + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **MapParameter** + +If set, will return the parameters for any function that can be passed to Invoke-ADORestApi. +Unmapped parameters will be added as a noteproperty of the returned dictionary. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|true |named |true (ByPropertyName)| +--- +#### **GitApiUrl** + +The GitAPIUrl +This will used if -Uri does not contain a hostname. +It will default to $env:GIT_API_URL if it is set, otherwise 'https://api.github.com/' + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ContentType** + +Specifies the content type of the web request. +If this parameter is omitted and the request method is POST, Invoke-RestMethod sets the content type to application/x-www-form-urlencoded. Otherwise, the content type is not specified in the call. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Headers** + +Specifies the headers of the web request. Enter a hash table or dictionary. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **UserAgent** + +Provides a custom user agent. GitHub API requests require a User Agent. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +### Outputs +System.Management.Automation.PSObject + + +--- +### Syntax +```PowerShell +Invoke-GitHubRestAPI [-Uri ] [-Method ] [-Body ] [-UrlParameter ] [-QueryParameter ] [-PersonalAccessToken ] [-Page ] [-PerPage ] [-PSTypeName ] [-Property ] [-RemoveProperty ] [-ExpandProperty ] [-DecorateProperty ] [-Cache] [-AsJob] [-GitApiUrl ] [-ContentType ] [-Headers ] [-UserAgent ] [] +``` +```PowerShell +Invoke-GitHubRestAPI [-PersonalAccessToken ] [-Cache] [-AsJob] -DynamicParameter [] +``` +```PowerShell +Invoke-GitHubRestAPI [-PersonalAccessToken ] [-Cache] [-AsJob] -MapParameter [] +``` +--- + + diff --git a/docs/New-ADOArtifactFeed.md b/docs/New-ADOArtifactFeed.md new file mode 100644 index 00000000..8cc3c16a --- /dev/null +++ b/docs/New-ADOArtifactFeed.md @@ -0,0 +1,239 @@ + +New-ADOArtifactFeed +------------------- +### Synopsis +Creates artifact feeds and views in Azure DevOps + +--- +### Description + +Creates artifact feeds and feed views in Azure DevOps. + +Artifact feeds are used to publish packages. + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/artifacts/feed%20%20management/create%20feed?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/artifacts/feed%20%20management/create%20feed?view=azure-devops-rest-5.1) +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/artifacts/feed%20%20management/create%20feed%20view?view=azure-devops-rest-5.1#feedvisibility](https://docs.microsoft.com/en-us/rest/api/azure/devops/artifacts/feed%20%20management/create%20feed%20view?view=azure-devops-rest-5.1#feedvisibility) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +New-ADOArtifactFeed -Organization MyOrg -Project MyProject -Name Builds -Description "Builds of MyProject" +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The Project + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Name** + +The Feed Name +?<> -LiteralCharacter '|?/\:&$*"[]>' -CharacterClass Whitespace -Not -Repeat -StartAnchor StringStart -EndAnchor StringEnd + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Description** + +The feed description. +?<> -CharacterClass Any -Min 1 -Max 255 -StartAnchor StringStart -EndAnchor StringEnd + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **NoBadge** + +If set, this feed will not support the generation of package badges. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **PublicUpstream** + +If provided, will allow upstream sources from public repositories. +Upstream sources allow your packages to depend on packages in public repositories or private feeds. + + + +Valid Values: + +* NPM +* NuGet +* PyPi +* Maven +* PowerShellGallery +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **UpstreamSource** + +A property bag describing upstream sources + + + +|Type |Requried|Postion|PipelineInput | +|------------------|--------|-------|---------------------| +|```[PSObject[]]```|false |named |true (ByPropertyName)| +--- +#### **AllowConflictUpstream** + +If set, will allow package names to conflict with the names of packages upstream. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **IsReadOnly** + +If set, all packages in the feed are immutable. +It is important to note that feed views are immutable; therefore, this flag will always be set for views. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **FeedID** + +The feed id. This can be supplied to create a veiw for a particular feed. + + + +|Type |Requried|Postion|PipelineInput | +|------------|--------|-------|---------------------| +|```[Guid]```|false |named |true (ByPropertyName)| +--- +#### **ShowDeletedPackageVersions** + +If set, the feed will not hide all deleted/unpublished versions + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **FeedRole** + +The Feed Role + + + +Valid Values: + +* Administrator +* Collaborator +* Contributor +* Reader +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **View** + +If set, will create a new view for an artifact feed. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|true |named |true (ByPropertyName)| +--- +#### **ViewVisibility** + +The visibility of the view. By default, the view will be visible to the entire organization. + + + +Valid Values: + +* Collection +* Organization +* Private +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://feeds.dev.azure.com/. + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.ArtifactFeed + + +PSDevOps.ArtifactFeed.View + + +--- +### Syntax +```PowerShell +New-ADOArtifactFeed -Organization [-Project ] -Name [-Description ] [-NoBadge] [-PublicUpstream ] [-UpstreamSource ] [-AllowConflictUpstream] [-IsReadOnly] [-FeedID ] [-ShowDeletedPackageVersions] [-FeedRole ] [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +```PowerShell +New-ADOArtifactFeed -Organization [-Project ] -Name -FeedID -View [-ViewVisibility ] [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/New-ADOBuild.md b/docs/New-ADOBuild.md new file mode 100644 index 00000000..96777f44 --- /dev/null +++ b/docs/New-ADOBuild.md @@ -0,0 +1,230 @@ + +New-ADOBuild +------------ +### Synopsis +Creates Azure DevOps Build Definitions + +--- +### Description + +Creates Build Definitions in Azure DevOps. + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/build/definitions/create](https://docs.microsoft.com/en-us/rest/api/azure/devops/build/definitions/create) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +New-ADOBuild -Organization StartAutomating -Project PSDevops -Name PSDevOps_CI -Repository @{ + id = 'StartAutomating/PSDevOps' + type = 'GitHub' + name = 'StartAutomating/PSDevOps' + url = 'https://github.com/StartAutomating/PSDevOps.git' + defaultBranch = 'master' + properties = @{ + connectedServiceId = '2b65e3be-c457-4d61-b457-d883fb231ff2' + } +} -YAMLFilename azure-pipelines.yml +``` + +--- +### Parameters +#### **Organization** + +The Organization. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **Project** + +The Project + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |2 |true (ByPropertyName)| +--- +#### **Name** + +The name of the build. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |3 |true (ByPropertyName)| +--- +#### **Path** + +The folder path of the definition. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |4 |true (ByPropertyName)| +--- +#### **YAMLFileName** + +The path to a YAML file containing the build definition + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |5 |true (ByPropertyName)| +--- +#### **Comment** + +A comment about the build defintion revision. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |6 |true (ByPropertyName)| +--- +#### **Description** + +A description of the build definition. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |7 |true (ByPropertyName)| +--- +#### **DropLocation** + +The drop location for the build + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |8 |true (ByPropertyName)| +--- +#### **BuildNumberFormat** + +The build number format + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |9 |true (ByPropertyName)| +--- +#### **Repository** + +The repository used by the build definition. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[PSObject]```|true |10 |true (ByPropertyName)| +--- +#### **Queue** + +The queue used by the build definition. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[PSObject]```|false |11 |true (ByPropertyName)| +--- +#### **Demand** + +A collection of demands for the build definition. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |12 |true (ByPropertyName)| +--- +#### **Variable** + +A collection of variables for the build definition. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |13 |true (ByPropertyName)| +--- +#### **Secret** + +A collection of secrets for the build definition. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |14 |true (ByPropertyName)| +--- +#### **Tag** + +A list of tags for the build definition. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |15 |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |16 |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |17 |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.Build.Definition + + +--- +### Syntax +```PowerShell +New-ADOBuild [-Organization] [-Project] [-Name] [[-Path] ] [[-YAMLFileName] ] [[-Comment] ] [[-Description] ] [[-DropLocation] ] [[-BuildNumberFormat] ] [-Repository] [[-Queue] ] [[-Demand] ] [[-Variable] ] [[-Secret] ] [[-Tag] ] [[-Server] ] [[-ApiVersion] ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/New-ADOField.md b/docs/New-ADOField.md new file mode 100644 index 00000000..114338ec --- /dev/null +++ b/docs/New-ADOField.md @@ -0,0 +1,218 @@ + +New-ADOField +------------ +### Synopsis +Creates new fields in Azure DevOps + +--- +### Description + +Creates new work item fields in Azure DevOps or Team Foundation Server. + +--- +### Related Links +* [Invoke-ADORestAPI](Invoke-ADORestAPI.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +New-ADOField -Name Verb -ReferenceName Cmdlet.Verb -Description "The PowerShell Verb" -ValidValue (Get-Verb | Select-Object -ExpandProperty Verb | Sort-Object) -Organization MyOrganization +``` + +#### EXAMPLE 2 +```PowerShell +New-ADOField -Name IsDCR -Type Boolean -Description "Is this a direct custom request?" -Organization MyOrganization +``` + +--- +### Parameters +#### **Name** + +The friendly name of the field + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **ReferenceName** + +The reference name of the field. This is the name used in queries. +If not provided, the ReferenceName will Custom. + -Name (stripped of whitespace) + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |2 |true (ByPropertyName)| +--- +#### **Type** + +The type of the field. + +This can be any of the following: +* boolean +* dateTime +* double +* guid +* history +* html +* identity +* integer +* plainText +* string +* treePath + + + +Valid Values: + +* boolean +* dateTime +* double +* guid +* history +* html +* identity +* integer +* picklistDouble +* picklistInteger +* picklistString +* plainText +* string +* treePath +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |3 |true (ByPropertyName)| +--- +#### **Description** + +A description for the field. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |4 |true (ByPropertyName)| +--- +#### **ValidValue** + +A list of valid values. +If provided, an associated picklist will be created with these values. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |5 |true (ByPropertyName)| +--- +#### **CanSortBy** + +If set, the field can be used to sort. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **IsQueryable** + +If set, the field can be used in queries. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **ReadOnly** + +If set, the field will be read only. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **AllowCustomValue** + +If set, custom values can be provided into the field. +This is ignored if not used with -ValidValue. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |6 |true (ByPropertyName)| +--- +#### **Project** + +The Project + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |7 |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |8 |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |9 |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.Field + + +--- +### Syntax +```PowerShell +New-ADOField [-Name] [[-ReferenceName] ] [[-Type] ] [[-Description] ] [[-ValidValue] ] [-CanSortBy] [-IsQueryable] [-ReadOnly] [-AllowCustomValue] [-Organization] [[-Project] ] [[-Server] ] [[-ApiVersion] ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/New-ADOPipeline.md b/docs/New-ADOPipeline.md new file mode 100644 index 00000000..189d8c90 --- /dev/null +++ b/docs/New-ADOPipeline.md @@ -0,0 +1,180 @@ + +New-ADOPipeline +--------------- +### Synopsis +Creates a new ADO Pipeline + +--- +### Description + +Create a new Azure DevOps Pipeline. + +--- +### Related Links +* [Convert-BuildStep](Convert-BuildStep.md) +* [Import-BuildStep](Import-BuildStep.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +New-ADOPipeline -Trigger SourceChanged -Stage PowerShellStaticAnalysis,TestPowerShellCrossPlatForm, UpdatePowerShellGallery +``` + +#### EXAMPLE 2 +```PowerShell +New-ADOPipeline -Trigger SourceChanged -Stage PowerShellStaticAnalysis,TestPowerShellCrossPlatForm, UpdatePowerShellGallery -Option @{RunPester=@{env=@{"SYSTEM_ACCESSTOKEN"='$(System.AccessToken)'}}} +``` + +--- +### Parameters +#### **InputObject** + +The InputObject + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|--------------| +|```[PSObject]```|false |1 |true (ByValue)| +--- +#### **UseSystemAccessToken** + +If set, will use map the system access token to an environment variable in each script step. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **Option** + +Optional changes to a part. +A table of additional settings to apply wherever a part is used. +For example -Option @{RunPester=@{env=@{"SYSTEM_ACCESSTOKEN"='$(System.AccessToken)'}} + + + +|Type |Requried|Postion|PipelineInput| +|-------------------|--------|-------|-------------| +|```[IDictionary]```|false |2 |false | +--- +#### **VariableParameter** + +The name of parameters that should be supplied from build variables. +Wildcards accepted. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |3 |true (ByPropertyName)| +--- +#### **EnvironmentParameter** + +The name of parameters that should be supplied from the environment. +Wildcards accepted. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |4 |true (ByPropertyName)| +--- +#### **ExcludeParameter** + +The name of parameters that should be excluded. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |5 |true (ByPropertyName)| +--- +#### **UniqueParameter** + +The name of parameters that should be referred to uniquely. +For instance, if converting function foo($bar) {} and -UniqueParameter is 'bar' +The build parameter would be foo_bar. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |6 |true (ByPropertyName)| +--- +#### **DefaultParameter** + +A collection of default parameters. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |7 |true (ByPropertyName)| +--- +#### **BuildScript** + +A list of build scripts. Each build script will run as a step in the same job. + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[String[]]```|false |8 |false | +--- +#### **PassThru** + +If set, will output the created objects instead of creating YAML. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **PowerShellCore** + +If set, will run scripts using PowerShell core, even if on Windows. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **WindowsPowerShell** + +If set will run script using WindowsPowerShell if available. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **RootDirectory** + +If provided, will directly reference build steps beneath this directory. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |9 |false | +--- +### Outputs +System.String + + +System.Management.Automation.PSObject + + +--- +### Syntax +```PowerShell +New-ADOPipeline [[-InputObject] ] [-UseSystemAccessToken] [[-Option] ] [[-VariableParameter] ] [[-EnvironmentParameter] ] [[-ExcludeParameter] ] [[-UniqueParameter] ] [[-DefaultParameter] ] [[-BuildScript] ] [-PassThru] [-PowerShellCore] [-WindowsPowerShell] [[-RootDirectory] ] [] +``` +--- + + diff --git a/docs/New-ADOProject.md b/docs/New-ADOProject.md new file mode 100644 index 00000000..fea526cc --- /dev/null +++ b/docs/New-ADOProject.md @@ -0,0 +1,132 @@ + +New-ADOProject +-------------- +### Synopsis +Creates new projects in Azure DevOps. + +--- +### Description + +Creates new projects in Azure DevOps or TFS. + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/core/projects/list?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/core/projects/list?view=azure-devops-rest-5.1) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +New-ADOProject -Organization StartAutomating -Project Formulaic -PersonalAccessToken $pat +``` + +--- +### Parameters +#### **Name** + +The name of the project. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **Description** + +The project description. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |2 |true (ByPropertyName)| +--- +#### **Process** + +The process template used by the project. By default, 'Agile' + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |3 |true (ByPropertyName)| +--- +#### **Public** + +If set, the project will be created as a public project. +If not set, the project will be created as a private project. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **Abbreviation** + +The project abbreviation + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |4 |false | +--- +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |5 |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |6 |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |7 |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.Project + + +--- +### Syntax +```PowerShell +New-ADOProject [-Name] [-Description] [[-Process] ] [-Public] [[-Abbreviation] ] [-Organization] [[-Server] ] [[-ApiVersion] ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/New-ADORepository.md b/docs/New-ADORepository.md new file mode 100644 index 00000000..0366a7bf --- /dev/null +++ b/docs/New-ADORepository.md @@ -0,0 +1,125 @@ + +New-ADORepository +----------------- +### Synopsis +Creates repositories in Azure DevOps + +--- +### Description + +Creates a new repository in Azure DevOps. + +--- +### Related Links +* [Get-ADORepository](Get-ADORepository.md) +* [Remove-ADORepository](Remove-ADORepository.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +New-ADORepository -Organization StartAutomating -Project PSDevOps -RepositoryName NewRepo -WhatIf +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **Project** + +The Project + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |2 |true (ByPropertyName)| +--- +#### **RepositoryName** + +The name of the repository + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |3 |true (ByPropertyName)| +--- +#### **UpstreamName** + +The name of the upstream repository (this creates a forked repository from the same project) + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |4 |true (ByPropertyName)| +--- +#### **UpstreamID** + +The ID of an upstream repository (this creates a forked repository) + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |5 |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |6 |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |7 |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.Repository + + +hashtable + + +--- +### Syntax +```PowerShell +New-ADORepository [-Organization] [-Project] [-RepositoryName] [[-UpstreamName] ] [[-UpstreamID] ] [[-Server] ] [[-ApiVersion] ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/New-ADOServiceEndpoint.md b/docs/New-ADOServiceEndpoint.md new file mode 100644 index 00000000..0347ace6 --- /dev/null +++ b/docs/New-ADOServiceEndpoint.md @@ -0,0 +1,193 @@ + +New-ADOServiceEndpoint +---------------------- +### Synopsis +Creates Azure DevOps Service Endpoints + +--- +### Description + +Creates Service Endpoints in Azure DevOps. + +Service Endpoints are used to connect an Azure DevOps project to one or more web services. + +To see the types of service endpoints, use Get-ADOServiceEndpoint -GetEndpointType + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints/create?view=azure-devops-rest-5.1](https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints/create?view=azure-devops-rest-5.1) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +New-ADOServiceEndpoint -Organization MyOrg -Project MyProject -Name MyGitHubConnection -Url https://github.com -Type GitHub -Authorization @{ + scheme = 'PersonalAccessToken' + parameters = @{ + accessToken = $MyGitHubPersonalAccessToken + } +} -PersonalAccessToken $MyAzureDevOpsPersonalAccessToken -Data @{pipelinesSourceProvider='github'} +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **Project** + +The Project + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |2 |true (ByPropertyName)| +--- +#### **Name** + +The name of the endpoint + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |3 |true (ByPropertyName)| +--- +#### **AdministratorsGroup** + +Initial administrators of the endpoint + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[PSObject]```|false |4 |true (ByPropertyName)| +--- +#### **Authorization** + +Endpoint authorization data + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[PSObject]```|false |5 |true (ByPropertyName)| +--- +#### **Data** + +General endpoint data + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[PSObject]```|false |6 |true (ByPropertyName)| +--- +#### **ReadersGroup** + +Initial readers of the endpoint + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[PSObject]```|false |7 |true (ByPropertyName)| +--- +#### **Type** + +The endpoint type. To see available endpoint types, use Get-ADOServiceEndpoint -GetEndpointType + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |8 |true (ByPropertyName)| +--- +#### **Description** + +The endpoint description. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |9 |true (ByPropertyName)| +--- +#### **Url** + +The endpoint service URL. + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |10 |true (ByPropertyName)| +--- +#### **IsShared** + +If set, the endpoint will be shared across projects + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |11 |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1-preview. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |12 |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.ServiceEndpoint + + +hashtable + + +--- +### Syntax +```PowerShell +New-ADOServiceEndpoint [-Organization] [-Project] [-Name] [[-AdministratorsGroup] ] [[-Authorization] ] [[-Data] ] [[-ReadersGroup] ] [[-Type] ] [[-Description] ] [[-Url] ] [-IsShared] [[-Server] ] [[-ApiVersion] ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/New-ADOWorkItem.md b/docs/New-ADOWorkItem.md new file mode 100644 index 00000000..2487b84e --- /dev/null +++ b/docs/New-ADOWorkItem.md @@ -0,0 +1,257 @@ + +New-ADOWorkItem +--------------- +### Synopsis +Creates new work items in Azure DevOps + +--- +### Description + +Creates new work items in Azure DevOps or Team Foundation Server. + +--- +### Related Links +* [Invoke-ADORestAPI](Invoke-ADORestAPI.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +@{ Title='New Work Item'; Description='A Description of the New Work Item' } | + New-ADOWorkItem -Organization StartAutomating -Project PSDevOps -Type Issue +``` + +--- +### Parameters +#### **InputObject** + +The InputObject + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|------------------------------| +|```[PSObject]```|true |named |true (ByValue, ByPropertyName)| +--- +#### **Type** + +The type of the work item. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **QueryName** + +If set, will create a shared query for work items. The -InputObject will be passed to the body. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **QueryPath** + +If provided, will create shared queries beneath a given folder. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **WIQL** + +If provided, create a shared query with a given WIQL. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **QueryType** + +If provided, the shared query created may be hierchical + + + +Valid Values: + +* Flat +* OneHop +* Tree +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **QueryRecursiveOption** + +The recursion option for use in a tree query. + + + +Valid Values: + +* childFirst +* parentFirst +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **FolderName** + +If provided, create a shared query folder. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **ParentID** + +The work item ParentID + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Project** + +The Project + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Relationship** + +A collection of relationships for the work item. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **Comment** + +A list of comments to be added to the work item. + + + +|Type |Requried|Postion|PipelineInput | +|------------------|--------|-------|---------------------| +|```[PSObject[]]```|false |named |true (ByPropertyName)| +--- +#### **Tag** + +A list of tags to assign to the work item. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **BypassRule** + +If set, will not validate rules. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **ValidateOnly** + +If set, will only validate rules, but will not update the work item. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **SupressNotification** + +If set, will only validate rules, but will not update the work item. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.WorkItem + + +--- +### Syntax +```PowerShell +New-ADOWorkItem -InputObject -Type [-ParentID ] -Organization -Project [-Relationship ] [-Comment ] [-Tag ] [-BypassRule] [-ValidateOnly] [-SupressNotification] [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +```PowerShell +New-ADOWorkItem -QueryName [-QueryPath ] -WIQL [-QueryType ] [-QueryRecursiveOption ] -Organization -Project [-Tag ] [-ValidateOnly] [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +```PowerShell +New-ADOWorkItem [-QueryPath ] -FolderName -Organization -Project [-Tag ] [-ValidateOnly] [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/New-ADOWorkItemType.md b/docs/New-ADOWorkItemType.md new file mode 100644 index 00000000..4583aa72 --- /dev/null +++ b/docs/New-ADOWorkItemType.md @@ -0,0 +1,351 @@ + +New-ADOWorkItemType +------------------- +### Synopsis +Creates custom work item types + +--- +### Description + +Creates custom work item types in Azure DevOps. + +Also creates custom rules or states for a work item type. + +--- +### Related Links +* [Get-ADOWorkItemType](Get-ADOWorkItemType.md) +* [Remove-ADOWorkItemType](Remove-ADOWorkItemType.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOProject -Organization StartAutomating -Project PSDevOps | + Get-ADOWorkProcess | + New-ADOWorkItemType -Name ServiceRequest -Color 'ddee00' -Icon icon_flame +``` + +#### EXAMPLE 2 +```PowerShell +Get-ADOProject -Organization StartAutomating -Project PSDevOps | # Get a project + Get-ADOWorkProcess | # Get it's process + Get-ADOWorkItemType| # Get work item types + Where-Object Name -eq 'Cmdlet' | # Filter the cmdlet type + New-ADOWorkItemType -State Cancelled -Color 'ff2200' -StateCategory Removed # create a new state. +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **ProcessID** + +The process identifier. This can be piped in from Get-ADOWorkProcess. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Name** + +The name of the custom work item type, custom work item type state, custom work item type rule, or custom work item type behavior. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **Icon** + +The name of the icon used for the custom work item. +To list available icons, use Get-ADOWorkItemType -Icon + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **Color** + +The color of the work item type or state. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **Description** + +The description for the custom work item type. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **InheritsFrom** + +The work item type the custom work item should inherit, or the backlog behavior that should be inherited. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **IsDisabled** + +If set, will create the work item type disabled. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **BehaviorID** + +If set, will associate a given work item type with a behavior (for instance, adding a type of work item to be displayed in a backlog) + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **IsDefault** + +If set, will make the given work item type the default within a particular behavior (for instance, making the work item type the default type of a backlog). + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Behavior** + +If set, will create a new state for a custom work item instead of a custom work item. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **ReferenceName** + +The Reference Name of a WorkItemType. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |named |true (ByPropertyName)| +--- +#### **State** + +If set, will create a new state for a custom work item instead of a custom work item. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|true |named |false | +--- +#### **Order** + +The order of the a custom state for a custom work item. + + + +|Type |Requried|Postion|PipelineInput| +|-------------|--------|-------|-------------| +|```[Int32]```|false |named |false | +--- +#### **StateCategory** + +The state category of a custom state for a custom work item. + + + +Valid Values: + +* Proposed +* InProgress +* Resolved +* Completed +* Removed +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|true |named |false | +--- +#### **RuleConditionType** + +The type of work item rule to create. + + + +Valid Values: + +* when +* whenChanged +* whenNot +* whenNotChanged +* whenStateChangedFromAndTo +* whenStateChangedTo +* whenValueIsDefined +* whenValueIsNotDefined +* whenWas +* whenWorkItemIsCreated +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|true |named |true (ByPropertyName)| +--- +#### **Field** + +The field for a given rule condition. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **Value** + +The value of a given rule condition. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **RuleActionType** + +The type of action run when the work item rule is triggered. + + + +Valid Values: + +* copyFromClock +* copyFromCurrentUser +* copyFromField +* copyFromServerClock +* copyFromServerCurrentUser +* copyValue +* makeReadOnly +* makeRequired +* setDefaultFromClock +* setDefaultFromCurrentUser +* setDefaultFromField +* setDefaultValue +* setValueToEmpty +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|true |named |true (ByPropertyName)| +--- +#### **TargetField** + +The target field for a given rule action. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **TargetValue** + +The target value for a given rule action. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |named |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.WorkItemType + + +PSDevOps.Rule + + +PSDevOps.State + + +PSDevOps.Behavior + + +--- +### Syntax +```PowerShell +New-ADOWorkItemType -Organization -ProcessID [-Name] [-Icon ] -Color [-Description ] [-InheritsFrom ] [-IsDisabled] [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +```PowerShell +New-ADOWorkItemType -Organization -ProcessID [-Name] -Color -InheritsFrom -Behavior [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +```PowerShell +New-ADOWorkItemType -Organization -ProcessID [-BehaviorID ] [-IsDefault] -ReferenceName [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +```PowerShell +New-ADOWorkItemType -Organization -ProcessID [-Name] -Color -ReferenceName -State [-Order ] -StateCategory [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +```PowerShell +New-ADOWorkItemType -Organization -ProcessID [-Name] -ReferenceName -RuleConditionType [-Field ] [-Value ] -RuleActionType [-TargetField ] [-TargetValue ] [-Server ] [-ApiVersion ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/New-ADOWorkProcess.md b/docs/New-ADOWorkProcess.md new file mode 100644 index 00000000..80155b6c --- /dev/null +++ b/docs/New-ADOWorkProcess.md @@ -0,0 +1,137 @@ + +New-ADOWorkProcess +------------------ +### Synopsis +Creates work processes in ADO. + +--- +### Description + +Creates work processes in Azure DevOps. + +Must provide a -Name + +Can Provide: +* -Description +* -ParentProcessID (can be piped in, will default to the ID for 'Agile') +* -ReferenceName + +--- +### Related Links +* [https://docs.microsoft.com/en-us/rest/api/azure/devops/processes/processes/create](https://docs.microsoft.com/en-us/rest/api/azure/devops/processes/processes/create) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Get-ADOWorkProcess -Organization StartAutomating -PersonalAccessToken $pat | + Where-Object Name -Ne TheNameOfTheCurrentProcess | + Set-ADOWorkProcess -Disable +``` + +#### EXAMPLE 2 +```PowerShell +Get-ADOProject -Organization StartAutomating -PersonalAccessToken $pat | + Get-ADOWorkProcess | + Set-ADOWorkPrcoess -Description "Updating Description" +``` + +--- +### Parameters +#### **Organization** + +The Organization + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |1 |true (ByPropertyName)| +--- +#### **Name** + +The name of the work process + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|true |2 |true (ByPropertyName)| +--- +#### **Description** + +A description of the work process. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |3 |true (ByPropertyName)| +--- +#### **ParentProcessID** + +The parent process identifier. If not provided, will default to the process ID for 'Agile'. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |4 |true (ByPropertyName)| +--- +#### **ReferenceName** + +A reference name for the work process. If one is not provided, Azure Devops will automatically generate one. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |5 |true (ByPropertyName)| +--- +#### **Server** + +The server. By default https://dev.azure.com/. +To use against TFS, provide the tfs server URL (e.g. http://tfsserver:8080/tfs). + + + +|Type |Requried|Postion|PipelineInput | +|-----------|--------|-------|---------------------| +|```[Uri]```|false |6 |true (ByPropertyName)| +--- +#### **ApiVersion** + +The api version. By default, 5.1. +If targeting TFS, this will need to change to match your server version. +See: https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning?view=azure-devops + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |7 |false | +--- +#### **WhatIf** +-WhatIf is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-WhatIf is used to see what would happen, or return operations without executing them +#### **Confirm** +-Confirm is an automatic variable that is created when a command has ```[CmdletBinding(SupportsShouldProcess)]```. +-Confirm is used to -Confirm each operation. + +If you pass ```-Confirm:$false``` you will not be prompted. + + +If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$confirmImpactPreference```, you will not be prompted unless -Confirm is passed. + +--- +### Outputs +PSDevOps.WorkProcess + + +--- +### Syntax +```PowerShell +New-ADOWorkProcess [-Organization] [-Name] [[-Description] ] [[-ParentProcessID] ] [[-ReferenceName] ] [[-Server] ] [[-ApiVersion] ] [-WhatIf] [-Confirm] [] +``` +--- + + diff --git a/docs/New-GitHubAction.md b/docs/New-GitHubAction.md new file mode 100644 index 00000000..da4a708d --- /dev/null +++ b/docs/New-GitHubAction.md @@ -0,0 +1,200 @@ + +New-GitHubAction +---------------- +### Synopsis +Creates a new GitHub action + +--- +### Description +--- +### Related Links +* [New-GitHubWorkflow](New-GitHubWorkflow.md) +* [Import-BuildStep](Import-BuildStep.md) +* [Convert-BuildStep](Convert-BuildStep.md) +* [Expand-BuildStep](Expand-BuildStep.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +New-GitHubAction -Job TestPowerShellOnLinux +``` + +--- +### Parameters +#### **Name** + +The name of the action. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|true |1 |false | +--- +#### **Description** + +A description of the action. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|true |1 |false | +--- +#### **Action** + +The git hub action steps. +While we don't want to restrict the steps here, we _do_ want to be able to suggest steps that are built-in. + + + +|Type |Requried|Postion|PipelineInput | +|------------------|--------|-------|---------------------| +|```[PSObject[]]```|false |named |true (ByPropertyName)| +--- +#### **DockerImage** + +The DockerImage used for a GitHub Action. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **NodeJSScript** + +The NodeJS main script used for a GitHub Action. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |named |true (ByPropertyName)| +--- +#### **ActionInput** + +The git hub action inputs. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **ActionOutput** + +The git hub action outputs. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **Option** + +Optional changes to a component. +A table of additional settings to apply wherever a part is used. +For example -Option @{RunPester=@{env=@{"SYSTEM_ACCESSTOKEN"='$(System.AccessToken)'}} + + + +|Type |Requried|Postion|PipelineInput| +|-------------------|--------|-------|-------------| +|```[IDictionary]```|false |named |false | +--- +#### **ExcludeParameter** + +The name of parameters that should be excluded. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **UniqueParameter** + +The name of parameters that should be referred to uniquely. +For instance, if converting function foo($bar) {} and -UniqueParameter is 'bar' +The build parameter would be foo_bar. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |named |true (ByPropertyName)| +--- +#### **DefaultParameter** + +A collection of default parameters. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |named |true (ByPropertyName)| +--- +#### **PassThru** + +If set, will output the created objects instead of creating YAML. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **BuildScript** + +A list of build scripts. Each build script will run as a step in the action. + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[String[]]```|false |named |false | +--- +#### **Icon** + +The icon used for branding. By default, a terminal icon. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +#### **Color** + +The color used for branding. By default, blue. + + + +Valid Values: + +* white +* yellow +* blue +* green +* orange +* red +* purple +* gray-dark +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |named |false | +--- +### Outputs +System.String + + +--- +### Syntax +```PowerShell +New-GitHubAction [-Name] [-Description] [-Action ] [-DockerImage ] [-NodeJSScript ] [-ActionInput ] [-ActionOutput ] [-Option ] [-ExcludeParameter ] [-UniqueParameter ] [-DefaultParameter ] [-PassThru] [-BuildScript ] [-Icon ] [-Color ] [] +``` +--- + + diff --git a/docs/New-GitHubWorkflow.md b/docs/New-GitHubWorkflow.md new file mode 100644 index 00000000..3ce57427 --- /dev/null +++ b/docs/New-GitHubWorkflow.md @@ -0,0 +1,154 @@ + +New-GitHubWorkflow +------------------ +### Synopsis +Creates a new GitHub Workflow + +--- +### Description +--- +### Related Links +* [Import-BuildStep](Import-BuildStep.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +New-GitHubWorkflow -Job TestPowerShellOnLinux +``` + +--- +### Parameters +#### **InputObject** + +The input object. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|--------------| +|```[PSObject]```|false |1 |true (ByValue)| +--- +#### **Name** + +The name of the workflow. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |2 |false | +--- +#### **Option** + +Optional changes to a component. +A table of additional settings to apply wherever a part is used. +For example -Option @{RunPester=@{env=@{"SYSTEM_ACCESSTOKEN"='$(System.AccessToken)'}} + + + +|Type |Requried|Postion|PipelineInput| +|-------------------|--------|-------|-------------| +|```[IDictionary]```|false |3 |false | +--- +#### **Environment** + +A collection of environment variables used throughout the build. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |4 |true (ByPropertyName)| +--- +#### **InputParameter** + +The name of parameters that should be supplied from an event. +Wildcards accepted. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |5 |true (ByPropertyName)| +--- +#### **VariableParameter** + +The name of parameters that should be supplied from build variables. +Wildcards accepted. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |6 |true (ByPropertyName)| +--- +#### **ExcludeParameter** + +The name of parameters that should be excluded. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |7 |true (ByPropertyName)| +--- +#### **UniqueParameter** + +The name of parameters that should be referred to uniquely. +For instance, if converting function foo($bar) {} and -UniqueParameter is 'bar' +The build parameter would be foo_bar. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |8 |true (ByPropertyName)| +--- +#### **DefaultParameter** + +A collection of default parameters. + + + +|Type |Requried|Postion|PipelineInput | +|-------------------|--------|-------|---------------------| +|```[IDictionary]```|false |9 |true (ByPropertyName)| +--- +#### **PassThru** + +If set, will output the created objects instead of creating YAML. + + + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[Switch]```|false |named |false | +--- +#### **BuildScript** + +A list of build scripts. Each build script will run as a step in the same job. + + + +|Type |Requried|Postion|PipelineInput| +|----------------|--------|-------|-------------| +|```[String[]]```|false |10 |false | +--- +#### **RootDirectory** + +|Type |Requried|Postion|PipelineInput| +|--------------|--------|-------|-------------| +|```[String]```|false |11 |false | +--- +### Outputs +System.String + + +--- +### Syntax +```PowerShell +New-GitHubWorkflow [[-InputObject] ] [[-Name] ] [[-Option] ] [[-Environment] ] [[-InputParameter] ] [[-VariableParameter] ] [[-ExcludeParameter] ] [[-UniqueParameter] ] [[-DefaultParameter] ] [-PassThru] [[-BuildScript] ] [[-RootDirectory] ] [] +``` +--- + + diff --git a/docs/Push-Git.md b/docs/Push-Git.md new file mode 100644 index 00000000..dc5a93c9 --- /dev/null +++ b/docs/Push-Git.md @@ -0,0 +1,333 @@ + +Push-Git +-------- +### Synopsis +PowerShell Wrapper around git push + +--- +### Description + +Pushes changes to a git repository. + +--- +### Related Links +* [Add-Git](Add-Git.md) +* [Submit-Git](Submit-Git.md) +--- +### Examples +#### EXAMPLE 1 +```PowerShell +Push-Git +``` + +--- +### Parameters +#### **Repository** + +The argument. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[String]```|false |1 |true (ByPropertyName)| +--- +#### **ReferenceSpec** + +Specify what destination ref to update with what source object. +The format of a parameter is an optional plus +, +followed by the source object , followed by a colon :, +followed by the destination ref . + +The is often the name of the branch you would want to push, +but it can be any arbitrary "SHA-1 expression", +such as master~4 or HEAD (see gitrevisions(7)). + +The tells which ref on the remote side is updated with this push. +Arbitrary expressions cannot be used here, an actual ref must be named. +If git push [] without any argument is set to update +some ref at the destination with with remote..push configuration variable, + : part can be omitted—​such a push will update a ref that normally updates without any +on the command line. +Otherwise, missing : means to update the same ref as the . + +The object referenced by is used to update the reference on the remote side. +By default this is only allowed if is not a tag (annotated or lightweight), +and then only if it can fast-forward . + +By having the optional leading +, you can tell Git to update the ref even +if it is not allowed by default (e.g., it is not a fast-forward.) +This does not attempt to merge into . + +tag means the same as refs/tags/:refs/tags/. + +Pushing an empty allows you to delete the ref from the remote repository. + +The special refspec : (or +: to allow non-fast-forward updates) directs Git to push "matching" branches: +for every branch that exists on the local side, +the remote side is updated if a branch of the same name already exists on the remote side. + + + +|Type |Requried|Postion|PipelineInput | +|----------------|--------|-------|---------------------| +|```[String[]]```|false |2 |true (ByPropertyName)| +--- +#### **All** + +Push all branches (i.e. refs under refs/heads/); cannot be used with other . + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Prune** + +Remove remote branches that don’t have a local counterpart. +For example a remote branch tmp will be removed if a +local branch with the same name doesn’t exist any more. + +This also respects refspecs, e.g. +git push --prune remote refs/heads/*:refs/tmp/* +would make sure that remote refs/tmp/foo will be removed if refs/heads/foo doesn’t exist. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Mirror** + +Instead of naming each ref to push, +specifies that all refs under refs/ +(which includes but is not limited to refs/heads/, refs/remotes/, and refs/tags/) +be mirrored to the remote repository. + +Newly created local refs will be pushed to the remote end, +locally updated refs will be force updated on the remote end, +and deleted refs will be removed from the remote end. + +This is the default if the configuration option remote..mirror is set. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **DryRun** + +Do everything except actually send the updates. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Porcelain** + +Produce machine-readable output. +The output status line for each ref will be tab-separated and sent to stdout instead of stderr. +The full symbolic names of the refs will be given. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Delete** + +All listed refs are deleted from the remote repository. +This is the same as prefixing all refs with a colon. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Tag** + +All refs under refs/tags are pushed, in addition to refspecs explicitly listed on the command line. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **FollowTag** + +Push all the refs that would be pushed without this option, +and also push annotated tags in refs/tags that are missing from the remote +but are pointing at commit-ish that are reachable from the refs being pushed. + +This can also be specified with configuration variable push.followTags. + +For more information, see push.followTags in git-config(1). + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **Atomic** + +Use an atomic transaction on the remote side if available. Either all refs are updated, or on error, no refs are updated. +If the server does not support atomic pushes the push will fail. + + + +|Type |Requried|Postion|PipelineInput | +|--------------|--------|-------|---------------------| +|```[Switch]```|false |named |true (ByPropertyName)| +--- +#### **PushOption** + +Transmit the given string to the server, +which passes them to the pre-receive as well as the post-receive hook. + +The given string must not contain a NUL or LF character. +When multiple --push-option=