I hereby claim:
- I am maxmelcher on github.
- I am maxmelcher (https://keybase.io/maxmelcher) on keybase.
- I have a public key ASCgacYQpljLL6v7oEAepeDRniywArNynL4EoMHsn3C51Qo
To claim this, I am signing this object:
| { | |
| "$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", |
| <# | |
| .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 |
| $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 | |
| } |
| 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 |
| param ( | |
| [string]$URL, | |
| [string]$PAT, | |
| [string]$POOL, | |
| [string]$AGENT | |
| ) | |
| Write-Host "start" | |
| if (test-path "c:\agent") |
| #!/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" |
| #use this task to execute inline powershell in your build https://marketplace.visualstudio.com/items?itemName=petergroenewegen.PeterGroenewegen-Xpirit-Vsts-Build-InlinePowershell | |
| #add the script below | |
| #pass the following as arguments: -buildnumber $(Build.BuildNumber) -out $(Build.ArtifactStagingDirectory)\out.txt -guid $(System.TeamProjectId) | |
| #replace the two placeholders with a Personal Access Token and your VS Account name; the part behind https://dev.azure.com/ | |
| Param( | |
| [string]$buildnumber, | |
| [string]$out, | |
| [string]$guid | |
| ) |
I hereby claim:
To claim this, I am signing this object:
| <# | |
| .TERMS | |
| No terms - use on your own risk! | |
| .SYNOPSIS | |
| This script efficiently emtpties are large list and is approximately 30 times faster than deleting item by item. | |
| You need to have the SharePoint Online SDK (https://www.microsoft.com/en-us/download/details.aspx?id=42038) installed to run this script. | |
| .PARAMETER weburl | |
| SharePoint Online web URL, for example 'https://contoso.sharepoint.com'. | |
| .PARAMETER listname |
| <# | |
| .TERMS | |
| Refer to Microsoft Connect Terms of use http://connect.microsoft.com/terms.aspx#O | |
| .SYNOPSIS | |
| This script onboards your SharePoint Online (SPO) tenant into the cloud hybrid search SharePoint Server 2013 Preview/SharePoint 2016 Preview | |
| .PARAMETER PortalUrl | |
| SharePoint Online portal URL, for example 'https://contoso.sharepoint.com'. | |
| .PARAMETER HybridSsaId | |
| Name or id (Guid) of the cloud hybrid search application, created with the CreateCloudSSA script. | |
| .PARAMETER Credential |