Skip to content

Instantly share code, notes, and snippets.

View adamrushuk's full-sized avatar

Adam Rush adamrushuk

View GitHub Profile
@adamrushuk
adamrushuk / azure_ansible_credentials.yml
Last active January 10, 2019 13:53
Vagrant provisioning scripts for Azure / Ansible blog post: https://adamrushuk.github.io/azure-provisioning-ansible-awx/
---
# Update with your Azure Service Principal credentials
subscription: "aaaa1111-bbbb-cccc-abcd-aaabbbcccddd"
client: "abcd1234-abcd-efff-1234-abcd12345678"
secret: "MyStrongPassw0rd!"
tenant: "12345678-ab12-cd34-ef56-1234abcd5678"
#!/bin/bash
# Installs Ansible AWX
echo "INFO: Started Installing Ansible AWX..."
# Install prereq: Docker SDK for Python
echo "INFO: Started Installing Docker SDK for Python..."
pip install docker
echo "INFO: Finished Installing Docker SDK for Python."
@adamrushuk
adamrushuk / Get-GuidFromMsiFile.ps1
Last active March 22, 2024 22:59
Getting the Product ID / GUID from MSI file
# Vars
$msiPath = 'C:\Users\arush\Downloads\sqlncli.msi'
# Definition
$sig = @'
[DllImport("msi.dll", CharSet = CharSet.Unicode, PreserveSig = true, SetLastError = true, ExactSpelling = true)]
private static extern UInt32 MsiOpenPackageW(string szPackagePath, out IntPtr hProduct);
[DllImport("msi.dll", CharSet = CharSet.Unicode, PreserveSig = true, SetLastError = true, ExactSpelling = true)]
private static extern uint MsiCloseHandle(IntPtr hAny);
[DllImport("msi.dll", CharSet = CharSet.Unicode, PreserveSig = true, SetLastError = true, ExactSpelling = true)]
# Variables
$powershellGetVersion = '1.5.0.0' # DO NOT use the latest 1.6.0 version as there is issues with this process
$moduleFolderPath = 'C:\path\to\PowerShell\Module\FOLDER' # only target folder, NOT the .psm1 or .psd1
$repositoryName = 'psmodules'
$feedUsername = 'NotChecked'
$PAT = 'abcdefghijklmnopqrstuv1234567890' # Enter your Personal Access Token
$packageSourceUrl = "https://ACCOUNTNAME.pkgs.visualstudio.com/_packaging/$repositoryName/nuget/v2" # Enter your VSTS AccountName (note: v2 Feed)
# This is downloaded during Step 3, but could also be "C:\Users\USERNAME\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\NuGet.exe"
# if not running script as Administrator.
# Author: Adam Rush
# Created on: 2016-05-28
# Finds all upgradeable vShield Edges and exports CSV file to Desktop
$reportPath = "$HOME\Desktop\upgradable-VSEs.csv"
$report = @()
Write-Host "Searching for all vShield Edges..." -ForegroundColor Yellow
$edges = Get-View -ViewType virtualmachine -Property Name,Config -Filter @{'Config.VAppConfig.Product[0].Name'='vShield Edge'} | % {
$edge = '' | Select 'Name','Version'
$edge.Name = $_.Name