From 1b082205f1e98a084695b042adec5cc122ff7717 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Thu, 24 Jul 2025 14:49:27 +0200 Subject: InComm, rather spontaneous --- AzureHelpers/Public/Get-AzAccountList.ps1 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 AzureHelpers/Public/Get-AzAccountList.ps1 (limited to 'AzureHelpers/Public/Get-AzAccountList.ps1') diff --git a/AzureHelpers/Public/Get-AzAccountList.ps1 b/AzureHelpers/Public/Get-AzAccountList.ps1 new file mode 100644 index 0000000..d49d8e4 --- /dev/null +++ b/AzureHelpers/Public/Get-AzAccountList.ps1 @@ -0,0 +1,22 @@ +function Get-AzAccountList { + <# + .SYNOPSIS + Show details about all subscriptions the Azure account we are logged into has access to. + + .INPUTS + None. + + .OUTPUTS + String. A coloured JSON output showing a more or less terse list of subscriptions. + #> + [Alias( + 'getazacclist', + 'azacclist', + 'azalist' + )] + # PowerShell will throw an exception "Unexpected attribute 'Alias'." if you don't define Param() below. If you do, everything is fine. + # POWERSHELL IS SO SOPHISTICATED AND GOOD, the number of times I've heard this bollocks definitely equals the quality + Param( + ) + az account list -o jsonc --query '[].{name: name, id: id, state: state, homeTenantId: homeTenantId, tenantId: tenantId, user: user}' +} \ No newline at end of file -- cgit v1.2.3