title | date | draft |
---|---|---|
1 Hello World |
2020-02-25 19:23:53 +0530 |
true |
Customary "Hello World" program.
# Set the PAT as an Environment variable, put this in your profile. | |
# I only use the CLI for read operations so make sure you grant the PAT only that access | |
$env:AZURE_DEVOPS_EXT_PAT = "<Insert PAT Token here>" | |
# configure the defaults for the Az DevOps extension for Az CLI to use | |
az devops configure --defaults organization=https://dev.azure.com/dexterposh project=Test.Project | |
# see the configured defaults | |
az devops configure --list |
apiVersion: apiextensions.k8s.io/v1 | |
kind: CustomResourceDefinition | |
metadata: | |
# name must match the spec fields below, and be in the form: <plural>.<group> | |
name: myplatforms.contoso.com | |
spec: | |
# group name to use for REST API: /apis/<group>/<version> | |
group: contoso.com | |
names: | |
# plural name to be used in the URL: /apis/<group>/<version>/<plural> |
$url = 'https://dev.azure.com/ddhami/BITPro.AzDeploy/_apis/distributedtask/environments' | |
$cred = Get-Credential -UserName 'vsts' -Message 'Enter AzDO Personal Access Token with privs to create env' | |
$encodedValue = [Convert]::ToBase64String( | |
[Text.Encoding]::ASCII.GetBytes( | |
("{0}:{1}" -f '', $cred.GetNetworkCredential().Password) | |
) | |
) | |
$body = @{ | |
name = 'test-pwsh-env'; |
$url = 'https://dev.azure.com/ddhami/BITPro.AzDeploy/_apis/distributedtask/environments' | |
$cred = Get-Credential -UserName 'vsts' -Message 'Enter AzDO Personal Access Token with privs to create env' | |
$encodedValue = [Convert]::ToBase64String( | |
[Text.Encoding]::ASCII.GetBytes( | |
("{0}:{1}" -f '', $cred.GetNetworkCredential().Password) | |
) | |
) | |
$body = @{ | |
name = 'test-pwsh-env'; |
{ | |
"$id": "1", | |
"innerException": null, | |
"message": "No api-version was supplied for the \"POST\" request. The version must be supplied either as part of the Accept header (e.g. \"application/json; api-version=1.0\") or as a query parameter (e.g. \"?api-version=1.0\").", | |
"typeName": "Microsoft.VisualStudio.Services.WebApi.VssVersionNotSpecifiedException, Microsoft.VisualStudio.Services.WebApi", | |
"typeKey": "VssVersionNotSpecifiedException", | |
"errorCode": 0, | |
"eventId": 3000 | |
} |
# fetch all the release pipelines metadata for the project | |
$ProjectName = 'BitPro.AzDeploy' | |
# Need the UserEmail as this is the unique name | |
$UserEmail = 'ddhami@foo.com' | |
# generate a list of User & Groups names to search for in the PR | |
$IDs = New-Object -TypeName System.Collections.ArrayList | |
$UserObject = az devops user show --user $UserEmail | ConvertFrom-Json | |
$IDs.Add($UserObject.Id) |
function Get-SCCMDeviceInfo | |
{ | |
[CmdletBinding(DefaultParameterSetName='Computer')] | |
[OutputType([PSObject])] | |
Param | |
( | |
# Specify the Package IDs which need to be removed from the DP | |
[Parameter(Mandatory, | |
ParameterSetName="Computer", |
func (settings settings) getAuthorizer() (autorest.Authorizer, error) { | |
//1.Client Credentials | |
if settings.clientSecret != "" { | |
config := NewClientCredentialsConfig(settings.clientID, settings.clientSecret, settings.tenantID) | |
config.AADEndpoint = settings.environment.ActiveDirectoryEndpoint | |
config.Resource = settings.resource | |
return config.Authorizer() | |
} | |
//2. Client Certificate |