Skip to content

Instantly share code, notes, and snippets.

View ljtill's full-sized avatar
🔨

Lyon Till ljtill

🔨
View GitHub Profile
@ljtill
ljtill / GitBranch.ps1
Last active August 16, 2021 18:06
Provides the ability to list Git branches
function Get-GitBranch {
[CmdletBinding()]
param (
)
begin {
$branch = Invoke-Expression -Command "git branch --all"
$current = @()
$local = @()
@ljtill
ljtill / GitStatus.ps1
Last active August 16, 2021 18:07
Provides the ability to output Git status
function Get-GitStatus {
[CmdletBinding()]
param ()
begin {
# TODO: if not-in-git-dir
$Status = Invoke-Expression -Command "git -c core.quotepath=false status --short"
@ljtill
ljtill / azurepolicy.json
Last active June 15, 2020 21:22
Provides the ability to enforce outbound restrictions
{
"mode": "Indexed",
"parameters": {},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Network/networkSecurityGroups"
}
@ljtill
ljtill / azurepolicy.json
Last active January 27, 2025 21:33
Provides the ability to allow resource types
{
"mode": "All",
"policyRule": {
"if": {
"allOf": [
{
"not": {
"anyOf": [
{
"contains": "Microsoft.Network/applicationGateway",
@ljtill
ljtill / Logs.ps1
Last active August 1, 2022 13:21
Provides the ability to write logs
function Write-Log {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[ValidateSet("Information", "Warning", "Error", "Verbose", "Debug")]
[string]$Level,
[Parameter(Mandatory = $false)]
[string]$Topic,
@ljtill
ljtill / azuredeploy.json
Last active August 4, 2022 21:21
Provides the ability to loop array properties
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"subnets": {
"type": "array"
}
},
"variables": {
},
@ljtill
ljtill / Compliance.ps1
Created February 23, 2020 18:54
Provides the ability to validate resiliency of Virtual Machines.
#Requires -Modules Az.Accounts, Az.Compute, Az.Resources
function Get-AzCECompliance {
[CmdletBinding()]
param (
)
begin {
Write-Verbose -Message ("Initiating function " + $MyInvocation.MyCommand + " begin")
@ljtill
ljtill / Replication.ps1
Last active December 6, 2019 15:33
Provides the ability to retrieve the current Storage Account replication status
#Requires -Modules Az.Accounts, Az.Storage
function Get-AzStorageAccountReplication() {
<#
.SYNOPSIS
Get-AzStorageAccountReplication
.DESCRIPTION
Retrieves the latest replication status for a given Storage Account (RA-GRS)
.EXAMPLE
@ljtill
ljtill / azuredeploy.json
Last active December 6, 2019 15:48
Provides the ability to add DevOps Extension to virtual machines
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"apiVersion": "2015-06-15",
"name": "[concat(parameters('vmName'),'/TeamServicesAgentLinux')]",
"location": "[parameters('location')]",
"properties": {
"publisher": "Microsoft.VisualStudio.Services",
"type": "TeamServicesAgentLinux",
"typeHandlerVersion": "1.0",
"autoUpgradeMinorVersion": true,
@ljtill
ljtill / azuredeploy.json
Last active December 6, 2019 15:48
Provides the ability to quickly deploy Linux virtual machine
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"username": {
"type": "string"
},
"publicKey": {
"type": "securestring"
}