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
# CI/CD Pipeline for building & deploying a Hugo static website to Azure Blob Storage. | |
# Uses Microsoft Azure Hosted agents. | |
# AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_KEY must be defined as secret pipeline variables. | |
trigger: | |
- master | |
pool: | |
vmImage: 'ubuntu-latest' |
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
# CI/CD Pipeline for building & deploying a Hugo static website to Azure Blob Storage. | |
# Uses GitHub Hosted agents. | |
# AZURE_STORAGE_KEY must be defined as a GitHub repository secret. | |
name: CI/CD | |
# Trigger the workflow on push or pull request events, but only for the master branch | |
on: | |
push: | |
branches: [ master ] | |
pull_request: |
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
<# | |
.SYNOPSIS | |
Rename Azure Virtual Machine(s). | |
.DESCRIPTION | |
Rename an Azure Virtual Machine by disconnecting dependent resources, creating new Virtual Machine resource object, and reattaching all dependent resources. | |
.EXAMPLE | |
./Rename-AzVM.ps1 -ComputerName 'MyAzureVM1', 'MyAzureVM2' -NewName 'myazvm01', 'AZVM02' -Linux | |
.EXAMPLE | |
./Rename-AzVM.ps1 -ComputerName 'AnotherAzureVM' -NewName 'MySuperSpecialAzVM' -Windows | |
.NOTES |
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
# Build from official ansible/awx image | |
# Use latest tag unless a different tag is supplied at runtime | |
ARG AWX_VER=latest | |
FROM ansible/awx:${AWX_VER} | |
USER root | |
# Install PowerShell and NTLM auth package | |
RUN dnf -y install gssntlmssp \ | |
https://github.com/PowerShell/PowerShell/releases/download/v7.0.3/powershell-lts-7.0.3-1.rhel.7.x86_64.rpm |
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
<# | |
.SYNOPSIS | |
Map all EC2 Snapshots in an AWS Account to the EBS Volume that is was created from, and map that EBS Volume to an EC2 Instance if it's attached to one. | |
.EXAMPLE | |
.\Get-EC2SnapshotParentMapping.ps1 -Account '123456789012' -Regions 'us-east-1', 'us-west-2' -AccessKey '<AWS Access Key>' -SecretKey '<AWS Secret Key>' -UseRoleAssumption | |
.EXAMPLE | |
.\Get-EC2SnapshotParentMapping.ps1 -Account '123456789012' -Regions 'us-east-1' -AccessKey '<AWS Access Key>' -SecretKey '<AWS Secret Key> -SessionToken '<AWS STS Token>' | |
.OUTPUTS | |
A .csv file containing the generated Snapshot correlation matrix, located on the script executor's Desktop. | |
#> |
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
<# | |
.SYNOPSIS | |
Export Spotify playlists to .csv file for backup | |
.DESCRIPTION | |
Export Spotify playlists to .csv file using the Spotify web API with OAuth2 Client Authorization flow | |
.EXAMPLE | |
./Start-SpotifyPlaylistExport.ps1 -KeyVaultName 'myazkeyvault' -PlaylistType 'User' | |
.NOTES | |
- Assumes that a Spotify application has been configured and an OAuth2 Refresh token has been granted for a user | |
https://developer.spotify.com/documentation/general/guides/authorization-guide/ |
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
function Uninstall-OldModules { | |
param( | |
# Array of modules to uninstall | |
[Parameter(Mandatory)] | |
$Modules | |
) | |
foreach ($Module in $Modules) { | |
if ($Module.Count -gt 1) { | |
$LatestVersion = $Module.Group | Sort-Object Version | Select-Object Version -Last 1 | |
Write-Output "Removing all versions of $($Module.Name) except latest installed: $($LatestVersion.Version)" |
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 Microsoft.ApplicationInsights.dll from: https://www.nuget.org/packages/Microsoft.ApplicationInsights/ ## | |
## Unzip the .nupkg file and extact the "lib/net452/Microsoft.ApplicationInsights.dll" ## | |
## Upload the .dll to the same directory as "run.ps1" within the Function App | |
# Load .dll assembly into PowerShell session | |
[Reflection.Assembly]::LoadFile("$PSScriptRoot\Microsoft.ApplicationInsights.dll") | |
# Instantiate the Telemetry Client configuration | |
$TelemetryClientConfig = [Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration]::CreateDefault() |
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 -Version 6.0 | |
#Requires -Modules Az.Accounts, Az.ResourceGraph, AWS.Tools.Common, AWS.Tools.SecurityToken, AWS.Tools.EC2 | |
<# | |
.SYNOPSIS | |
Generate a report of cloud (Azure & AWS) orphaned volumes | |
.DESCRIPTION | |
Generate a report of Azure Disks and AWS EBS Volumes which are not attached to any virtual machine | |
.EXAMPLE | |
Process all Azure Subscriptions, multiple AWS Accounts, and multiple AWS Regions | |
.\Get-CloudOrphanedVolumes.ps1 -AccessKey 'AKWAVDLECACDWDL' -SecretKey 'Acs320xcew2ds2SLdwsf0' -AWSAccount '12345679012', '123049238343' -AWSRegion 'us-east-1', 'us-west-2' |
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 -Version 6.0 | |
#Requires -Modules Az.Accounts, Az.ResourceGraph | |
<# | |
.SYNOPSIS | |
Generate a report of Azure orphaned volumes | |
.DESCRIPTION | |
Generate a report of Azure Disks which are not attached to any virtual machine | |
.EXAMPLE | |
Process all Azure Subscriptions and write results to stdout | |
.\Get-AzOrphanedVolumes.ps1 |
OlderNewer