Skip to content

Instantly share code, notes, and snippets.

View cocallaw's full-sized avatar

Corey Callaway cocallaw

View GitHub Profile
New-Item "C:\Source\GitHub" -ItemType Directory
New-Item "C:\Source\Local" -ItemType Directory
#Install WinGet
#Based on this gist: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
"Installing winget Dependencies"
Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
{
"version": "2",
"templates": [
{
"type": 1,
"title": "Registry",
"description": "Docker image registry",
"categories": [
"docker"
],
[
{
"type": 1,
"title": "Registry",
"description": "Docker image registry",
"categories": [
"docker"
],
"platform": "linux",
"logo": "https://portainer-io-assets.sfo2.digitaloceanspaces.com/logos/registry.png",
$rgs = Get-AzResourceGroup
$expirestag = "project"
foreach ($r in $rgs) {
$tags = Get-AzTag -ResourceID $r.ResourceID
try {
if ($tags.Properties.TagsProperty.ContainsKey($expirestag)) {
Write-Host "Tag" $expirestag "Was Found on " $r.ResourceGroupName
}
else {
Write-Host "Tag" $expirestag "Was NOT Found on " $r.ResourceGroupName
@cocallaw
cocallaw / grab-azure-docs.sh
Created November 25, 2019 21:25 — forked from ranieuwe/grab-azure-docs.sh
Grabs a PDF copy of all Azure docs
for row in $(curl https://api.github.com/repositories/72685026/contents/articles | jq -c -r '.[] | select(.type | contains("dir")) | "\(.name)"'); do wget -O "${row}.pdf
" "https://docs.microsoft.com/en-us/azure/opbuildpdf/${row}/toc.pdf?branch=live"; done
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"sites_lplsmsfunc01_name": {
"defaultValue": "lplsmsfunc01",
"type": "String"
},
"sites_lplbrokerfunc01_name": {
"defaultValue": "lplbrokerfunc01",
{
"insights-logs-workflowruntime": "workflowId",
"insights-logs-networksecuritygrouprulecounter": "resourceId", - NSG
"insights-logs-networksecuritygroupevent": "resourceId", - NSG
"insights-logs-applicationgatewayaccesslog": "resourceId", - AGwy
"insights-logs-applicationgatewayperformancelog": "resourceId", - AGwy
"insights-logs-applicationgatewayfirewalllog": "resourceId", - AGwy
"insights-logs-loadbalanceralertevent": "resourceId", - LB
"insights-logs-loadbalancerprobehealthstatus": "resourceId", - LB
"insights-logs-auditevent": "resourceId",
@cocallaw
cocallaw / random-stgacct-generator.ps1
Last active March 15, 2022 13:19
Powershell Script to randomly generate Azure Storage Accounts for testing
$rg = Get-AzureRmResourceGroup -Name DummyStg
$perms = [ordered]@{a="Off";b="Container";c="Blob"}
$i = 1
while ($i -gt 0) {
#Generate Random Storage Account name
$random20 = -join ((48..57) + (97..122) | Get-Random -Count 20 | % {[char]$_})
#Create Storage Account
New-AzureRmStorageAccount -ResourceGroupName $rg.ResourceGroupName -Name $random20 -Location $rg.Location -SkuName Standard_LRS -Kind BlobStorage -AccessTier Hot
$i--