This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo $@ | |
echo "start" | |
cd /home/azuredevopsuser | |
mkdir agent | |
cd agent | |
AGENTRELEASE="$(curl -s https://api.github.com/repos/Microsoft/azure-pipelines-agent/releases/latest | grep -oP '"tag_name": "v\K(.*)(?=")')" | |
AGENTURL="https://vstsagentpackage.azureedge.net/agent/${AGENTRELEASE}/vsts-agent-linux-x64-${AGENTRELEASE}.tar.gz" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[string]$URL, | |
[string]$PAT, | |
[string]$POOL, | |
[string]$AGENT | |
) | |
Write-Host "start" | |
if (test-path "c:\agent") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Prompt { | |
try { | |
$history = Get-History -ErrorAction Ignore -Count 1 | |
if ($history) { | |
Write-Host "[" -NoNewline | |
$ts = New-TimeSpan $history.StartExecutionTime $history.EndExecutionTime | |
switch ($ts) { | |
{$_.TotalSeconds -lt 1} { | |
[int]$d = $_.TotalMilliseconds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$subscriptionID = “<your-subscription-ID-goes-here>" | |
# Get AAD Access Token | |
$azContext = Get-AzContext | |
$azProfile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile | |
$profileClient = New-Object -TypeName Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient -ArgumentList ($azProfile) | |
$token = $profileClient.AcquireAccessToken($azContext.Subscription.TenantId) | |
$authHeader = @{ | |
'Authorization'='Bearer ' + $token.AccessToken | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
List all Azure VMs across all subscriptions | |
.DESCRIPTION | |
List all Azure VMs across all subscriptions | |
.NOTES | |
File Name : get-all-vms.ps1 | |
Author : Max Melcher ([email protected]) | |
Prerequisite : PowerShell with Azure module | |
License : Copyright 2020 Max Melcher |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
}, | |
"variables": { | |
}, | |
"resources": [ | |
{ | |
"type": "Microsoft.Network/virtualNetworks/subnets", |
OlderNewer