Skip to content

Commit

Permalink
Bugfix for subscription filtering on Cloudshell
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio-Merola committed Jun 6, 2024
1 parent cc991ad commit d13242a
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions AzureResourceInventory.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# #
# * Azure Resource Inventory ( ARI ) Report Generator * #
# #
# Version: 3.1.17 #
# Version: 3.1.18 #
# #
# Date: 06/05/2024 #
# Date: 06/06/2024 #
# #
##########################################################################################
<#
Expand Down Expand Up @@ -358,7 +358,7 @@ param ($TenantID,

function checkPS() {
Write-Debug ('Starting checkPS function')
$CShell = try{Get-CloudDrive}catch{}
$CShell = try{Get-CloudShellTip}catch{}
if ($CShell) {
write-host 'Azure CloudShell Identified.'
$Global:PlatOS = 'Azure CloudShell'
Expand Down Expand Up @@ -386,6 +386,17 @@ param ($TenantID,
$Global:DefaultPath = if($ReportDir) {$ReportDir} else {"$HOME/AzureResourceInventory/"}
$Global:DiagramCache = if($ReportDir) {$ReportDir} else {"$HOME/AzureResourceInventory/DiagramCache/"}
$Global:Subscriptions = az account list --output json --only-show-errors | ConvertFrom-Json
if ($SubscriptionID)
{
if($SubscriptionID.count -gt 1)
{
$Global:Subscriptions = $Subscriptions | Where-Object { $_.ID -in $SubscriptionID }
}
else
{
$Global:Subscriptions = $Subscriptions | Where-Object { $_.ID -eq $SubscriptionID }
}
}
}
else
{
Expand Down

0 comments on commit d13242a

Please sign in to comment.