File tree Expand file tree Collapse file tree
AzureDevOpsPowerShell/Public/Helpers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ function Set-AzDoPAT {
2+ <#
3+ . SYNOPSIS
4+ This script sets the header variable with a PAT.
5+ . DESCRIPTION
6+ This script sets the header variable with a PAT.
7+ . NOTES
8+ This function can be used to use a PAT for authentication instead of an Azure PowerShell access token.
9+ . EXAMPLE
10+ Set-AzDoPAT -Pat '***'
11+
12+ This example sets the header variable used for authentication with a PAT.
13+ #>
14+ [CmdletBinding (SupportsShouldProcess )]
15+ param (
16+ # PAT used for authentication
17+ [Parameter (Mandatory , ValueFromPipelineByPropertyName , ValueFromPipeline )]
18+ [string ]
19+ $Pat
20+ )
21+
22+ process {
23+ if ($PSCmdlet.ShouldProcess ()) {
24+ New-AzDoAuthHeader - Pat $Pat
25+ } else {
26+ Write-Verbose " Calling New-AzDoAuthHeader with pat"
27+ }
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments