Skip to content

Instantly share code, notes, and snippets.

View r4lfvb's full-sized avatar
🦩
Living, loving, having fun

Ralf von Broembsen r4lfvb

🦩
Living, loving, having fun
View GitHub Profile
@r4lfvb
r4lfvb / get-azure-regions.ps
Created September 4, 2025 12:49
Get list of Azure Regions in PowerShell
(Get-AzLocation -OutVariable locations) |
Where-Object { $_.GeographyGroup -and $_.RegionType -eq 'Physical' } |
Select-Object -Property @{Name='Geography';Expression={$_.GeographyGroup}},
@{Name='Region';Expression={$_.Location}},
PhysicalLocation,
@{Name='PairedRegion';Expression={$_.PairedRegion.Name}},
@{Name='PairedRegionPhysicalLocation';Expression={
($locations | Where-Object location -eq $_.PairedRegion.Name).PhysicalLocation
}} |
Sort-Object Geography, Region |
@r4lfvb
r4lfvb / az-region-zone-mapping.md
Last active July 4, 2025 14:29
List the Regions and the logical to physical Availability Zone mapping for an Azure subscription

Ensure the ImportExcel module is installed

Install-Module -Name ImportExcel -Scope CurrentUser -Force

Save Azure Region and AZ details to Excel

  if ($_.RegionType -eq 'Physical') {
    $regionName = $_.RegionName
    $id = $_.ID

Create QR code in Excel

Add this to Cell A1

https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=

Then add this to Cell A2

https://www.bing.com

Create a battery report in Windows

In Windows terminal: powercfg /batteryreport /output "battery_report.html"

@r4lfvb
r4lfvb / rvb-tricks.md
Last active July 4, 2025 10:29
PowerShell Tricks

PowerShell tricks

Create a new GUID

[guid]::newguid()

Reload the PATH in the current session

$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")