Skip to content

Instantly share code, notes, and snippets.

View ljtill's full-sized avatar
🔨

Lyon Till ljtill

🔨
View GitHub Profile
@ljtill
ljtill / metadata.json
Last active August 16, 2021 18:03
Provides the ability to manage Azure Policy artifacts
[
{
"displayName": "",
"assignmentName": "",
"name": "(GUID)",
"description": "",
"definitionPath": "./folder/policy.rules.json",
"parameterPath": "./folder/policy.parameters.json"
}
]
@ljtill
ljtill / Policy.ps1
Last active August 1, 2022 13:17
Provides the ability to thread the operations of retrieving Policy artefacts
Get-Job | Remove-Job
Import-Module -Name Az.Accounts
$profile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile
$client = New-Object Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient($profile)
$token = $client.AcquireAccessToken("")
$accessToken = $token.AccessToken
$params = @{
@ljtill
ljtill / AzSFTScript.ps1
Last active December 6, 2019 15:42
Provides the ability to install & reset the ScaleFT agent state
param (
[Parameter(Mandatory = $false)]
[string]$ApplicationDirectory = "C:\windows\system32\config\systemprofile\AppData\Local\ScaleFT\",
[Parameter(Mandatory = $false)]
[string]$ApplicationFilename = "ScaleFT-Server-Tools-latest.msi",
[Parameter(Mandatory = $false)]
[string]$ApplicationUri = "https://dist.scaleft.com/server-tools/windows/latest/ScaleFT-Server-Tools-latest.msi",
@ljtill
ljtill / RoleDefinition.ps1
Last active December 6, 2019 15:41
Provides the ability to set custom RBAC for Rackspace Smart Tickets
#region New
Set-AzContext -SubscriptionId ""
$definition = Get-AzRoleDefinition -Name ""
$definition.Name = "Rackspace Smart Tickets Automation Contributor"
$definition.Description = "Can execute remediation tasks."
$definition.Id = $null
$definition.Actions.Clear()
$definition.Actions.Add("Microsoft.Authorization/*/read")
$definition.Actions.Add("Microsoft.Support/*")
$definition.Actions.Add("Microsoft.Compute/virtualMachines/extensions/delete")
@ljtill
ljtill / Bootstrapper.ps1
Created January 21, 2019 18:56
Provides the ability to import & publish runbooks
#Requires -Modules @{ ModuleName="ThreadJob"; ModuleVersion="1.1.2" }
Get-Job | Remove-Job
$runbooks = ""
$path = (Get-Location).Path
$runbooks | ForEach-Object {
Start-ThreadJob -ScriptBlock {
param ($runbook, $path)
Write-Output ("Importing Runbook - " + $runbook)