Skip to content

Instantly share code, notes, and snippets.

View bergsj's full-sized avatar

Sjoerd van den Berg bergsj

View GitHub Profile
$subscriptionId = "xxx"
$resourceGroup = "xxx"
$azfwPolicyName = "xxx"
function GetIpGroupName {
param ( [string] $resourceId )
$resourceSubscriptionId = (Get-AzResource -ResourceId $resourceId).SubscriptionId
$context = Get-AzContext
@bergsj
bergsj / post_install.ps1
Created December 18, 2023 15:52
post install script for VM configuration
<# description: Post install actions
by: Ivo Beerens
version: 1.0 creation
#>
Set-ExecutionPolicy Bypass -Scope Process -Force
# Variables
$powerManagement = "8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"
$tempFolder = "C:\Temp"
@bergsj
bergsj / Format-TerraformFiles.ps1
Last active December 18, 2023 10:51
Reformat terraform files with specific column
param (
[string]
$FolderPath = ".\",
[int]
$columnIndex = 40
)
Write-Host "Running terraform format..."
& terraform fmt -recursive $FolderPath
Write-Host "Done" -ForegroundColor Yellow