en-US/about_psAzD.help.txt
TOPIC
about_psazd SHORT DESCRIPTION psAzD is a cross platform PowerShell module framework for Azure DevOps API. LONG DESCRIPTION psAzD is a cross platform PowerShell module framework for Azure DevOps API. Get all possible resource details from Azure DevOps for your organization using psAzD module. psAzD provides cmdlets for significant services in Azure DevOps which is cautiously developed to fetch details in granular level. Usage of each and every cmdlet can be viewed by running `Get-Help <cmdletName> -Full`. All the cmdlet's online help is linked to official documentation page of Azure DevOps so that you won't miss any update on how to use the module and respective cmdlet. Why? There may be scenarios where we need to retrieve information from API programmatically. To support such scenarios and to work with the vast Azure DevOps API services easily without worrying about constructing URI and many such things, SDK is required. API call with PowerShell's `Invoke-RestMethod` cmdlet does the magic for us when working with most of APIs. But, what if we are dealing with multiple services in Azure DevOps and needs number of API calls and dozens of foreach loops? This makes the script cumbersome and to run slower. Also, we have to construct URI every time we query the API and encode the Personal Access Token. psAzD tackles all these complex scenarios and outputs the same results as that of what other client SDKs or `Invoke-RestMethod` gives. Since the output is a `PSObject` it can then be used easily like any other objects inside PowerShell script. EXAMPLES - Run Get-Help <cmdletName> -Online # to show the official Azure DevOps API documentation for the particular service and resource. PS C:\> Get-Help Get-AzDCoreProjects -Online Running this cmdlets will open the Azure DevOps API documentation page for service `core` and `resource` projects. This works for all the cmdlets. - Get the list of Organization that you have access to # Note that you should grant access to your personal access token to all organizations that you are # a member of. Otherwise you will get 401 forbidden error (unauthorized) from API. # To get the list of organizations you should have a member Id or owner Id. # Member Id can be retrieved by running the cmdlet Get-AzDMEMUserEntitlements. This gives # the list of all available users and Ids. You can select your Id from the list and then # query API as shown below. PS C:\> Get-AzDAccounts -MemberId "your member Id here" # or # assuming that the result of cmdlet Get-AzDMEMUserEntitlements has its first value with your id. PS C:\> Get-AzDAccounts -MemberId (Get-AzDMEMUserEntitlements).members[0].id - Get list of projects in your organization # run Set-AzDDefaultParameters to set the default environmental variables PS C:\> Get-AzDCoreProjects - Get list of builds # run Set-AzDDefaultParameters to set the default environmental variables PS C:\> Get-AzDBuilds PS C:\> Get-AzDBuilds -Top 25 # This retrieves top 25 builds. - Create new project # create new project without mandatory parameter. This by default creates a scrum project. PS C:\> "MyProject" | New-AzDCoreProject PS C:\> New-AzDCoreProject ` -ProjectName Test ` -ProjectDescription "This is a test project" -SourceControlType "Git" ` -ProcessTemplateTypeId "6b724908-ef14-45cf-84f8-768b5384da45" Process Template Id can be obtained by running Get-AzDCoreProcesses. - Create new repository PS C:\> "MyRepository" | New-AzDGitRepository - Add tags to pull requests (of all status - completed/active). PS C:\> New-AzDGitPullRequestLabel ` -RepositoryId "repository id" ` -PullRequestId "pull request id" ` -LabelName "PowerShell" NOTE Most of the cmdlets require you to provide `OrganizationName`, `AzureDevOpsToken` and `ProjectName`. Setting all these as the default parameters helps to work with the module easily. TROUBLESHOOTING NOTE Most of the cmdlets comes with query parameters and this has to be handled in right way. All the mandatory query parameters for each cmdlet has to be specified to avoid any 401 error from API. SEE ALSO AzureDevOpsAPI KEYWORDS - Set-AzDDefaultParameters - Get-AzDOrganizationList - Get-AzDAccounts - Get-AzDCoreProjects - Get-AzDPolicyConfigurations - Get-AzDPolicyEvaluations |