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
| using System; | |
| using System.Collections.Generic; | |
| using System.Net.Http; | |
| using System.Net.Http.Headers; | |
| using Newtonsoft.Json; | |
| namespace Example | |
| { | |
| class Program | |
| { |
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 Get-AzureRmResourceGroups { | |
| <# | |
| .SYNOPSIS | |
| Get-AzureRmResourceGroups will retrieve all Resource Groups within a Subscription. | |
| .DESCRIPTION | |
| Provides the ability to retrieve all Resource Groups from a specific Subscription Id via REST API. | |
| .EXAMPLE | |
| Get-AzureRmResourceGroups -SubscriptionId $subscriptionId -AccessToken $accessToken. | |
| .LINK |
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 Get-AzureRmVirtualMachines { | |
| <# | |
| .SYNOPSIS | |
| Get-AzureRmVirtualMachines will retrieve all Virtual Machines within a Subscription. | |
| .DESCRIPTION | |
| Provides the ability to retrieve all Virtual Machines from a specific Subscription Id via REST API. | |
| .EXAMPLE | |
| Get-AzureRmVirtualMachines -SubscriptionId $subscriptionId -AccessToken $accessToken. | |
| .LINK |
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 Get-AzureRmApiVersion { | |
| <# | |
| .SYNOPSIS | |
| Get-AzureRmApiVersion returns the api versions of Resource Providers. | |
| .DESCRIPTION | |
| Provides the ability to retrieve all api versions or the latest api version of a specific Resource Provider. | |
| .EXAMPLE | |
| Get-AzureRmApiVersion -SubscriptionId $subscriptionId -Namespace "" -ResourceType "" -AccessToken $accessToken | |
| .LINK |
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 Invoke-AzureRmVMRunCommand { | |
| <# | |
| .SYNOPSIS | |
| Invoke-AzureRmVMRunCommand will provide the ability to execute scripts against Virtual Machines. | |
| .DESCRIPTION | |
| Provides the ability to execute script files against Virtual Machines | |
| .EXAMPLE | |
| Invoke-AzureRmVMRunCommand -SubscriptionId $subscriptionId -ResourceGroupName $resourceGroupName -VirtualMachineName $virtualMachineName -ScriptPath $scriptPath -AccessToken $accessToken -Verbose | |
| #> |
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 Get-AzureRmResourceHealth { | |
| <# | |
| .SYNOPSIS | |
| Get-AzureRmResourceHealth will retrieve the Resource Health of all Resources within a Subscription. | |
| .DESCRIPTION | |
| Provides the ability to retrieve the current status of all Resources within a specific Subscription Id. | |
| .EXAMPLE | |
| Get-AzureRmResourceHealth -SubscriptionId $subscriptionId -AccessToken $accessToken. | |
| .LINK |
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 Get-AzureRmResourceHealthHistory { | |
| <# | |
| .SYNOPSIS | |
| Get-AzureRmResourceHealthHistory will retrieve the Resource Health History of a Resource. | |
| .DESCRIPTION | |
| Provides the ability to retrieve all historical Resource Health of a specific Resource Id. | |
| .EXAMPLE | |
| Get-AzureRmResourceHealthHistory -ResourceId $resourceId -AccessToken $accessToken. | |
| .LINK |
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 Invoke-GitHubRepositoriesClone { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter()] | |
| [string]$PersonalAccessToken | |
| ) | |
| begin { | |
| $request = @{ |
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
| import requests | |
| import json | |
| def tenants(token): | |
| print('Tenants...') | |
| url = 'https://management.azure.com/tenants?api-version=2018-02-01' | |
| headers = {'Authorization': ('Bearer ' + token)} | |
| try: | |
| response = requests.get(url, headers=headers) | |
| output = (json.loads(response.text))['value'] |
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
| from subprocess import call | |
| import requests | |
| import json | |
| class GitHub: | |
| def repositories(self, token, path): | |
| url = 'https://api.github.com/user/repos?affiliation=owner' | |
| headers = {'Authorization': ('Bearer ' + token)} | |
| try: | |
| response = requests.get(url, headers=headers) |