This file contains 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
# Source: https://docs.microsoft.com/en-us/rest/api/billing/enterprise/billing-enterprise-api-reserved-instance-usage | |
$enrollmentId = "" | |
$apiToken = "" | |
$startDate = "" ## yyyy-mm-dd | Example: 2020-10-01 | |
$endDate = "" ## yyyy-mm-dd | Example: 2020-10-01 | |
$uri = "https://consumption.azure.com/v2/enrollments/${enrollmentId}/reservationdetails?startDate=${startDate}&endDate=${endDate}" | |
Invoke-RestMethod -Method Get -UseBasicParsing -Uri $uri -Headers @{"Authorization"="bearer ${apiToken}"} |
This file contains 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
Set-StrictMode -Version Latest | |
# Constants | |
if (!(Test-Path variable:\NET_FW_DISABLED)) { Set-Variable NET_FW_DISABLED -Option Constant $False } | |
if (!(Test-Path variable:\NET_FW_ENABLED)) { Set-Variable NET_FW_ENABLED -Option Constant $True } | |
if (!(Test-Path variable:\NET_FW_IP_PROTOCOL_TCP)) { Set-Variable NET_FW_IP_PROTOCOL_TCP -Option Constant 6 } | |
if (!(Test-Path variable:\NET_FW_IP_PROTOCOL_UDP)) { Set-Variable NET_FW_IP_PROTOCOL_UDP -Option Constant 17 } | |
if (!(Test-Path variable:\NET_FW_PROFILE_DOMAIN)) { Set-Variable NET_FW_PROFILE_DOMAIN -Option Constant 0x1 } | |
if (!(Test-Path variable:\NET_FW_PROFILE_PRIVATE)) { Set-Variable NET_FW_PROFILE_PRIVATE -Option Constant 0x2 } | |
if (!(Test-Path variable:\NET_FW_PROFILE_PUBLIC)) { Set-Variable NET_FW_PROFILE_PUBLIC -Option Constant 0x2 } |
This file contains 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
$tagKey = "resourcegroup" | |
$resources = Get-AzureRmResource | |
foreach ($r in $resources) | |
{ | |
$resourceGroupName = $r.ResourceGroupName | |
$resourceTags = $r.tags | |
if ($resourceTags) { | |
if($resourceTags.Keys -contains $tagKey) { | |
if($resourceTags[$tagKey] -ne $resourceGroupName) { |
This file contains 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
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory=$true)] | |
$rsRefreshToken, | |
[Parameter(Mandatory=$true)] | |
$rsAccount, | |
[Parameter(Mandatory=$true)] | |
$rsEndpoint, | |
[Parameter(Mandatory=$true)] | |
$rsMCIName, |
This file contains 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
# Create the MCI and capture the HREF via '--xh=location' flag | |
mciHref=$(rsc --account=XXXX --refreshToken=XXXX --host=us-X.rightscale.com --xh=Location cm15 create /api/multi_cloud_images \ | |
"multi_cloud_image[description]=RHEL 7.5 GA" \ | |
"multi_cloud_image[name]=RS Example RHEL MCI") | |
# Tag the MCI | |
rsc --account=XXXX --refreshToken=XXXX --host=us-X.rightscale.com cm15 multi_add /api/tags/multi_add \ | |
"resource_hrefs[]=$mciHref" \ | |
"tags[]=rs_agent:mime_include_url=https://rightlink.rightscale.com/rll/10.6.0/rightlink.boot.sh" \ | |
"tags[]=rs_agent:type=right_link_lite" |
This file contains 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
# Required prolog | |
name 'LIB - Common functions' | |
rs_ca_ver 20160622 | |
short_description "Common functions" | |
package "common/functions" | |
# Checks if the account supports the selected cloud | |
define checkCloudSupport($cloud_name, $param_location) do | |
# Gather up the list of clouds supported in this account. |
This file contains 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
# Requires | |
# rsc - https://github.com/rightscale/rsc | |
# rightst - https://github.com/rightscale/right_st | |
# assumes they are stored in c:\rightscale\rsc\ and c:\rightscale\rightst\ | |
# Variables | |
$basepath = "$env:SystemDrive\rightscale" | |
$outputpath = "path-to-backup-location" | |
$rightstaccount = "Account Name" | |
$account = "12345" #Account Number |
This file contains 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
# Gets Audit Entries from a RightScale account for the past hour. | |
# Relies on Instance Auth for API access | |
# Currently just adds all audits to an object to allow for manipulation or forwarding | |
$tz = "-0000" | |
$now = Get-Date | |
$endDate = Get-Date $now -Format "yyyy/MM/dd HH:mm:ss" | |
$startDate = Get-Date (Get-Date $now).AddHours(-1) -Format "yyyy/MM/dd HH:mm:ss" | |
# Audit Entries - Index: http://reference.rightscale.com/api1.5/resources/ResourceAuditEntries.html#index |
This file contains 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
# RightScale API Client(rsc): https://github.com/rightscale/rsc | |
# PowerShell: https://github.com/PowerShell/PowerShell | |
# jq: https://stedolan.github.io/jq/ | |
# Output All Child Account Names, Numbers, and Shards | |
# PowerShell | |
# Requires: RSC and PowerShell | |
# | |
# Input: |
This file contains 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
# Based on 2017 results: http://www.motorsportsne.com/ | |
$urls = 'https://axwaresystems.com/axorm/files/MotorSportsNE/2017%2003%2026%20a-x_fin.htm', | |
'https://axwaresystems.com/axorm/files/MotorSportsNE/2017%2004%2002%20a-x_fin.htm', | |
'https://axwaresystems.com/axorm/files/MotorSportsNE/2017%2004%2030%20a-x%20removed%20a1%20a4%20no%20work_fin.htm', | |
'https://axwaresystems.com/axorm/files/MotorSportsNE/2017%2006%2004%20a-x_fin.htm', | |
'https://axwaresystems.com/axorm/files/MotorSportsNE/2017%2007%2028%20a-x_fin.htm', | |
'https://axwaresystems.com/axorm/files/MotorSportsNE/2017%2008%2006%20A-X_fin.htm', | |
'https://axwaresystems.com/axorm/files/MotorSportsNE/2017%2008%2018%20a-x_fin.htm', | |
'https://axwaresystems.com/axorm/files/MotorSportsNE/2017%2008%2020%20a-x_fin.htm', |
NewerOlder