diff --git a/AzureResourceInventory.psd1 b/AzureResourceInventory.psd1 index 879a85e2..a069357d 100644 --- a/AzureResourceInventory.psd1 +++ b/AzureResourceInventory.psd1 @@ -12,7 +12,7 @@ RootModule = 'AzureResourceInventory.psm1' # Version number of this module. -ModuleVersion = '3.6.4' +ModuleVersion = '3.6.5' # Supported PSEditions # CompatiblePSEditions = @() @@ -33,7 +33,7 @@ Copyright = '(c) Claudio Merola. All rights reserved.' Description = 'Azure Resource Inventory - Its a Powerful tool to create EXCEL inventory from Azure Resources with low effort' # Minimum version of the PowerShell engine required by this module -# PowerShellVersion = '' +PowerShellVersion = '7.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' diff --git a/Modules/Private/0.MainFunctions/Start-ARIProcessOrchestration.ps1 b/Modules/Private/0.MainFunctions/Start-ARIProcessOrchestration.ps1 index 42a9e2ce..8f977202 100644 --- a/Modules/Private/0.MainFunctions/Start-ARIProcessOrchestration.ps1 +++ b/Modules/Private/0.MainFunctions/Start-ARIProcessOrchestration.ps1 @@ -48,15 +48,29 @@ function Start-ARIProcessOrchestration { <############################################################## RESOURCES PROCESSING #############################################################> - $JobNames = (Get-Job | Where-Object {$_.name -like 'ResourceJob_*'}).Name - if(![string]::IsNullOrEmpty($JobNames)) { - Wait-ARIJob -JobNames $JobNames -JobType 'Resource' -LoopTime 5 - - Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Finished Waiting for Resource Jobs.') - - Build-ARICacheFiles -DefaultPath $DefaultPath -ReportCache $ReportCache -JobNames $JobNames + if ($Automation.IsPresent) + { + Write-Output ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Waiting for Resource Jobs to Complete in Automation Mode') + Get-Job | Where-Object {$_.name -like 'ResourceJob_*'} | Wait-Job + } + else + { + $JobNames = (Get-Job | Where-Object {$_.name -like 'ResourceJob_*'}).Name + Wait-ARIJob -JobNames $JobNames -JobType 'Resource' -LoopTime 5 + } + + if ($Automation.IsPresent) + { + Write-Output ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Processing Resources in Automation Mode') + } + else + { + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Finished Waiting for Resource Jobs.') + } + + Build-ARICacheFiles -DefaultPath $DefaultPath -JobNames $JobNames } Write-Progress -activity 'Azure Inventory' -Status "60% Complete." -PercentComplete 60 -CurrentOperation "Completed Data Processing Phase.." diff --git a/Modules/Private/1.ExtractionFunctions/Start-ARIGraphExtraction.ps1 b/Modules/Private/1.ExtractionFunctions/Start-ARIGraphExtraction.ps1 index e5bd037d..cf25b2de 100644 --- a/Modules/Private/1.ExtractionFunctions/Start-ARIGraphExtraction.ps1 +++ b/Modules/Private/1.ExtractionFunctions/Start-ARIGraphExtraction.ps1 @@ -12,7 +12,7 @@ https://github.com/microsoft/ARI/Modules/Private/1.ExtractionFunctions/Start-ARI This powershell Module is part of Azure Resource Inventory (ARI) .NOTES -Version: 3.6.0 +Version: 3.6.5 First Release Date: 15th Oct, 2024 Authors: Claudio Merola @@ -81,7 +81,7 @@ Function Start-ARIGraphExtraction { } } - $ExcludedTypes = "| where type !in ('microsoft.logic/workflows')" + $ExcludedTypes = "| where type !in ('microsoft.logic/workflows','microsoft.portal/dashboards','microsoft.resources/templatespecs/versions','microsoft.resources/templatespecs')" $GraphQuery = "resources $RGQueryExtension $TagQueryExtension $MGQueryExtension $ExcludedTypes | project id,name,type,tenantId,kind,location,resourceGroup,subscriptionId,managedBy,sku,plan,properties,identity,zones,extendedLocation$($GraphQueryTags) | order by id asc" diff --git a/Modules/Private/2.ProcessingFunctions/Build-ARICacheFiles.ps1 b/Modules/Private/2.ProcessingFunctions/Build-ARICacheFiles.ps1 index 981cf3f5..225edb50 100644 --- a/Modules/Private/2.ProcessingFunctions/Build-ARICacheFiles.ps1 +++ b/Modules/Private/2.ProcessingFunctions/Build-ARICacheFiles.ps1 @@ -18,7 +18,7 @@ Authors: Claudio Merola #> function Build-ARICacheFiles { - Param($DefaultPath, $ReportCache, $JobNames) + Param($DefaultPath, $JobNames) Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Checking Cache Folder.') diff --git a/Modules/Private/2.ProcessingFunctions/Invoke-ARIAdvisoryJob.ps1 b/Modules/Private/2.ProcessingFunctions/Invoke-ARIAdvisoryJob.ps1 index 2fd7c98e..e455dcb7 100644 --- a/Modules/Private/2.ProcessingFunctions/Invoke-ARIAdvisoryJob.ps1 +++ b/Modules/Private/2.ProcessingFunctions/Invoke-ARIAdvisoryJob.ps1 @@ -12,7 +12,7 @@ https://github.com/microsoft/ARI/Modules/Private/2.ProcessingFunctions/Invoke-AR This PowerShell Module is part of Azure Resource Inventory (ARI). .NOTES -Version: 3.6.0 +Version: 3.6.5 First Release Date: 15th Oct, 2024 Authors: Claudio Merola #> @@ -22,7 +22,7 @@ function Invoke-ARIAdvisoryJob { if ($Automation.IsPresent) { - Write-Output ('Starting Advisory Job') + Write-Output ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting Advisory Job') Start-ThreadJob -Name 'Advisory' -ScriptBlock { import-module $($args[1]) diff --git a/Modules/Private/2.ProcessingFunctions/Invoke-ARIPolicyJob.ps1 b/Modules/Private/2.ProcessingFunctions/Invoke-ARIPolicyJob.ps1 index 7af29839..706dfdd0 100644 --- a/Modules/Private/2.ProcessingFunctions/Invoke-ARIPolicyJob.ps1 +++ b/Modules/Private/2.ProcessingFunctions/Invoke-ARIPolicyJob.ps1 @@ -12,7 +12,7 @@ https://github.com/microsoft/ARI/Modules/Private/2.ProcessingFunctions/Invoke-AR This PowerShell Module is part of Azure Resource Inventory (ARI). .NOTES -Version: 3.6.0 +Version: 3.6.5 First Release Date: 15th Oct, 2024 Authors: Claudio Merola #> @@ -22,7 +22,7 @@ function Invoke-ARIPolicyJob { if ($Automation.IsPresent) { - Write-Output ('Starting Policy Job') + Write-Output ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting Policy Job') Start-ThreadJob -Name 'Policy' -ScriptBlock { import-module $($args[4]) diff --git a/Modules/Private/2.ProcessingFunctions/Invoke-ARISecurityCenterJob.ps1 b/Modules/Private/2.ProcessingFunctions/Invoke-ARISecurityCenterJob.ps1 index 3b593f08..ec53c944 100644 --- a/Modules/Private/2.ProcessingFunctions/Invoke-ARISecurityCenterJob.ps1 +++ b/Modules/Private/2.ProcessingFunctions/Invoke-ARISecurityCenterJob.ps1 @@ -12,7 +12,7 @@ https://github.com/microsoft/ARI/Modules/Private/2.ProcessingFunctions/Invoke-AR This PowerShell Module is part of Azure Resource Inventory (ARI). .NOTES -Version: 3.6.0 +Version: 3.6.5 First Release Date: 15th Oct, 2024 Authors: Claudio Merola #> @@ -22,7 +22,7 @@ function Invoke-ARISecurityCenterJob { if ($Automation.IsPresent) { - Write-Output ('Starting SecurityCenter Job') + Write-Output ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting SecurityCenter Job') Start-ThreadJob -Name 'Security' -ScriptBlock { import-module $($args[2]) diff --git a/Modules/Private/2.ProcessingFunctions/Invoke-ARISubJob.ps1 b/Modules/Private/2.ProcessingFunctions/Invoke-ARISubJob.ps1 index bedef607..51f55f0c 100644 --- a/Modules/Private/2.ProcessingFunctions/Invoke-ARISubJob.ps1 +++ b/Modules/Private/2.ProcessingFunctions/Invoke-ARISubJob.ps1 @@ -12,7 +12,7 @@ https://github.com/microsoft/ARI/Modules/Private/2.ProcessingFunctions/Invoke-AR This PowerShell Module is part of Azure Resource Inventory (ARI). .NOTES -Version: 3.6.0 +Version: 3.6.5 First Release Date: 15th Oct, 2024 Authors: Claudio Merola #> @@ -22,7 +22,7 @@ function Invoke-ARISubJob { if ($Automation.IsPresent) { - Write-Output ('Starting Subscription Job') + Write-Output ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting Subscription Job') Start-ThreadJob -Name 'Subscriptions' -ScriptBlock { import-module $($args[2]) diff --git a/Modules/Private/2.ProcessingFunctions/Start-ARIAutProcessJob.ps1 b/Modules/Private/2.ProcessingFunctions/Start-ARIAutProcessJob.ps1 index a1d6b849..c18a9f1e 100644 --- a/Modules/Private/2.ProcessingFunctions/Start-ARIAutProcessJob.ps1 +++ b/Modules/Private/2.ProcessingFunctions/Start-ARIAutProcessJob.ps1 @@ -12,7 +12,7 @@ https://github.com/microsoft/ARI/Modules/Private/2.ProcessingFunctions/Start-ARI This PowerShell Module is part of Azure Resource Inventory (ARI). .NOTES -Version: 3.6.0 +Version: 3.6.5 First Release Date: 15th Oct, 2024 Authors: Claudio Merola #> @@ -24,13 +24,15 @@ function Start-ARIAutProcessJob { $InventoryModulesPath = Join-Path $ParentPath 'Public' 'InventoryModules' $Modules = Get-ChildItem -Path $InventoryModulesPath -Directory $NewResources = ($Resources | ConvertTo-Json -Depth 40 -Compress) - $SmaResources = @{} # Initialize the hashtable to store results + $JobLoop = 1 + Write-Output ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+"Starting ARI Automation Processing Jobs...") Foreach ($ModuleFolder in $Modules) { $ModulePath = Join-Path $ModuleFolder.FullName '*.ps1' $ModuleName = $ModuleFolder.Name $ModuleFiles = Get-ChildItem -Path $ModulePath + Write-Output ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+"Starting Job: $ModuleName") Start-ThreadJob -Name ('ResourceJob_'+$ModuleName) -ScriptBlock { @@ -40,6 +42,7 @@ function Start-ARIAutProcessJob { $Resources = $($args[4]) | ConvertFrom-Json $Retirements = $($args[5]) $Unsupported = $($args[10]) + $SmaResources = @{} # Initialize the hashtable to store results Foreach ($Module in $ModuleFiles) { @@ -58,6 +61,22 @@ function Start-ARIAutProcessJob { $SmaResources - } -ArgumentList $ModuleFiles, $PSScriptRoot, $Subscriptions, $InTag, $NewResources, $Retirements, 'Processing', $null, $null, $null, $Unsupported -ThrottleLimit 8 | Out-Null + } -ArgumentList $ModuleFiles, $PSScriptRoot, $Subscriptions, $InTag, $NewResources, $Retirements, 'Processing', $null, $null, $null, $Unsupported | Out-Null + + if($JobLoop -eq 4) + { + Write-Output ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Waiting Batch Jobs') + + Get-Job | Where-Object {$_.name -like 'ResourceJob_*'} | Wait-Job + + $JobNames = (Get-Job | Where-Object {$_.name -like 'ResourceJob_*'}).Name + + Start-Sleep -Seconds 5 + + Build-ARICacheFiles -DefaultPath $DefaultPath -JobNames $JobNames + + $JobLoop = 0 + } + $JobLoop ++ } } \ No newline at end of file diff --git a/Modules/Private/2.ProcessingFunctions/Start-ARIProcessJob.ps1 b/Modules/Private/2.ProcessingFunctions/Start-ARIProcessJob.ps1 index f2dc710f..00cf5632 100644 --- a/Modules/Private/2.ProcessingFunctions/Start-ARIProcessJob.ps1 +++ b/Modules/Private/2.ProcessingFunctions/Start-ARIProcessJob.ps1 @@ -12,7 +12,7 @@ https://github.com/microsoft/ARI/Modules/Private/2.ProcessingFunctions/Start-ARI This PowerShell Module is part of Azure Resource Inventory (ARI). .NOTES -Version: 3.6.0 +Version: 3.6.5 First Release Date: 15th Oct, 2024 Authors: Claudio Merola #> @@ -150,7 +150,7 @@ function Start-ARIProcessJob { $JobNames = (Get-Job | Where-Object {$_.name -like 'ResourceJob_*'}).Name - Build-ARICacheFiles -DefaultPath $DefaultPath -ReportCache $ReportCache -JobNames $JobNames + Build-ARICacheFiles -DefaultPath $DefaultPath -JobNames $JobNames $JobLoop = 0 } diff --git a/Modules/Private/3.ReportingFunctions/StyleFunctions/Build-ARIExcelChart.ps1 b/Modules/Private/3.ReportingFunctions/StyleFunctions/Build-ARIExcelChart.ps1 index a236e898..5877a0fa 100644 --- a/Modules/Private/3.ReportingFunctions/StyleFunctions/Build-ARIExcelChart.ps1 +++ b/Modules/Private/3.ReportingFunctions/StyleFunctions/Build-ARIExcelChart.ps1 @@ -737,7 +737,7 @@ function Build-ARIExcelChart { } Add-PivotTable @PTParams -NoLegend } - else { + elseif ($Excel.Workbook.Worksheets | Where-Object { $_.Name -eq 'Virtual Machines' }) { $P8Name = 'VMs per Region' $PTParams = @{ PivotTableName = "P8" @@ -761,6 +761,30 @@ function Build-ARIExcelChart { } Add-PivotTable @PTParams -NoLegend } + else{ + $P8Name = 'Resources per Region' + $PTParams = @{ + PivotTableName = "P8" + Address = $excel.Overview.cells["DE5"] # top-left corner of the table + SourceWorkSheet = $excel.'Subscriptions' + PivotRows = @("Location") + PivotData = @{"Resources Count" = "Sum" } + PivotTableStyle = $tableStyle + IncludePivotChart = $true + ChartType = "BarStacked3D" + ChartRow = 34 + ChartColumn = 24 + Activate = $true + PivotFilter = 'Subscription' + ChartTitle = 'Resources by Location' + ShowPercent = $true + ChartHeight = 255 + ChartWidth = 315 + ChartRowOffSetPixels = 5 + ChartColumnOffSetPixels = 0 + } + Add-PivotTable @PTParams -NoLegend + } $DrawP8 = $WS.Drawings | Where-Object { $_.Name -eq 'TP8' } $DrawP8.RichText.Add($P8Name) | Out-Null diff --git a/Modules/Private/3.ReportingFunctions/StyleFunctions/Build-ARIExcelComObject.ps1 b/Modules/Private/3.ReportingFunctions/StyleFunctions/Build-ARIExcelComObject.ps1 index f464a291..b3ae315b 100644 --- a/Modules/Private/3.ReportingFunctions/StyleFunctions/Build-ARIExcelComObject.ps1 +++ b/Modules/Private/3.ReportingFunctions/StyleFunctions/Build-ARIExcelComObject.ps1 @@ -49,27 +49,60 @@ function Build-ARIExcelComObject { $NoChangeChart = ('ChartP0', 'ChartP1', 'ChartP2', 'ChartP3', 'ChartP4', 'ChartP5', 'ChartP6', 'ChartP7', 'ChartP8', 'ChartP9', 'ARI', 'RGs', 'TP00', 'TP0', 'TP1', 'TP2', 'TP3', 'TP4', 'TP5','TP6','TP7','TP8','TP9') $ChangeChart = ('ARI', 'RGs', 'TP00', 'TP0', 'TP1', 'TP2', 'TP3', 'TP4', 'TP5', 'TP6', 'TP7','TP8','TP9') - ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP0' }).DrawingObject.Chart.ChartStyle = 294 + if ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP0' }) + { + ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP0' }).DrawingObject.Chart.ChartStyle = 294 + } Start-Sleep -Milliseconds 50 - ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP1' }).DrawingObject.Chart.ChartStyle = 222 + if ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP1' }) + { + ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP1' }).DrawingObject.Chart.ChartStyle = 222 + } Start-Sleep -Milliseconds 50 - ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP2' }).DrawingObject.Chart.ChartStyle = 294 + if ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP2' }) + { + ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP2' }).DrawingObject.Chart.ChartStyle = 294 + } Start-Sleep -Milliseconds 50 - ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP3' }).DrawingObject.Chart.ChartStyle = 268 + if ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP3' }) + { + ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP3' }).DrawingObject.Chart.ChartStyle = 268 + } Start-Sleep -Milliseconds 50 - ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP4' }).DrawingObject.Chart.ChartStyle = 294 + if ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP4' }) + { + ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP4' }).DrawingObject.Chart.ChartStyle = 294 + } Start-Sleep -Milliseconds 50 - ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP5' }).DrawingObject.Chart.ChartStyle = 222 + if ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP5' }) + { + ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP5' }).DrawingObject.Chart.ChartStyle = 222 + } Start-Sleep -Milliseconds 50 - ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP6' }).DrawingObject.Chart.ChartStyle = 294 + if ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP6' }) + { + ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP6' }).DrawingObject.Chart.ChartStyle = 294 + } Start-Sleep -Milliseconds 50 - ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP7' }).DrawingObject.Chart.ChartStyle = 268 + if ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP7' }) + { + ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP7' }).DrawingObject.Chart.ChartStyle = 268 + } Start-Sleep -Milliseconds 50 - ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP8' }).DrawingObject.Chart.ChartStyle = 294 + if ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP8' }) + { + ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP8' }).DrawingObject.Chart.ChartStyle = 294 + } Start-Sleep -Milliseconds 50 - ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP9' }).DrawingObject.Chart.ChartStyle = 268 + if ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP9' }) + { + ($WSheet.Shapes | Where-Object { $_.name -eq 'ChartP9' }).DrawingObject.Chart.ChartStyle = 268 + } Start-Sleep -Milliseconds 50 - ($WSheet.Shapes | Where-Object { $_.name -notin $NoChangeChart -and $_.name -like 'Chart*' }).DrawingObject.Chart.ChartStyle = 315 + if ($WSheet.Shapes | Where-Object { $_.name -notin $NoChangeChart -and $_.name -like 'Chart*' }) + { + ($WSheet.Shapes | Where-Object { $_.name -notin $NoChangeChart -and $_.name -like 'Chart*' }).DrawingObject.Chart.ChartStyle = 315 + } Start-Sleep -Milliseconds 50 Foreach ($Changer in $ChangeChart) { diff --git a/Modules/Public/PublicFunctions/Diagram/Start-ARIDiagramJob.ps1 b/Modules/Public/PublicFunctions/Diagram/Start-ARIDiagramJob.ps1 index 5c613502..644c42e1 100644 --- a/Modules/Public/PublicFunctions/Diagram/Start-ARIDiagramJob.ps1 +++ b/Modules/Public/PublicFunctions/Diagram/Start-ARIDiagramJob.ps1 @@ -12,7 +12,7 @@ https://github.com/microsoft/ARI/Modules/Public/PublicFunctions/Diagram/Start-AR This PowerShell Module is part of Azure Resource Inventory (ARI) .NOTES -Version: 3.6.0 +Version: 3.6.5 First Release Date: 15th Oct, 2024 Authors: Claudio Merola @@ -84,7 +84,7 @@ Function Start-ARIDiagramJob { $Variables - } -ArgumentList $resources, $null + } -ArgumentList $resources, $null | Out-Null } else { diff --git a/Modules/Public/PublicFunctions/Diagram/Start-ARIDrawIODiagram.ps1 b/Modules/Public/PublicFunctions/Diagram/Start-ARIDrawIODiagram.ps1 index a2af3ce3..9fdf9f86 100644 --- a/Modules/Public/PublicFunctions/Diagram/Start-ARIDrawIODiagram.ps1 +++ b/Modules/Public/PublicFunctions/Diagram/Start-ARIDrawIODiagram.ps1 @@ -12,7 +12,7 @@ https://github.com/microsoft/ARI/Modules/Public/PublicFunctions/Diagram/Start-AR This PowerShell Module is part of Azure Resource Inventory (ARI) .NOTES -Version: 3.6.0 +Version: 3.6.5 First Release Date: 15th Oct, 2024 Authors: Claudio Merola @@ -63,7 +63,7 @@ function Start-ARIDrawIODiagram { { ('DrawIOCoreFile - '+(get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - Error: ' + $_.Exception.Message) | Out-File -FilePath $($args[3]) -Append } - } -ArgumentList $Subscriptions, $Resources, $DiagramCache, $Logfile + } -ArgumentList $Subscriptions, $Resources, $DiagramCache, $Logfile | Out-Null } else { @@ -94,7 +94,7 @@ function Start-ARIDrawIODiagram { { ('DrawIOCoreFile - '+(get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - Error: ' + $_.Exception.Message) | Out-File -FilePath $($args[2]) -Append } - } -ArgumentList $ResourceContainers, $DiagramCache, $Logfile + } -ArgumentList $ResourceContainers, $DiagramCache, $Logfile | Out-Null } else { @@ -133,7 +133,7 @@ function Start-ARIDrawIODiagram { { ('DrawIOCoreFile - '+(get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - Error: ' + $_.Exception.Message) | Out-File -FilePath $($args[7]) -Append } - } -ArgumentList $Subscriptions, $Job, $Advisories, $DiagramCache, $FullEnvironment, $DDFile, $XMLFiles, $Logfile, $Automation + } -ArgumentList $Subscriptions, $Job, $Advisories, $DiagramCache, $FullEnvironment, $DDFile, $XMLFiles, $Logfile, $Automation | Out-Null } else { diff --git a/Modules/Public/PublicFunctions/Invoke-ARI.ps1 b/Modules/Public/PublicFunctions/Invoke-ARI.ps1 index 44847cc9..0f5c0d86 100644 --- a/Modules/Public/PublicFunctions/Invoke-ARI.ps1 +++ b/Modules/Public/PublicFunctions/Invoke-ARI.ps1 @@ -1,4 +1,3 @@ -#Requires -Version 7 <# .SYNOPSIS This script creates Excel file to Analyze Azure Resources inside a Tenant @@ -288,6 +287,7 @@ Function Invoke-ARI { if ($PlatOS -eq 'Azure CloudShell') { $Heavy = $true + $SkipAPIs = $true } if ($StorageAccount) diff --git a/Modules/Public/PublicFunctions/Invoke-AzureRAMPInventory.ps1 b/Modules/Public/PublicFunctions/Invoke-AzureRAMPInventory.ps1 index 3c6de201..b4811631 100644 --- a/Modules/Public/PublicFunctions/Invoke-AzureRAMPInventory.ps1 +++ b/Modules/Public/PublicFunctions/Invoke-AzureRAMPInventory.ps1 @@ -1,4 +1,3 @@ -#Requires -Version 7 function Invoke-AzureRAMPInventory { [CmdletBinding(PositionalBinding=$false)] param ( diff --git a/docs/user-guide/troubleshooting.md b/docs/user-guide/troubleshooting.md index aa0f5f6a..0bf4a4b7 100644 --- a/docs/user-guide/troubleshooting.md +++ b/docs/user-guide/troubleshooting.md @@ -86,7 +86,7 @@ Install-Module -Name ImportExcel, Az.Accounts, Az.ResourceGraph, Az.Storage, Az. **Solutions**: 1. Use lightweight mode: ```powershell - Invoke-ARI -Lite + Invoke-ARI -Heavy ``` 2. Skip diagram generation: ```powershell @@ -107,7 +107,7 @@ Install-Module -Name ImportExcel, Az.Accounts, Az.ResourceGraph, Az.Storage, Az. **Solutions**: 1. Close other memory-intensive applications -2. Use the `-Lite` parameter to reduce memory usage +2. Use the `-Heavy` parameter to reduce memory usage 3. Scope to fewer subscriptions at a time 4. Skip diagram generation with `-SkipDiagram`