Skip to content

Commit

Permalink
3.5.15
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio-Merola committed Dec 19, 2024
1 parent fa5124c commit 4d5c1a3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
2 changes: 1 addition & 1 deletion AzureResourceInventory.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AzureResourceInventory.psm1'

# Version number of this module.
ModuleVersion = '3.5.13'
ModuleVersion = '3.5.15'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
41 changes: 28 additions & 13 deletions Modules/Core/ARILoginSession.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ https://github.com/microsoft/ARI/Core/Connect-LoginSession.psm1
This powershell Module is part of Azure Resource Inventory (ARI)
.NOTES
Version: 4.0.3
Version: 3.5.15
First Release Date: 15th Oct, 2024
Authors: Claudio Merola
Expand All @@ -30,12 +30,13 @@ function Connect-ARILoginSession {
}
Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting Connect-LoginSession function')
Write-Host $AzureEnvironment -BackgroundColor Green
$Context = Get-AzContext -ErrorAction SilentlyContinue
if (!$TenantID) {
Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Tenant ID not specified')
write-host "Tenant ID not specified. Use -TenantID parameter if you want to specify directly. "
write-host "Authenticating Azure"
write-host ""
Clear-AzContext -Force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -InformationAction SilentlyContinue

if($DeviceLogin.IsPresent)
{
Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Logging with Device Login')
Expand Down Expand Up @@ -97,7 +98,14 @@ function Connect-ARILoginSession {
}
else {
Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Tenant ID was informed.')
Clear-AzContext -Force | Out-Null

if($Context.Tenant.Id -ne $TenantID)
{
Set-AzContext -Tenant $TenantID -ErrorAction SilentlyContinue | Out-Null
$Context = Get-AzContext -ErrorAction SilentlyContinue
}
$Subs = Get-AzSubscription -TenantId $TenantID -ErrorAction SilentlyContinue -WarningAction SilentlyContinue

if($DeviceLogin.IsPresent)
{
Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Logging with Device Login')
Expand All @@ -118,24 +126,31 @@ function Connect-ARILoginSession {
}
else
{
try
if([string]::IsNullOrEmpty($Subs))
{
Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Editing Login Experience')
$AZConfig = Get-AzConfig -LoginExperienceV2 -WarningAction SilentlyContinue -InformationAction SilentlyContinue
if ($AZConfig.value -eq 'On')
try
{
Update-AzConfig -LoginExperienceV2 Off | Out-Null
Connect-AzAccount -Tenant $TenantID -Environment $AzureEnvironment | Out-Null
Update-AzConfig -LoginExperienceV2 On | Out-Null
Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Editing Login Experience')
$AZConfig = Get-AzConfig -LoginExperienceV2 -WarningAction SilentlyContinue -InformationAction SilentlyContinue
if ($AZConfig.value -eq 'On')
{
Update-AzConfig -LoginExperienceV2 Off | Out-Null
Connect-AzAccount -Tenant $TenantID -Environment $AzureEnvironment | Out-Null
Update-AzConfig -LoginExperienceV2 On | Out-Null
}
else
{
Connect-AzAccount -Tenant $TenantID -Environment $AzureEnvironment | Out-Null
}
}
else
catch
{
Connect-AzAccount -Tenant $TenantID -Environment $AzureEnvironment | Out-Null
}
}
catch
else
{
Connect-AzAccount -Tenant $TenantID -Environment $AzureEnvironment | Out-Null
Write-Host "Already authenticated in Tenant $TenantID"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Modules/Scripts/Storage/VMDisk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ https://github.com/microsoft/ARI/Modules/Compute/VMDISK.ps1
This powershell Module is part of Azure Resource Inventory (ARI)
.NOTES
Version: 3.5.13
Version: 3.5.14
First Release Date: 19th November, 2020
Authors: Claudio Merola and Renato Gregio
Expand Down Expand Up @@ -84,7 +84,7 @@ If ($Task -eq 'Processing')
'Zone' = [string]$1.ZONES;
'SKU' = $SKU.Name;
'Disk Size' = $data.diskSizeGB;
'Performance Tier' = $SKU.tier;
'Performance Tier' = $data.tier;
'Disk IOPS Read / Write' = $data.diskIOPSReadWrite;
'Disk MBps Read / Write' = $data.diskMBpsReadWrite;
'Public Network Access' = $data.publicNetworkAccess;
Expand Down

0 comments on commit 4d5c1a3

Please sign in to comment.