diff --git a/AzureResourceInventory.psd1 b/AzureResourceInventory.psd1 index 68be678..76a2c81 100644 --- a/AzureResourceInventory.psd1 +++ b/AzureResourceInventory.psd1 @@ -12,7 +12,7 @@ RootModule = 'AzureResourceInventory.psm1' # Version number of this module. -ModuleVersion = '3.5.1' +ModuleVersion = '3.5.2' # Supported PSEditions # CompatiblePSEditions = @() @@ -68,7 +68,7 @@ RequiredModules = @('ImportExcel','Az.Accounts','Az.Compute','Az.ResourceGraph', # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess NestedModules = @('Modules/Core/ARITestPS.psm1', 'Modules/ARIResourceJobs.psm1', - 'Modules/ARIResourcesReport.psm1', + 'Modules/ARIReportJobs.psm1', 'Modules/Core/ARIExtraJobs.psm1' 'Modules/Core/ARILoginSession.psm1', 'Modules/Inventory/ARIResourceDataPull.psm1', @@ -81,6 +81,7 @@ NestedModules = @('Modules/Core/ARITestPS.psm1', 'Modules/Inventory/ARISubInv.psm1', 'Modules/Inventory/ARIQuotaInv.psm1', 'Modules/Extras/ARIReportCharts.psm1', + 'Modules/Extras/ARIExcelDetails.psm1', 'Modules/Diagram/ARIDrawIODiagram.psm1', 'Modules/Diagram/ARIDiagramNetwork.psm1', 'Modules/Diagram/ARIDiagramOrganization.psm1', @@ -91,6 +92,7 @@ NestedModules = @('Modules/Core/ARITestPS.psm1', # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = @('Invoke-ARI', 'Connect-ARILoginSession', + 'Build-ARIExcelLargeReport', 'Test-ARIPS', 'Start-AzureResourceDataPull', 'Get-ARISubscriptions', @@ -118,7 +120,10 @@ FunctionsToExport = @('Invoke-ARI', 'Get-ARIUnsupportedData', 'Start-ARIQuotaJob', 'Start-ARIAutResourceJob', - 'Get-ARIAPIResources') + 'Get-ARIAPIResources', + 'Build-ARILargeReportResources', + 'Start-ARIExcelHeaders', + 'Start-ARILargeEnvOrderFiles') # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = @() diff --git a/AzureResourceInventory.psm1 b/AzureResourceInventory.psm1 index 8202201..d17b904 100644 --- a/AzureResourceInventory.psm1 +++ b/AzureResourceInventory.psm1 @@ -77,6 +77,7 @@ param ([ValidateSet('AzureCloud', 'AzureUSGovernment')] $TagKey, $TagValue, [switch]$SecurityCenter, + [switch]$Heavy, [switch]$SkipAdvisory, [switch]$SkipPolicy, [switch]$SkipAPIs, @@ -162,8 +163,6 @@ param ([ValidateSet('AzureCloud', 'AzureUSGovernment')] Write-Host "" } - <######################################################### END OF FUNCTIONS ######################################################################> - $TotalRunTime = Measure-Command -Expression { if ($Help.IsPresent) { @@ -172,8 +171,11 @@ param ([ValidateSet('AzureCloud', 'AzureUSGovernment')] } else { - Write-Host ('Checking for Powershell Module Updates..') - Update-Module -Name AzureResourceInventory -AcceptLicense + if ($PlatOS -ne 'Azure CloudShell' -and !$Automation.IsPresent) + { + Write-Host ('Checking for Powershell Module Updates..') + Update-Module -Name AzureResourceInventory -AcceptLicense + } $PlatOS = Test-ARIPS -Debug $Debug @@ -325,7 +327,7 @@ param ([ValidateSet('AzureCloud', 'AzureUSGovernment')] Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting Resources Report Function.') - Build-AzureResourceReport -Subscriptions $Subscriptions -DefaultPath $DefaultPath -ExtractionRunTime $ExtractionRuntime -Resources $Resources -SecurityCenter $SecurityCenter -File $File -DDFile $DDFile -SkipDiagram $SkipDiagram -RunLite $RunLite -PlatOS $PlatOS -InTag $InTag -SkipPolicy $SkipPolicy -SkipAdvisory $SkipAdvisory -Automation $Automation -SkipAPIs $SkipAPIs, -Overview $Overview -Debug $Debug + Build-AzureResourceReport -Subscriptions $Subscriptions -DefaultPath $DefaultPath -ExtractionRunTime $ExtractionRuntime -Resources $Resources -SecurityCenter $SecurityCenter -File $File -DDFile $DDFile -Heavy $Heavy -SkipDiagram $SkipDiagram -RunLite $RunLite -PlatOS $PlatOS -InTag $InTag -SkipPolicy $SkipPolicy -SkipAdvisory $SkipAdvisory -Automation $Automation -SkipAPIs $SkipAPIs, -Overview $Overview -Debug $Debug if ($StorageAccount) { diff --git a/Modules/ARIReportJobs.psm1 b/Modules/ARIReportJobs.psm1 new file mode 100644 index 0000000..4e3dd4d --- /dev/null +++ b/Modules/ARIReportJobs.psm1 @@ -0,0 +1,230 @@ +function Start-ARIResourceReporting { + Param($InTag, $file, $SmaResources, $DefaultPath, $TableStyle, $Unsupported, $DebugEnvSize, $DataActive, $Debug) + if ($Debug.IsPresent) + { + $DebugPreference = 'Continue' + $ErrorActionPreference = 'Continue' + } + else + { + $ErrorActionPreference = "silentlycontinue" + } + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting Reporting Phase.') + Write-Progress -activity $DataActive -Status "Processing Inventory" -PercentComplete 50 + + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Running Asynchronous, Gathering List Of Modules.') + if($PSScriptRoot -like '*\*') + { + $Modules = Get-ChildItem -Path ($PSScriptRoot + '\Scripts\*.ps1') -Recurse + } + else + { + $Modules = Get-ChildItem -Path ($PSScriptRoot + '/Scripts/*.ps1') -Recurse + } + + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Modules Found: ' + $Modules.Count) + $Lops = $Modules.count + $ReportCounter = 0 + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Large Environment. Looking for Cached Resource Files.') + + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting to Process Modules.') + foreach ($Module in $Modules) { + + $c = (($ReportCounter / $Lops) * 100) + $c = [math]::Round($c) + Write-Progress -Id 1 -activity "Building Report" -Status "$c% Complete." -PercentComplete $c + + $ModuSeq0 = New-Object System.IO.StreamReader($Module.FullName) + $ModuSeq = $ModuSeq0.ReadToEnd() + $ModuSeq0.Dispose() + $ModuleName = $Module.name.replace('.ps1','') + + if ($DebugEnvSize -eq 'Large') + { + $SmaResources = @{} + if (Test-Path -Path ($DefaultPath+'\ReportCache\ResourceCache\'+$ModuleName+'.json') -PathType Leaf) + { + $SmaResources["$ModuleName"] = Get-Content -Path ($DefaultPath+'\ReportCache\ResourceCache\'+$ModuleName+'.json') | ConvertFrom-Json + } + else + { + $SmaResources["$ModuleName"] = 0 + } + } + + $ModuleResourceCount = $SmaResources.$ModuleName.count + + if ($ModuleResourceCount -gt 0) + { + Start-Sleep -Milliseconds 25 + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+"Running Module: '$ModuleName'. Lines Count: $ModuleResourceCount") + + $ExcelRun = ([PowerShell]::Create()).AddScript($ModuSeq).AddArgument($PSScriptRoot).AddArgument($null).AddArgument($InTag).AddArgument($null).AddArgument('Reporting').AddArgument($file).AddArgument($SmaResources).AddArgument($TableStyle).AddArgument($Unsupported) + + $ExcelJob = $ExcelRun.BeginInvoke() + + while ($ExcelJob.IsCompleted -contains $false) { Start-Sleep -Milliseconds 200 } + + $ExcelRun.EndInvoke($ExcelJob) + + $ExcelRun.Dispose() + Remove-Variable -Name ExcelRun + Remove-Variable -Name ExcelJob + + } + + if ($DebugEnvSize -eq 'Large') + { + Remove-Variable -Name SmaResources + [System.GC]::Collect() + Start-Sleep -Milliseconds 50 + } + + $ReportCounter ++ + } + + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Cleaning Variables to Release Memory.') + + if ($DebugEnvSize -eq 'Large') + { + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Removing Cache Files.') + Remove-Item -Path ($DefaultPath+'\ReportCache') -Recurse + } + else + { + Remove-Variable -Name SmaResources + } + + [System.GC]::GetTotalMemory($true) | out-null + Start-Sleep -Milliseconds 50 +} + +function Build-ARILargeReportResources { + Param($DefaultPath, $Debug) + if ($Debug.IsPresent) + { + $DebugPreference = 'Continue' + $ErrorActionPreference = 'Continue' + } + else + { + $ErrorActionPreference = "silentlycontinue" + } + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Looking for Cache Files.') + $LocalCacheFiles = Get-ChildItem -Path ($DefaultPath+'\ReportCache\*.json') + + $Looper = 0 + + foreach ($LocalFile in $LocalCacheFiles) + { + $Looper ++ + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting Resource Excel Data Processing Jobs.') + Start-job -Name ('ExcelJob_'+$Looper) -ScriptBlock { + + $LocalFile = $($args[1]) + $DefaultPath = $($args[2]) + $LocalFolder = $LocalFile.Name.replace(".json","") + + if($($args[0]) -like '*\*') + { + $Modules = Get-ChildItem -Path ($($args[0]) + '\Scripts\*.ps1') -Recurse + + $ModFolder = ($DefaultPath+'\ReportCache\'+$LocalFolder+'\') + if ((Test-Path -Path $ModFolder -PathType Container) -eq $false) { + New-Item -Type Directory -Force -Path $ModFolder | Out-Null + } + } + else + { + $Modules = Get-ChildItem -Path ($($args[0]) + '/Scripts/*.ps1') -Recurse + $ModFolder = ($DefaultPath+'/ReportCache/'+$LocalFolder+'/') + } + + $TempContent = Get-Content -Path $LocalFile | ConvertFrom-Json + + $job = @() + + $Modules | ForEach-Object { + $ModName = $_.Name.replace(".ps1","") + if($TempContent.$ModName.count -gt 0) + { + $TempVal = $TempContent.$ModName + $ModNameFile = ($ModName+'.json') + Start-Sleep -Milliseconds 100 + + New-Variable -Name ('ModRun' + $ModName) + New-Variable -Name ('ModJob' + $ModName) + + Set-Variable -Name ('ModRun' + $ModName) -Value ([PowerShell]::Create()).AddScript({Param($ModFolder,$TempVal,$ModNameFile)$TempVal | ConvertTo-Json -Depth 50 | Out-File -FilePath ($ModFolder+$ModNameFile)}).AddArgument($ModFolder).AddArgument($TempVal).AddArgument($ModNameFile) + + Set-Variable -Name ('ModJob' + $ModName) -Value ((get-variable -name ('ModRun' + $ModName)).Value).BeginInvoke() + + Start-Sleep -Milliseconds 100 + + $job += (get-variable -name ('ModJob' + $ModName)).Value + Remove-Variable -Name ModName + } + } + + while ($Job.Runspace.IsCompleted -contains $false) { Start-Sleep -Milliseconds 1000 } + + $Modules | ForEach-Object { + $ModName = $_.Name.replace(".ps1","") + if($TempContent.$ModName.count -gt 0) + { + Remove-Variable -Name ('ModRun' + $ModName) + Remove-Variable -Name ('ModJob' + $ModName) + Remove-Variable -Name ModName + } + } + + [System.GC]::Collect() | out-null + Start-Sleep -Milliseconds 50 + + } -ArgumentList $PSScriptRoot, $LocalFile, $DefaultPath + } + +} + +function Start-ARILargeEnvOrderFiles { + Param($DefaultPath,$Debug) + if ($Debug.IsPresent) + { + $DebugPreference = 'Continue' + $ErrorActionPreference = 'Continue' + } + else + { + $ErrorActionPreference = "silentlycontinue" + } + + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Ordering Cached Files.') + + if($PSScriptRoot -like '*\*') + { + $Modules = Get-ChildItem -Path ($PSScriptRoot + '\Scripts\*.ps1') -Recurse + $ModFolder = ($DefaultPath+'\ReportCache\ResourceCache\') + if ((Test-Path -Path $ModFolder -PathType Container) -eq $false) { + New-Item -Type Directory -Force -Path $ModFolder | Out-Null + } + } + else + { + $Modules = Get-ChildItem -Path ($PSScriptRoot + '/Scripts/*.ps1') -Recurse + $ModFolder = ($DefaultPath+'/ReportCache/ResourceCache/') + if ((Test-Path -Path $ModFolder -PathType Container) -eq $false) { + New-Item -Type Directory -Force -Path $ModFolder | Out-Null + } + } + + foreach ($Module in $Modules) + { + $ModuleName = $Module.name.replace('.ps1','') + if (Test-Path -Path ($DefaultPath+'\ReportCache\ResourceJob_*\'+$ModuleName+'.json') -PathType Leaf) + { + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Merging Cached File for: '+$ModuleName) + $ModContent = Get-ChildItem -Path ($DefaultPath+'\ReportCache\ResourceJob_*\'+$ModuleName+'.json') | ForEach-Object {Get-Content -Path $_ | ConvertFrom-Json} + $ModContent | ConvertTo-Json -Depth 40 | Out-File -FilePath ($ModFolder+'\'+$ModuleName+'.json') + } + } +} \ No newline at end of file diff --git a/Modules/ARIResourceJobs.psm1 b/Modules/ARIResourceJobs.psm1 index 182c8b7..f43159f 100644 --- a/Modules/ARIResourceJobs.psm1 +++ b/Modules/ARIResourceJobs.psm1 @@ -1,5 +1,5 @@ function Start-ARIResourceJobs { - Param ($Resources, $Subscriptions, $InTag, $Unsupported, $Debug) + Param ($Resources, $Subscriptions, $InTag, $Heavy, $Unsupported, $Debug) if ($Debug.IsPresent) { $DebugPreference = 'Continue' @@ -11,17 +11,22 @@ function Start-ARIResourceJobs { } switch ($Resources.count) { - {$_ -le 1000} + {$_ -le 5000} { $EnvSizeLooper = 1000 $DebugEnvSize = 'Small' } - {$_ -gt 1000 -and $_ -le 10000} + {$_ -gt 5000 -and $_ -le 12500} { $EnvSizeLooper = 2500 $DebugEnvSize = 'Medium' } - {$_ -gt 10000} + {$_ -gt 12500 -and $_ -le 50000} + { + $EnvSizeLooper = 5000 + $DebugEnvSize = 'Medium-Large' + } + {$_ -gt 50000} { $EnvSizeLooper = 5000 $DebugEnvSize = 'Large' @@ -30,6 +35,10 @@ function Start-ARIResourceJobs { Write-Host ('Jobs will be run in batches to avoid CPU Overload.') } } + if($Heavy.isPresent) + { + $DebugEnvSize = 'Large' + } Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting Processing Jobs in '+ $DebugEnvSize +' Mode.') $Loop = $Resources.count / $EnvSizeLooper @@ -52,8 +61,6 @@ function Start-ARIResourceJobs { Start-Job -Name ('ResourceJob_'+$Looper) -ScriptBlock { - $Job = @() - $Subscriptions = $($args[2]) $InTag = $($args[3]) $Resource = $($args[4]) @@ -87,7 +94,7 @@ function Start-ARIResourceJobs { $job += (get-variable -name ('ModJob' + $ModName)).Value Start-Sleep -Milliseconds 250 - Clear-Variable -Name ModName + Remove-Variable -Name ModName } while ($Job.Runspace.IsCompleted -contains $false) { Start-Sleep -Milliseconds 1000 } @@ -99,14 +106,12 @@ function Start-ARIResourceJobs { New-Variable -Name ('ModValue' + $ModName) Set-Variable -Name ('ModValue' + $ModName) -Value (((get-variable -name ('ModRun' + $ModName)).Value).EndInvoke((get-variable -name ('ModJob' + $ModName)).Value)) - Clear-Variable -Name ('ModRun' + $ModName) - Clear-Variable -Name ('ModJob' + $ModName) + Remove-Variable -Name ('ModRun' + $ModName) + Remove-Variable -Name ('ModJob' + $ModName) Start-Sleep -Milliseconds 250 - Clear-Variable -Name ModName + Remove-Variable -Name ModName } - [System.GC]::GetTotalMemory($true) | out-null - $Hashtable = New-Object System.Collections.Hashtable $Modules | ForEach-Object { @@ -115,19 +120,20 @@ function Start-ARIResourceJobs { $Hashtable["$ModName"] = (get-variable -name ('ModValue' + $ModName)).Value - Clear-Variable -Name ('ModValue' + $ModName) + Remove-Variable -Name ('ModValue' + $ModName) Start-Sleep -Milliseconds 100 - Clear-Variable -Name ModName + Remove-Variable -Name ModName } - [System.GC]::GetTotalMemory($true) | out-null + [System.GC]::Collect() | out-null + Start-Sleep -Milliseconds 50 $Hashtable } -ArgumentList $null, $PSScriptRoot, $Subscriptions, $InTag, $Resource, 'Processing', $null, $null, $null, $Unsupported | Out-Null $Limit = $Limit + $EnvSizeLooper - Start-Sleep -Milliseconds 250 - if($DebugEnvSize -in ('Large') -and $JobLoop -eq 5) + Start-Sleep -Milliseconds 100 + if($DebugEnvSize -in ('Large','Medium-Large') -and $JobLoop -eq 5) { Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Waiting Batch of Jobs to Complete.') @@ -139,14 +145,13 @@ function Start-ARIResourceJobs { $jb = get-job -Name $InterJobNames $c = (((($jb.count - ($jb | Where-Object { $_.State -eq 'Running' }).Count)) / $jb.Count) * 100) Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'initial Jobs Running: '+[string]($jb | Where-Object { $_.State -eq 'Running' }).count) - $c = [math]::Round($coun) + $coun = [math]::Round($c) Write-Progress -Id 1 -activity "Processing Initial Resource Jobs" -Status "$coun% Complete." -PercentComplete $coun Start-Sleep -Seconds 15 } $JobLoop = 0 } $JobLoop ++ - [System.GC]::GetTotalMemory($true) | out-null } return $DebugEnvSize } diff --git a/Modules/ARIResourcesReport.psm1 b/Modules/ARIResourcesReport.psm1 deleted file mode 100644 index 33eb65c..0000000 --- a/Modules/ARIResourcesReport.psm1 +++ /dev/null @@ -1,99 +0,0 @@ -function Start-ARIResourceReporting { - Param($InTag, $file, $SmaResources, $DefaultPath, $TableStyle, $Unsupported, $DebugEnvSize, $DataActive, $Debug) - if ($Debug.IsPresent) - { - $DebugPreference = 'Continue' - $ErrorActionPreference = 'Continue' - } - else - { - $ErrorActionPreference = "silentlycontinue" - } - Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting Reporting Phase.') - Write-Progress -activity $DataActive -Status "Processing Inventory" -PercentComplete 50 - - Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Running Offline, Gathering List Of Modules.') - if($PSScriptRoot -like '*\*') - { - $Modules = Get-ChildItem -Path ($PSScriptRoot + '\Scripts\*.ps1') -Recurse - } - else - { - $Modules = Get-ChildItem -Path ($PSScriptRoot + '/Scripts/*.ps1') -Recurse - } - - Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Modules Found: ' + $Modules.Count) - $Lops = $Modules.count - $ReportCounter = 0 - - if($DebugEnvSize -eq 'Large') - { - Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Looking for Cache Files.') - $LocalCacheFiles = Get-ChildItem -Path ($DefaultPath+'\ReportCache\*.json') - } - - foreach ($Module in $Modules) { - - $c = (($ReportCounter / $Lops) * 100) - $c = [math]::Round($c) - Write-Progress -Id 1 -activity "Building Report" -Status "$c% Complete." -PercentComplete $c - - $ModuSeq0 = New-Object System.IO.StreamReader($Module.FullName) - $ModuSeq = $ModuSeq0.ReadToEnd() - $ModuSeq0.Dispose() - Start-Sleep -Milliseconds 50 - $ModuleName = $Module.name.replace('.ps1','') - - if($DebugEnvSize -eq 'Large') - { - $SmaResources = foreach ($LocalFile in $LocalCacheFiles) - { - $TempContent = Get-Content -Path $LocalFile | ConvertFrom-Json - if ($TempContent.$ModuleName.count -gt 0) - { - $TempVar = @{ - $ModuleName = $TempContent.$ModuleName - } - } - $TempVar - } - } - - $ModuleResourceCount = $SmaResources.$ModuleName.count - - if ($ModuleResourceCount -gt 0) - { - Start-Sleep -Milliseconds 100 - Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+"Running Module: '$ModuleName'. Lines Count: $ModuleResourceCount") - - $ExcelRun = ([PowerShell]::Create()).AddScript($ModuSeq).AddArgument($PSScriptRoot).AddArgument($null).AddArgument($InTag).AddArgument($null).AddArgument('Reporting').AddArgument($file).AddArgument($SmaResources).AddArgument($TableStyle).AddArgument($Unsupported) - - $ExcelJob = $ExcelRun.BeginInvoke() - - while ($ExcelJob.IsCompleted -contains $false) { Start-Sleep -Milliseconds 500 } - - $ExcelRun.EndInvoke($ExcelJob) - - $ExcelRun.Dispose() - - [System.GC]::GetTotalMemory($true) | out-null - } - - if($DebugEnvSize -eq 'Large') - { - Clear-Variable SmaResources - [System.GC]::GetTotalMemory($true) | out-null - } - - $ReportCounter ++ - - } - - if($DebugEnvSize -eq 'Large') - { - Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Cleaning Cache Files.') - Remove-Item -Path ($DefaultPath+'\ReportCache\') -Recurse - } - - Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Resource Reporting Phase Done.') -} \ No newline at end of file diff --git a/Modules/Extras/ARIExcelDetails.psm1 b/Modules/Extras/ARIExcelDetails.psm1 new file mode 100644 index 0000000..7169e49 --- /dev/null +++ b/Modules/Extras/ARIExcelDetails.psm1 @@ -0,0 +1,170 @@ +function Start-ARIExcelHeaders { + Param($file, $Debug) + if ($Debug.IsPresent) + { + $DebugPreference = 'Continue' + $ErrorActionPreference = 'Continue' + } + else + { + $ErrorActionPreference = "silentlycontinue" + } + + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Adding Header Comments.') + $excel = Open-ExcelPackage -Path $File -KillExcel + + if($excel.'Event Hubs') + { + $null = $excel.'Event Hubs'.Cells["L1"].AddComment("The Auto-inflate feature of Event Hubs automatically scales up by increasing the number of throughput units, to meet usage needs. Increasing throughput units prevents throttling scenarios.", "Azure Resource Inventory") + $excel.'Event Hubs'.Cells["L1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-auto-inflate' + } + + <################################################################### RESOURCE ###################################################################> + + if($excel.'CloudServices') + { + $null = $excel.'CloudServices'.Cells["F1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.") + $excel.'CloudServices'.Cells["F1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' + } + + <################################################################### RESOURCE ###################################################################> + + if($excel.'Virtual Machines') + { + $null = $excel.'Virtual Machines'.Cells["N1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") + $excel.'Virtual Machines'.Cells["N1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' + + $null = $excel.'Virtual Machines'.Cells["R1"].AddComment("Boot diagnostics is a debugging feature for Azure virtual machines (VM) that allows diagnosis of VM boot failures.", "Azure Resource Inventory") + $excel.'Virtual Machines'.Cells["R1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/virtual-machines/boot-diagnostics' + + $null = $excel.'Virtual Machines'.Cells["S1"].AddComment("Is recommended to install Performance Diagnostics Agent in every Azure Virtual Machine upfront. The agent is only used when triggered by the console and may save time in an event of performance struggling.", "Azure Resource Inventory") + $excel.'Virtual Machines'.Cells["S1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/performance-diagnostics' + + $null = $excel.'Virtual Machines'.Cells["T1"].AddComment("We recommend that you use Azure Monitor to gain visibility into your resource's health.", "Azure Resource Inventory") + $excel.'Virtual Machines'.Cells["T1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/security/fundamentals/iaas#monitor-vm-performance' + + $null = $excel.'Virtual Machines'.Cells["AF1"].AddComment("Use a network security group to protect against unsolicited traffic into Azure subnets. Network security groups are simple, stateful packet inspection devices that use the 5-tuple approach (source IP, source port, destination IP, destination port, and layer 4 protocol) to create allow/deny rules for network traffic.", "Azure Resource Inventory") + $excel.'Virtual Machines'.Cells["AF1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/security/fundamentals/network-best-practices#logically-segment-subnets' + + $null = $excel.'Virtual Machines'.Cells["AI1"].AddComment("Accelerated networking enables single root I/O virtualization (SR-IOV) to a VM, greatly improving its networking performance. This high-performance path bypasses the host from the datapath, reducing latency, jitter, and CPU utilization.", "Azure Resource Inventory") + $excel.'Virtual Machines'.Cells["AI1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/virtual-network/create-vm-accelerated-networking-cli' + } + + <################################################################### RESOURCE ###################################################################> + + if($excel.'AKS') + { + $null = $excel.'AKS'.Cells["E1"].AddComment("Microsoft recommends Free Pricing tier only for non-production workloads", "Azure Resource Inventory") + $excel.'AKS'.Cells["E1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/free-standard-pricing-tiers' + + $null = $excel.'AKS'.Cells["F1"].AddComment("AKS follows 12 months of support for a generally available (GA) Kubernetes version. To read more about our support policy for Kubernetes versioning", "Azure Resource Inventory") + $excel.'AKS'.Cells["F1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-kubernetes-release-calendar' + + $null = $excel.'AKS'.Cells["J1"].AddComment("Local accounts are enabled by default. Even when you enable RBAC or Microsoft Entra integration", "Azure Resource Inventory") + $excel.'AKS'.Cells["J1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/manage-local-accounts-managed-azure-ad' + + $null = $excel.'AKS'.Cells["T1"].AddComment("By default AKS Control Plane is exposed on a public endpoint accessible over the internet. Organizations who want to disable this public endpoint, can leverage the private cluster feature", "Azure Resource Inventory") + $excel.'AKS'.Cells["T1"].Hyperlink = 'https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/public-and-private-aks-clusters-demystified/ba-p/3716838' + + $null = $excel.'AKS'.Cells["W1"].AddComment("By enabling auto-upgrade, you can ensure your clusters are up to date and don't miss the latest features or patches from AKS and upstream Kubernetes.", "Azure Resource Inventory") + $excel.'AKS'.Cells["W1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/auto-upgrade-cluster?tabs=azure-cli#why-use-cluster-auto-upgrade' + + $null = $excel.'AKS'.Cells["X1"].AddComment("Node-level OS security updates are released at a faster rate than Kubernetes patch or minor version updates. The node OS auto-upgrade channel grants you flexibility and enables a customized strategy for node-level OS security updates.", "Azure Resource Inventory") + $excel.'AKS'.Cells["X1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/auto-upgrade-node-os-image?tabs=azure-cli#interactions-between-node-os-auto-upgrade-and-cluster-auto-upgrade' + + $null = $excel.'AKS'.Cells["Y1"].AddComment("Container insights collects metric data from your cluster in addition to logs. This functionality has been replaced by Azure Monitor managed service for Prometheus. You can analyze that data using built-in dashboards in Managed Grafana and alert on them using prebuilt Prometheus alert rules.", "Azure Resource Inventory") + $excel.'AKS'.Cells["Y1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/azure-monitor/containers/container-insights-overview' + + $null = $excel.'AKS'.Cells["AH1"].AddComment("System node pools require a VM SKU of at least 2 vCPUs and 4 GB memory. But burstable-VM(B series) isn't recommended", "Azure Resource Inventory") + $excel.'AKS'.Cells["AH1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/use-system-pools?tabs=azure-cli#system-and-user-node-pools' + + $null = $excel.'AKS'.Cells["AI1"].AddComment("An AKS cluster distributes resources, such as nodes and storage, across logical sections of underlying Azure infrastructure. Using availability zones physically separates nodes from other nodes deployed to different availability zones. AKS clusters deployed with multiple availability zones configured across a cluster provide a higher level of availability to protect against a hardware failure or a planned maintenance event.", "Azure Resource Inventory") + $excel.'AKS'.Cells["AI1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/availability-zones-overview' + + $null = $excel.'AKS'.Cells["AM1"].AddComment("The cluster autoscaler component can watch for pods in your cluster that can't be scheduled because of resource constraints", "Azure Resource Inventory") + $excel.'AKS'.Cells["AM1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/cluster-autoscaler' + } + + <################################################################### RESOURCE ###################################################################> + + if($excel.'MySQL') + { + $null = $excel.'MySQL'.Cells["H1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") + $excel.'MySQL'.Cells["H1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' + } + + <################################################################### RESOURCE ###################################################################> + + if($excel.'PostgreSQL') + { + $null = $excel.'PostgreSQL'.Cells["J1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") + $excel.'PostgreSQL'.Cells["J1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' + } + + <################################################################### RESOURCE ###################################################################> + + if($excel.'Redis Cache') + { + $null = $excel.'Redis Cache'.Cells["F1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") + $excel.'Redis Cache'.Cells["F1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' + } + + <################################################################### RESOURCE ###################################################################> + + if($excel.'App Gateway') + { + $null = $excel.'App Gateway'.Cells["K1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") + $excel.'App Gateway'.Cells["K1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' + } + + <################################################################### RESOURCE ###################################################################> + + if($excel.'Load Balancers') + { + $null = $excel.'Load Balancers'.Cells["E1"].AddComment("No SLA is provided for Basic Load Balancer!", "Azure Resource Inventory") + $excel.'Load Balancers'.Cells["E1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/load-balancer/skus' + + $null = $excel.'Load Balancers'.Cells["F1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") + $excel.'Load Balancers'.Cells["F1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' + } + + <################################################################### RESOURCE ###################################################################> + + if($excel.'Public IPs') + { + $null = $excel.'Public IPs'.Cells["G1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") + $excel.'Public IPs'.Cells["G1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' + } + + <################################################################### RESOURCE ###################################################################> + + if($excel.VirtualNetwork) + { + $null = $excel.VirtualNetwork.Cells["F1"].AddComment("Azure DDoS Protection Standard, combined with application design best practices, provides enhanced DDoS mitigation features to defend against DDoS attacks.", "Azure Resource Inventory") + $excel.VirtualNetwork.Cells["F1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/ddos-protection/ddos-protection-overview' + } + + <################################################################### RESOURCE ###################################################################> + + if($excel.'Storage Acc') + { + $null = $excel.'Storage Acc'.Cells["K1"].AddComment("Is recommended that you configure your storage account to accept requests from secure connections only by setting the Secure transfer required property for the storage account.", "Azure Resource Inventory") + $excel.'Storage Acc'.Cells["K1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/storage/common/storage-require-secure-transfer' + $null = $excel.'Storage Acc'.Cells["L1"].AddComment("When a container is configured for anonymous access, any client can read data in that container. Anonymous access presents a potential security risk, so if your scenario does not require it, we recommend that you remediate anonymous access for the storage account.", "Azure Resource Inventory") + $excel.'Storage Acc'.Cells["L1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/storage/blobs/anonymous-read-access-configure?tabs=portal' + $null = $excel.'Storage Acc'.Cells["M1"].AddComment("By default, Azure Storage accounts permit clients to send and receive data with the oldest version of TLS, TLS 1.0, and above. To enforce stricter security measures, you can configure your storage account to require that clients send and receive data with a newer version of TLS", "Azure Resource Inventory") + $excel.'Storage Acc'.Cells["M1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/storage/common/transport-layer-security-configure-minimum-version?tabs=portal' + $null = $excel.'Storage Acc'.Cells["I1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") + $excel.'Storage Acc'.Cells["I1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' + } + + <################################################################### RESOURCE ###################################################################> + + if($excel.Disks) + { + $null = $excel.Disks.Cells["D1"].AddComment("When you delete a virtual machine (VM) in Azure, by default, any disks that are attached to the VM aren't deleted. After a VM is deleted, you will continue to pay for unattached disks.", "Azure Resource Inventory") + $excel.Disks.Cells["D1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/virtual-machines/windows/find-unattached-disks' + } + + Close-ExcelPackage $excel +} \ No newline at end of file diff --git a/Modules/Inventory/ARIResourceReport.psm1 b/Modules/Inventory/ARIResourceReport.psm1 index 35556e0..07eb9ad 100644 --- a/Modules/Inventory/ARIResourceReport.psm1 +++ b/Modules/Inventory/ARIResourceReport.psm1 @@ -25,6 +25,7 @@ Function Build-AzureResourceReport { $SecurityCenter, $File, $DDFile, + $Heavy, $SkipDiagram, $RunLite, $PlatOS, @@ -78,17 +79,20 @@ Function Build-AzureResourceReport { { Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting Resource Jobs.') - $DebugEnvSize = Start-ARIResourceJobs -Resources $Resources -Subscriptions $Subscriptions -InTag $InTag -Unsupported $Unsupported -Debug $Debug + $DebugEnvSize = Start-ARIResourceJobs -Resources $Resources -Subscriptions $Subscriptions -InTag $InTag -Heavy $Heavy -Unsupported $Unsupported -Debug $Debug } <############################################################## RESOURCES LOOP CREATION #############################################################> if (!$Automation.IsPresent) { - if($DebugEnvSize -eq 'Large') + if($DebugEnvSize -in ('Large','Medium-Large')) { - Clear-Variable Resources + Clear-Variable -Name Resources + [System.GC]::Collect() | out-null + Start-Sleep -Milliseconds 100 [System.GC]::GetTotalMemory($true) | out-null + Start-Sleep -Milliseconds 100 } Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting Jobs Collector.') @@ -100,7 +104,7 @@ Function Build-AzureResourceReport { while (get-job -Name $JobNames | Where-Object { $_.State -eq 'Running' }) { $jb = get-job -Name $JobNames $c = (((($jb.count - ($jb | Where-Object { $_.State -eq 'Running' }).Count)) / $jb.Count) * 100) - Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Jobs Still Running: '+[string]($jb | Where-Object { $_.State -eq 'Running' }).count) + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Resource Jobs Still Running: '+[string]($jb | Where-Object { $_.State -eq 'Running' }).count) $c = [math]::Round($c) Write-Progress -Id 1 -activity "Processing Resource Jobs" -Status "$c% Complete." -PercentComplete $c Start-Sleep -Seconds 5 @@ -120,25 +124,37 @@ Function Build-AzureResourceReport { } else { - Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Creating Folder for Cache Files.') + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Checking Cache Folder.') if ((Test-Path -Path ($DefaultPath+'ReportCache\') -PathType Container) -eq $false) { + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Creating Folder for Cache Files.') New-Item -Type Directory -Force -Path ($DefaultPath+'ReportCache\') | Out-Null } + else { + If ((Get-ChildItem -Path ($DefaultPath+'ReportCache\') -Recurce | Measure-Object).Count -ge 1) { + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Removing Old Cache Files.') + Remove-Item -Path ($DefaultPath+'\ReportCache') -Recurse + New-Item -Type Directory -Force -Path ($DefaultPath+'ReportCache\') | Out-Null + } + } Foreach ($Job in $JobNames) { $TempJob = Receive-Job -Name $Job Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Job '+ $Job +' Returned: ' + ($TempJob.values | Where-Object {$_ -ne $null}).Count + ' Resource Types.') Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Creating Cache File: '+$job) - $TempJob | ConvertTo-Json -Depth 20 | Out-File ($DefaultPath+'ReportCache\'+$job+'.json') + $TempJob | ConvertTo-Json -Depth 40 | Out-File ($DefaultPath+'ReportCache\'+$job+'.json') + Remove-Job -Name $Job + Remove-Variable -Name TempJob } } } - <############################################################## REPORTING ###################################################################> - - Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting Resource Reporting.') + <############################################################## Processing ###################################################################> - Start-ARIResourceReporting -InTag $InTag -file $file -SmaResources $SmaResources -DefaultPath $DefaultPath -TableStyle $TableStyle -Unsupported $Unsupported -DebugEnvSize $DebugEnvSize -DataActive $DataActive -Debug $Debug + if($DebugEnvSize -eq 'Large') + { + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting Resource Reporting Cache (Large Environment).') + Build-ARILargeReportResources -DefaultPath $DefaultPath -Debug $Debug + } <################################################################### EXTRA REPORTS ###################################################################> @@ -146,6 +162,44 @@ Function Build-AzureResourceReport { Start-ARIExtraReports -File $File -QuotaUsage $QuotaUsage -SecurityCenter $SecurityCenter -SkipPolicy $SkipPolicy -SkipAdvisory $SkipAdvisory -TableStyle $TableStyle -Debug $Debug + <################################################################### LARGE ENV REPORTS ###################################################################> + + if($DebugEnvSize -eq 'Large') + { + $c = 0 + + $JobNames = (Get-Job | Where-Object {$_.name -like 'ExcelJob_*'}).Name + + while (get-job -Name $JobNames | Where-Object { $_.State -eq 'Running' }) { + $jb = get-job -Name $JobNames + $c = (((($jb.count - ($jb | Where-Object { $_.State -eq 'Running' }).Count)) / $jb.Count) * 100) + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Reporting Jobs Still Running: '+[string]($jb | Where-Object { $_.State -eq 'Running' }).count) + $c = [math]::Round($c) + Write-Progress -Id 1 -activity "Processing Excel Jobs" -Status "$c% Complete." -PercentComplete $c + Start-Sleep -Seconds 5 + } + Write-Progress -Id 1 -activity "Processing Excel Jobs" -Status "100% Complete." -Completed + + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Excel Jobs Compleated.') + + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting Ordering of Cached Files.') + + Start-ARILargeEnvOrderFiles -DefaultPath $DefaultPath -Debug $Debug + } + + <################################################################### RESOURCE REPORTING ###################################################################> + + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Starting Resource Reporting.') + + Start-ARIResourceReporting -InTag $InTag -file $file -SmaResources $SmaResources -DefaultPath $DefaultPath -TableStyle $TableStyle -Unsupported $Unsupported -DebugEnvSize $DebugEnvSize -DataActive $DataActive -Debug $Debug + + + <################################################################### REPORTING HEADERS ###################################################################> + + Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Adjusting Header Details.') + + Start-ARIExcelHeaders -File $file -Debug $Debug + <################################################################### CHARTS ###################################################################> Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Generating Overview sheet (Charts).') @@ -157,6 +211,9 @@ Function Build-AzureResourceReport { Build-ARIExcelChart -File $File -TableStyle $TableStyle -PlatOS $PlatOS -Subscriptions $Subscriptions -ExtractionRunTime $ExtractionRuntime -ReportingRunTime $ReportingRunTime -RunLite $RunLite -Overview $Overview -Debug $Debug [System.GC]::GetTotalMemory($true) | out-null + Start-Sleep -Milliseconds 100 + [System.GC]::Collect() | out-null + Start-Sleep -Milliseconds 100 Write-Debug ((get-date -Format 'yyyy-MM-dd_HH_mm_ss')+' - '+'Finished Charts Phase.') diff --git a/Modules/Scripts/APIs/ReservationRecom.ps1 b/Modules/Scripts/APIs/ReservationRecom.ps1 index 48a9850..0532499 100644 --- a/Modules/Scripts/APIs/ReservationRecom.ps1 +++ b/Modules/Scripts/APIs/ReservationRecom.ps1 @@ -96,6 +96,5 @@ Else { ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Reservation Advisor' -AutoSize -TableName $TableName -MaxAutoSizeRows 100 -TableStyle $tableStyle -Style $Style - } } \ No newline at end of file diff --git a/Modules/Scripts/APIs/SupportTickets.ps1 b/Modules/Scripts/APIs/SupportTickets.ps1 index 3c98037..f45c586 100644 --- a/Modules/Scripts/APIs/SupportTickets.ps1 +++ b/Modules/Scripts/APIs/SupportTickets.ps1 @@ -108,6 +108,5 @@ Else { ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'SupportTickets' -AutoSize -TableName $TableName -MaxAutoSizeRows 100 -TableStyle $tableStyle -ConditionalText $cond -Numberformat '0' -Style $Style - } } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/AzureAI.ps1 b/Modules/Scripts/Analytics/AzureAI.ps1 index ed72c49..2ca0ddb 100644 --- a/Modules/Scripts/Analytics/AzureAI.ps1 +++ b/Modules/Scripts/Analytics/AzureAI.ps1 @@ -119,14 +119,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Azure AI' -AutoSize -MaxAutoSizeRows 100 -ConditionalText $condtxt -TableName $TableName -TableStyle $tableStyle -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/ComputerVision.ps1 b/Modules/Scripts/Analytics/ComputerVision.ps1 index b583505..8446f27 100644 --- a/Modules/Scripts/Analytics/ComputerVision.ps1 +++ b/Modules/Scripts/Analytics/ComputerVision.ps1 @@ -119,14 +119,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Computer Vision' -AutoSize -MaxAutoSizeRows 100 -ConditionalText $condtxt -TableName $TableName -TableStyle $tableStyle -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/ContentMod.ps1 b/Modules/Scripts/Analytics/ContentMod.ps1 index e37376b..bdc7db6 100644 --- a/Modules/Scripts/Analytics/ContentMod.ps1 +++ b/Modules/Scripts/Analytics/ContentMod.ps1 @@ -119,14 +119,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Content Moderator' -AutoSize -MaxAutoSizeRows 100 -ConditionalText $condtxt -TableName $TableName -TableStyle $tableStyle -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/ContentSafety.ps1 b/Modules/Scripts/Analytics/ContentSafety.ps1 index 364ae64..78ec4bc 100644 --- a/Modules/Scripts/Analytics/ContentSafety.ps1 +++ b/Modules/Scripts/Analytics/ContentSafety.ps1 @@ -119,14 +119,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Content Safety' -AutoSize -MaxAutoSizeRows 100 -ConditionalText $condtxt -TableName $TableName -TableStyle $tableStyle -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/CustomVision.ps1 b/Modules/Scripts/Analytics/CustomVision.ps1 index 7ad1e71..0808fcb 100644 --- a/Modules/Scripts/Analytics/CustomVision.ps1 +++ b/Modules/Scripts/Analytics/CustomVision.ps1 @@ -121,14 +121,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Custom Vision' -AutoSize -MaxAutoSizeRows 100 -ConditionalText $condtxt -TableName $TableName -TableStyle $tableStyle -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/Databricks.ps1 b/Modules/Scripts/Analytics/Databricks.ps1 index 595c2d0..9fbb969 100644 --- a/Modules/Scripts/Analytics/Databricks.ps1 +++ b/Modules/Scripts/Analytics/Databricks.ps1 @@ -128,5 +128,4 @@ Else { Export-Excel -Path $File -WorksheetName 'Databricks' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style } - <######## Insert Column comments and documentations here following this model #########> } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/DocIntelligence.ps1 b/Modules/Scripts/Analytics/DocIntelligence.ps1 index 3e3281d..d278984 100644 --- a/Modules/Scripts/Analytics/DocIntelligence.ps1 +++ b/Modules/Scripts/Analytics/DocIntelligence.ps1 @@ -119,14 +119,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Doc Intelligence' -AutoSize -MaxAutoSizeRows 100 -ConditionalText $condtxt -TableName $TableName -TableStyle $tableStyle -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/EvtHub.ps1 b/Modules/Scripts/Analytics/EvtHub.ps1 index 6244558..559e038 100644 --- a/Modules/Scripts/Analytics/EvtHub.ps1 +++ b/Modules/Scripts/Analytics/EvtHub.ps1 @@ -125,15 +125,5 @@ Else $ExcelVar | ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Event Hubs' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style -NoNumberConversion $noNumberConversion - - <######## Insert Column comments and documentations here following this model #########> - - - $excel = Open-ExcelPackage -Path $File -KillExcel - - $null = $excel.'Event Hubs'.Cells["L1"].AddComment("The Auto-inflate feature of Event Hubs automatically scales up by increasing the number of throughput units, to meet usage needs. Increasing throughput units prevents throttling scenarios.", "Azure Resource Inventory") - $excel.'Event Hubs'.Cells["L1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-auto-inflate' - - Close-ExcelPackage $excel } } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/FaceAPI.ps1 b/Modules/Scripts/Analytics/FaceAPI.ps1 index 5a1cb14..d77a03b 100644 --- a/Modules/Scripts/Analytics/FaceAPI.ps1 +++ b/Modules/Scripts/Analytics/FaceAPI.ps1 @@ -119,14 +119,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Face API' -AutoSize -MaxAutoSizeRows 100 -ConditionalText $condtxt -TableName $TableName -TableStyle $tableStyle -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/HealthInsights.ps1 b/Modules/Scripts/Analytics/HealthInsights.ps1 index 8268dd4..f2539c1 100644 --- a/Modules/Scripts/Analytics/HealthInsights.ps1 +++ b/Modules/Scripts/Analytics/HealthInsights.ps1 @@ -123,14 +123,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Health Insights' -AutoSize -MaxAutoSizeRows 100 -ConditionalText $condtxt -TableName $TableName -TableStyle $tableStyle -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/ImmersiveReader.ps1 b/Modules/Scripts/Analytics/ImmersiveReader.ps1 index b2d1b96..2c25bb6 100644 --- a/Modules/Scripts/Analytics/ImmersiveReader.ps1 +++ b/Modules/Scripts/Analytics/ImmersiveReader.ps1 @@ -118,14 +118,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Immersive Reader' -AutoSize -MaxAutoSizeRows 100 -ConditionalText $condtxt -TableName $TableName -TableStyle $tableStyle -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/Language.ps1 b/Modules/Scripts/Analytics/Language.ps1 index 5b70888..2c1e8bd 100644 --- a/Modules/Scripts/Analytics/Language.ps1 +++ b/Modules/Scripts/Analytics/Language.ps1 @@ -121,14 +121,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Language' -AutoSize -MaxAutoSizeRows 100 -ConditionalText $condtxt -TableName $TableName -TableStyle $tableStyle -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/MachineLearning.ps1 b/Modules/Scripts/Analytics/MachineLearning.ps1 index 167da8f..d0a73f2 100644 --- a/Modules/Scripts/Analytics/MachineLearning.ps1 +++ b/Modules/Scripts/Analytics/MachineLearning.ps1 @@ -128,5 +128,4 @@ Else { Export-Excel -Path $File -WorksheetName 'Machine Learning' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style } - <######## Insert Column comments and documentations here following this model #########> } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/SearchServices.ps1 b/Modules/Scripts/Analytics/SearchServices.ps1 index e5a4d3e..09be7ee 100644 --- a/Modules/Scripts/Analytics/SearchServices.ps1 +++ b/Modules/Scripts/Analytics/SearchServices.ps1 @@ -122,14 +122,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Search Services' -AutoSize -MaxAutoSizeRows 100 -ConditionalText $condtxt -TableName $TableName -TableStyle $tableStyle -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/SpeechService.ps1 b/Modules/Scripts/Analytics/SpeechService.ps1 index b7466e6..61ec227 100644 --- a/Modules/Scripts/Analytics/SpeechService.ps1 +++ b/Modules/Scripts/Analytics/SpeechService.ps1 @@ -119,14 +119,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Speech Service' -AutoSize -MaxAutoSizeRows 100 -ConditionalText $condtxt -TableName $TableName -TableStyle $tableStyle -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/Streamanalytics.ps1 b/Modules/Scripts/Analytics/Streamanalytics.ps1 index 42e3085..5989197 100644 --- a/Modules/Scripts/Analytics/Streamanalytics.ps1 +++ b/Modules/Scripts/Analytics/Streamanalytics.ps1 @@ -149,5 +149,4 @@ Else { Export-Excel -Path $File -WorksheetName 'Stream Analytics Jobs' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style -NoNumberConversion $noNumberConversion } - <######## Insert Column comments and documentations here following this model #########> } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/Synapse.ps1 b/Modules/Scripts/Analytics/Synapse.ps1 index 8c687ec..723db3c 100644 --- a/Modules/Scripts/Analytics/Synapse.ps1 +++ b/Modules/Scripts/Analytics/Synapse.ps1 @@ -113,5 +113,4 @@ Else { Export-Excel -Path $File -WorksheetName 'Synapse' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -Style $Style } - <######## Insert Column comments and documentations here following this model #########> } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/Translator.ps1 b/Modules/Scripts/Analytics/Translator.ps1 index 0471c03..3eb9e35 100644 --- a/Modules/Scripts/Analytics/Translator.ps1 +++ b/Modules/Scripts/Analytics/Translator.ps1 @@ -119,14 +119,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Translator' -AutoSize -MaxAutoSizeRows 100 -ConditionalText $condtxt -TableName $TableName -TableStyle $tableStyle -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Analytics/WrkSpace.ps1 b/Modules/Scripts/Analytics/WrkSpace.ps1 index a29bed2..240b74f 100644 --- a/Modules/Scripts/Analytics/WrkSpace.ps1 +++ b/Modules/Scripts/Analytics/WrkSpace.ps1 @@ -118,14 +118,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Workspaces' -AutoSize -MaxAutoSizeRows 100 -ConditionalText $condtxt -TableName $TableName -TableStyle $tableStyle -Style $Style -NoNumberConversion $noNumberConversion - - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Compute/CloudServices.ps1 b/Modules/Scripts/Compute/CloudServices.ps1 index 033b24f..409e6b4 100644 --- a/Modules/Scripts/Compute/CloudServices.ps1 +++ b/Modules/Scripts/Compute/CloudServices.ps1 @@ -101,12 +101,5 @@ Else { ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'CloudServices' -AutoSize -TableName $TableName -MaxAutoSizeRows 100 -TableStyle $tableStyle -ConditionalText $condtxt -Numberformat '0' -Style $Style - $excel = Open-ExcelPackage -Path $File -KillExcel - - $null = $excel.'CloudServices'.Cells["F1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.") - $excel.'CloudServices'.Cells["F1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' - - Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Compute/VM.ps1 b/Modules/Scripts/Compute/VM.ps1 index d120540..eb0d881 100644 --- a/Modules/Scripts/Compute/VM.ps1 +++ b/Modules/Scripts/Compute/VM.ps1 @@ -367,22 +367,6 @@ else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Virtual Machines' -TableName $TableName -MaxAutoSizeRows 100 -TableStyle $tableStyle -ConditionalText $cond -Style $Style, $StyleExt -NoNumberConversion $noNumberConversion - $excel = Open-ExcelPackage -Path $File -KillExcel - - $null = $excel.'Virtual Machines'.Cells["N1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") - $excel.'Virtual Machines'.Cells["N1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' - $null = $excel.'Virtual Machines'.Cells["R1"].AddComment("Boot diagnostics is a debugging feature for Azure virtual machines (VM) that allows diagnosis of VM boot failures.", "Azure Resource Inventory") - $excel.'Virtual Machines'.Cells["R1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/virtual-machines/boot-diagnostics' - $null = $excel.'Virtual Machines'.Cells["S1"].AddComment("Is recommended to install Performance Diagnostics Agent in every Azure Virtual Machine upfront. The agent is only used when triggered by the console and may save time in an event of performance struggling.", "Azure Resource Inventory") - $excel.'Virtual Machines'.Cells["S1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/performance-diagnostics' - $null = $excel.'Virtual Machines'.Cells["T1"].AddComment("We recommend that you use Azure Monitor to gain visibility into your resource's health.", "Azure Resource Inventory") - $excel.'Virtual Machines'.Cells["T1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/security/fundamentals/iaas#monitor-vm-performance' - $null = $excel.'Virtual Machines'.Cells["AF1"].AddComment("Use a network security group to protect against unsolicited traffic into Azure subnets. Network security groups are simple, stateful packet inspection devices that use the 5-tuple approach (source IP, source port, destination IP, destination port, and layer 4 protocol) to create allow/deny rules for network traffic.", "Azure Resource Inventory") - $excel.'Virtual Machines'.Cells["AF1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/security/fundamentals/network-best-practices#logically-segment-subnets' - $null = $excel.'Virtual Machines'.Cells["AI1"].AddComment("Accelerated networking enables single root I/O virtualization (SR-IOV) to a VM, greatly improving its networking performance. This high-performance path bypasses the host from the datapath, reducing latency, jitter, and CPU utilization.", "Azure Resource Inventory") - $excel.'Virtual Machines'.Cells["AI1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/virtual-network/create-vm-accelerated-networking-cli' - - Close-ExcelPackage $excel } } \ No newline at end of file diff --git a/Modules/Scripts/Compute/VMWare.ps1 b/Modules/Scripts/Compute/VMWare.ps1 index 85fd3d9..50d348b 100644 --- a/Modules/Scripts/Compute/VMWare.ps1 +++ b/Modules/Scripts/Compute/VMWare.ps1 @@ -117,5 +117,4 @@ Else { Export-Excel -Path $File -WorksheetName 'VMWare' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -Style $Style } - <######## Insert Column comments and documentations here following this model #########> } \ No newline at end of file diff --git a/Modules/Scripts/Containers/AKS.ps1 b/Modules/Scripts/Containers/AKS.ps1 index c6fc153..47e5841 100644 --- a/Modules/Scripts/Containers/AKS.ps1 +++ b/Modules/Scripts/Containers/AKS.ps1 @@ -239,39 +239,5 @@ Else $ExcelVar | ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'AKS' -AutoSize -TableName $TableName -MaxAutoSizeRows 50 -TableStyle $tableStyle -ConditionalText $condtxt -Numberformat '0' -Style $Style,$StyleExt -NoNumberConversion $noNumberConversion - - $excel = Open-ExcelPackage -Path $File -KillExcel - - $null = $excel.'AKS'.Cells["E1"].AddComment("Microsoft recommends Free Pricing tier only for non-production workloads", "Azure Resource Inventory") - $excel.'AKS'.Cells["E1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/free-standard-pricing-tiers' - - $null = $excel.'AKS'.Cells["F1"].AddComment("AKS follows 12 months of support for a generally available (GA) Kubernetes version. To read more about our support policy for Kubernetes versioning", "Azure Resource Inventory") - $excel.'AKS'.Cells["F1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-kubernetes-release-calendar' - - $null = $excel.'AKS'.Cells["J1"].AddComment("Local accounts are enabled by default. Even when you enable RBAC or Microsoft Entra integration", "Azure Resource Inventory") - $excel.'AKS'.Cells["J1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/manage-local-accounts-managed-azure-ad' - - $null = $excel.'AKS'.Cells["T1"].AddComment("By default AKS Control Plane is exposed on a public endpoint accessible over the internet. Organizations who want to disable this public endpoint, can leverage the private cluster feature", "Azure Resource Inventory") - $excel.'AKS'.Cells["T1"].Hyperlink = 'https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/public-and-private-aks-clusters-demystified/ba-p/3716838' - - $null = $excel.'AKS'.Cells["W1"].AddComment("By enabling auto-upgrade, you can ensure your clusters are up to date and don't miss the latest features or patches from AKS and upstream Kubernetes.", "Azure Resource Inventory") - $excel.'AKS'.Cells["W1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/auto-upgrade-cluster?tabs=azure-cli#why-use-cluster-auto-upgrade' - - $null = $excel.'AKS'.Cells["X1"].AddComment("Node-level OS security updates are released at a faster rate than Kubernetes patch or minor version updates. The node OS auto-upgrade channel grants you flexibility and enables a customized strategy for node-level OS security updates.", "Azure Resource Inventory") - $excel.'AKS'.Cells["X1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/auto-upgrade-node-os-image?tabs=azure-cli#interactions-between-node-os-auto-upgrade-and-cluster-auto-upgrade' - - $null = $excel.'AKS'.Cells["Y1"].AddComment("Container insights collects metric data from your cluster in addition to logs. This functionality has been replaced by Azure Monitor managed service for Prometheus. You can analyze that data using built-in dashboards in Managed Grafana and alert on them using prebuilt Prometheus alert rules.", "Azure Resource Inventory") - $excel.'AKS'.Cells["Y1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/azure-monitor/containers/container-insights-overview' - - $null = $excel.'AKS'.Cells["AH1"].AddComment("System node pools require a VM SKU of at least 2 vCPUs and 4 GB memory. But burstable-VM(B series) isn't recommended", "Azure Resource Inventory") - $excel.'AKS'.Cells["AH1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/use-system-pools?tabs=azure-cli#system-and-user-node-pools' - - $null = $excel.'AKS'.Cells["AI1"].AddComment("An AKS cluster distributes resources, such as nodes and storage, across logical sections of underlying Azure infrastructure. Using availability zones physically separates nodes from other nodes deployed to different availability zones. AKS clusters deployed with multiple availability zones configured across a cluster provide a higher level of availability to protect against a hardware failure or a planned maintenance event.", "Azure Resource Inventory") - $excel.'AKS'.Cells["AI1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/availability-zones-overview' - - $null = $excel.'AKS'.Cells["AM1"].AddComment("The cluster autoscaler component can watch for pods in your cluster that can't be scheduled because of resource constraints", "Azure Resource Inventory") - $excel.'AKS'.Cells["AM1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/aks/cluster-autoscaler' - - Close-ExcelPackage $excel } } \ No newline at end of file diff --git a/Modules/Scripts/Data/CosmosDB.ps1 b/Modules/Scripts/Data/CosmosDB.ps1 index 4c8a076..be91d19 100644 --- a/Modules/Scripts/Data/CosmosDB.ps1 +++ b/Modules/Scripts/Data/CosmosDB.ps1 @@ -128,5 +128,4 @@ Else { Export-Excel -Path $File -WorksheetName 'Cosmos DB' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style } - <######## Insert Column comments and documentations here following this model #########> } \ No newline at end of file diff --git a/Modules/Scripts/Data/MariaDB.ps1 b/Modules/Scripts/Data/MariaDB.ps1 index 360f9be..12189ff 100644 --- a/Modules/Scripts/Data/MariaDB.ps1 +++ b/Modules/Scripts/Data/MariaDB.ps1 @@ -130,5 +130,4 @@ Else { Export-Excel -Path $File -WorksheetName 'MariaDB' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style } - <######## Insert Column comments and documentations here following this model #########> } diff --git a/Modules/Scripts/Data/MySQL.ps1 b/Modules/Scripts/Data/MySQL.ps1 index d138a81..ba6d1bd 100644 --- a/Modules/Scripts/Data/MySQL.ps1 +++ b/Modules/Scripts/Data/MySQL.ps1 @@ -136,13 +136,5 @@ Else { ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'MySQL' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style - $excel = Open-ExcelPackage -Path $File -KillExcel - - $null = $excel.'MySQL'.Cells["H1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") - $excel.'MySQL'.Cells["H1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' - - Close-ExcelPackage $excel - } - <######## Insert Column comments and documentations here following this model #########> } diff --git a/Modules/Scripts/Data/MySQLflexible.ps1 b/Modules/Scripts/Data/MySQLflexible.ps1 index ab82e09..f54d8f4 100644 --- a/Modules/Scripts/Data/MySQLflexible.ps1 +++ b/Modules/Scripts/Data/MySQLflexible.ps1 @@ -118,5 +118,4 @@ Else { Export-Excel -Path $File -WorksheetName 'MySQL Flexible' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -Style $Style } - <######## Insert Column comments and documentations here following this model #########> } \ No newline at end of file diff --git a/Modules/Scripts/Data/POSTGRE.ps1 b/Modules/Scripts/Data/POSTGRE.ps1 index 7023836..d515823 100644 --- a/Modules/Scripts/Data/POSTGRE.ps1 +++ b/Modules/Scripts/Data/POSTGRE.ps1 @@ -137,13 +137,5 @@ Else { ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'PostgreSQL' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style - $excel = Open-ExcelPackage -Path $File -KillExcel - - $null = $excel.'PostgreSQL'.Cells["J1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") - $excel.'PostgreSQL'.Cells["J1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' - - Close-ExcelPackage $excel - } - <######## Insert Column comments and documentations here following this model #########> } diff --git a/Modules/Scripts/Data/POSTGREFlexible.ps1 b/Modules/Scripts/Data/POSTGREFlexible.ps1 index efc6e0a..4121677 100644 --- a/Modules/Scripts/Data/POSTGREFlexible.ps1 +++ b/Modules/Scripts/Data/POSTGREFlexible.ps1 @@ -131,5 +131,4 @@ Else { Export-Excel -Path $File -WorksheetName 'PostgreSQL Flexible' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style } - <######## Insert Column comments and documentations here following this model #########> } diff --git a/Modules/Scripts/Data/Purview.ps1 b/Modules/Scripts/Data/Purview.ps1 index 1755e18..e549bc2 100644 --- a/Modules/Scripts/Data/Purview.ps1 +++ b/Modules/Scripts/Data/Purview.ps1 @@ -111,5 +111,4 @@ Else { Export-Excel -Path $File -WorksheetName 'Purview' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -Style $Style } - <######## Insert Column comments and documentations here following this model #########> } \ No newline at end of file diff --git a/Modules/Scripts/Data/RedisCache.ps1 b/Modules/Scripts/Data/RedisCache.ps1 index d0f0af7..f603ef5 100644 --- a/Modules/Scripts/Data/RedisCache.ps1 +++ b/Modules/Scripts/Data/RedisCache.ps1 @@ -143,13 +143,5 @@ Else { ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Redis Cache' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style - $excel = Open-ExcelPackage -Path $File -KillExcel - - $null = $excel.'Redis Cache'.Cells["F1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") - $excel.'Redis Cache'.Cells["F1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' - - Close-ExcelPackage $excel - } - <######## Insert Column comments and documentations here following this model #########> } diff --git a/Modules/Scripts/Data/SQLVM.ps1 b/Modules/Scripts/Data/SQLVM.ps1 index ecdace6..6b58a4a 100644 --- a/Modules/Scripts/Data/SQLVM.ps1 +++ b/Modules/Scripts/Data/SQLVM.ps1 @@ -94,5 +94,4 @@ Else { Export-Excel -Path $File -WorksheetName 'SQL VMs' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -Style $Style } - <######## Insert Column comments and documentations here following this model #########> } \ No newline at end of file diff --git a/Modules/Scripts/Infrastructure/AppGW.ps1 b/Modules/Scripts/Infrastructure/AppGW.ps1 index 7bd5d9e..6cdadfd 100644 --- a/Modules/Scripts/Infrastructure/AppGW.ps1 +++ b/Modules/Scripts/Infrastructure/AppGW.ps1 @@ -125,12 +125,5 @@ Else { ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'App Gateway' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style - $excel = Open-ExcelPackage -Path $File -KillExcel - - $null = $excel.'App Gateway'.Cells["K1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") - $excel.'App Gateway'.Cells["K1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' - - Close-ExcelPackage $excel - } } diff --git a/Modules/Scripts/Infrastructure/AutomationAcc.ps1 b/Modules/Scripts/Infrastructure/AutomationAcc.ps1 index daa5c79..2906eb7 100644 --- a/Modules/Scripts/Infrastructure/AutomationAcc.ps1 +++ b/Modules/Scripts/Infrastructure/AutomationAcc.ps1 @@ -141,13 +141,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Runbooks' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style, $StyleExt - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Infrastructure/AvSet.ps1 b/Modules/Scripts/Infrastructure/AvSet.ps1 index ac25fe2..4c44c26 100644 --- a/Modules/Scripts/Infrastructure/AvSet.ps1 +++ b/Modules/Scripts/Infrastructure/AvSet.ps1 @@ -100,13 +100,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Availability Sets' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Infrastructure/BASTION.ps1 b/Modules/Scripts/Infrastructure/BASTION.ps1 index 6b2d843..045f9a3 100644 --- a/Modules/Scripts/Infrastructure/BASTION.ps1 +++ b/Modules/Scripts/Infrastructure/BASTION.ps1 @@ -99,13 +99,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Bastion Hosts' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -Style $Style - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Infrastructure/Frontdoor.ps1 b/Modules/Scripts/Infrastructure/Frontdoor.ps1 index 055d4e4..af0a53f 100644 --- a/Modules/Scripts/Infrastructure/Frontdoor.ps1 +++ b/Modules/Scripts/Infrastructure/Frontdoor.ps1 @@ -101,6 +101,6 @@ Else { $ExcelVar | ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'FrontDoor' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style - + } } \ No newline at end of file diff --git a/Modules/Scripts/Infrastructure/RecoveryVault.ps1 b/Modules/Scripts/Infrastructure/RecoveryVault.ps1 index 4b0cc9f..14ea7ee 100644 --- a/Modules/Scripts/Infrastructure/RecoveryVault.ps1 +++ b/Modules/Scripts/Infrastructure/RecoveryVault.ps1 @@ -98,13 +98,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Recovery Vaults' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -ConditionalText $condtxt -TableStyle $tableStyle -Style $Style - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Infrastructure/Vault.ps1 b/Modules/Scripts/Infrastructure/Vault.ps1 index 3c86d8a..3da9cc4 100644 --- a/Modules/Scripts/Infrastructure/Vault.ps1 +++ b/Modules/Scripts/Infrastructure/Vault.ps1 @@ -134,9 +134,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Key Vaults' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style - <######## Insert Column comments and documentations here following this model #########> - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Integration/APIM.ps1 b/Modules/Scripts/Integration/APIM.ps1 index fcac5be..c60b00c 100644 --- a/Modules/Scripts/Integration/APIM.ps1 +++ b/Modules/Scripts/Integration/APIM.ps1 @@ -116,13 +116,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'APIM' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Integration/AppInsights.ps1 b/Modules/Scripts/Integration/AppInsights.ps1 index 86ed218..5640bb2 100644 --- a/Modules/Scripts/Integration/AppInsights.ps1 +++ b/Modules/Scripts/Integration/AppInsights.ps1 @@ -118,5 +118,4 @@ Else { Export-Excel -Path $File -WorksheetName 'AppInsights' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -Style $Style -ConditionalText $condtxt } - <######## Insert Column comments and documentations here following this model #########> } \ No newline at end of file diff --git a/Modules/Scripts/Integration/Backup.ps1 b/Modules/Scripts/Integration/Backup.ps1 index 0571ab2..a4ec8d4 100644 --- a/Modules/Scripts/Integration/Backup.ps1 +++ b/Modules/Scripts/Integration/Backup.ps1 @@ -166,13 +166,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Backup' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style - <######## Insert Column comments and documentations here following this model #########> - - - #$excel = Open-ExcelPackage -Path $File -KillExcel - - - #Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Integration/IOTHubs.ps1 b/Modules/Scripts/Integration/IOTHubs.ps1 index c5939a5..7957dfe 100644 --- a/Modules/Scripts/Integration/IOTHubs.ps1 +++ b/Modules/Scripts/Integration/IOTHubs.ps1 @@ -107,5 +107,4 @@ Else { Export-Excel -Path $File -WorksheetName 'IOTHubs' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -Style $Style } - <######## Insert Column comments and documentations here following this model #########> } \ No newline at end of file diff --git a/Modules/Scripts/Networking/AzureFirewall.ps1 b/Modules/Scripts/Networking/AzureFirewall.ps1 index 238846e..2bcfd17 100644 --- a/Modules/Scripts/Networking/AzureFirewall.ps1 +++ b/Modules/Scripts/Networking/AzureFirewall.ps1 @@ -13,9 +13,9 @@ https://github.com/microsoft/ARI/Modules/Networking/AzureFirewall.ps1 This powershell Module is part of Azure Resource Inventory (ARI) .NOTES -Version: 3.0.0 +Version: 3.5.0 First Release Date: 19th November, 2020 -Authors: Claudio Merola and Renato Gregio +Authors: Claudio Merola #> @@ -54,7 +54,9 @@ If ($Task -eq 'Processing') { } $Policy = $AzureFWPolicies | Where-Object {$_.id -eq $data.firewallpolicy.id} + $Policy = if(![string]::IsNullOrEmpty($Policy)){$Policy}else{'0'} $Rules = $AzureFWPoliciesRules | Where-Object {$_.id -eq $Policy.properties.rulecollectiongroups.id} + $Rules = if(![string]::IsNullOrEmpty($Rules)){$Rules}else{'0'} $FinalPIP = if ($PIPs.count -gt 1) { $PIPs | ForEach-Object { $_ + ' ,' } }else { $PIPs } $FinalPIP = [string]$FinalPIP $FinalPIP = if ($FinalPIP -like '* ,*') { $FinalPIP -replace ".$" }else { $FinalPIP } @@ -70,9 +72,13 @@ If ($Task -eq 'Processing') { foreach ($CoreRule in $Rules) { - foreach ($RuleCollection in $CoreRule.properties.rulecollections) + $CoreCollections = $CoreRule.properties.rulecollections + $CoreCollections = if(![string]::IsNullOrEmpty($CoreCollections)){$CoreCollections}else{'0'} + foreach ($RuleCollection in $CoreCollections) { - foreach ($Rule in $RuleCollection.rules) + $RuleCoreCollections = $RuleCollection.rules + $RuleCoreCollections = if(![string]::IsNullOrEmpty($RuleCoreCollections)){$RuleCoreCollections}else{'0'} + foreach ($Rule in $RuleCoreCollections) { $FinalProtocol = if ($Rule.ipprotocols.count -gt 1) { $Rule.ipprotocols | ForEach-Object { $_ + ' ,' } }else { $Rule.ipprotocols} $FinalProtocol = [string]$FinalProtocol @@ -210,5 +216,4 @@ Else { Export-Excel -Path $File -WorksheetName 'Azure Firewall' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style } - <######## Insert Column comments and documentations here following this model #########> } \ No newline at end of file diff --git a/Modules/Scripts/Networking/Connections.ps1 b/Modules/Scripts/Networking/Connections.ps1 index 58b0c0f..3523c1e 100644 --- a/Modules/Scripts/Networking/Connections.ps1 +++ b/Modules/Scripts/Networking/Connections.ps1 @@ -96,9 +96,5 @@ Else $ExcelVar | ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Connections' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - Close-ExcelPackage $excel } } \ No newline at end of file diff --git a/Modules/Scripts/Networking/ExpressRoute.ps1 b/Modules/Scripts/Networking/ExpressRoute.ps1 index 100140c..3bd1e4f 100644 --- a/Modules/Scripts/Networking/ExpressRoute.ps1 +++ b/Modules/Scripts/Networking/ExpressRoute.ps1 @@ -103,9 +103,5 @@ Else $ExcelVar | ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Express Route' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - Close-ExcelPackage $excel } } \ No newline at end of file diff --git a/Modules/Scripts/Networking/LoadBalancer.ps1 b/Modules/Scripts/Networking/LoadBalancer.ps1 index b0f3b9e..9e0877e 100644 --- a/Modules/Scripts/Networking/LoadBalancer.ps1 +++ b/Modules/Scripts/Networking/LoadBalancer.ps1 @@ -424,19 +424,6 @@ Else { $ExcelVar | ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Load Balancers' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - $excel = Open-ExcelPackage -Path $File -KillExcel - - $null = $excel.'Load Balancers'.Cells["E1"].AddComment("No SLA is provided for Basic Load Balancer!", "Azure Resource Inventory") - $excel.'Load Balancers'.Cells["E1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/load-balancer/skus' - - $null = $excel.'Load Balancers'.Cells["F1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") - $excel.'Load Balancers'.Cells["F1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' - - Close-ExcelPackage $excel - } } \ No newline at end of file diff --git a/Modules/Scripts/Networking/PrivateEndpoint.ps1 b/Modules/Scripts/Networking/PrivateEndpoint.ps1 index ac6602f..7b89fdf 100644 --- a/Modules/Scripts/Networking/PrivateEndpoint.ps1 +++ b/Modules/Scripts/Networking/PrivateEndpoint.ps1 @@ -121,6 +121,6 @@ Else { $ExcelVar | ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Private Endpoint' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -ConditionalText $condtxt -TableStyle $tableStyle -Style $Style - + } } \ No newline at end of file diff --git a/Modules/Scripts/Networking/PublicIP.ps1 b/Modules/Scripts/Networking/PublicIP.ps1 index b0965fe..f9453c2 100644 --- a/Modules/Scripts/Networking/PublicIP.ps1 +++ b/Modules/Scripts/Networking/PublicIP.ps1 @@ -142,12 +142,5 @@ Else { ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Public IPs' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -Style $Style -ConditionalText $condtxt -NoNumberConversion $noNumberConversion - $excel = Open-ExcelPackage -Path $File -KillExcel - - $null = $excel.'Public IPs'.Cells["G1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") - $excel.'Public IPs'.Cells["G1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' - - Close-ExcelPackage $excel - } } diff --git a/Modules/Scripts/Networking/ROUTETABLE.ps1 b/Modules/Scripts/Networking/ROUTETABLE.ps1 index 0a8ccf3..710405c 100644 --- a/Modules/Scripts/Networking/ROUTETABLE.ps1 +++ b/Modules/Scripts/Networking/ROUTETABLE.ps1 @@ -96,6 +96,6 @@ Else { $ExcelVar | ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Route Tables' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style - + } } \ No newline at end of file diff --git a/Modules/Scripts/Networking/TrafficManager.ps1 b/Modules/Scripts/Networking/TrafficManager.ps1 index 7209467..76ea3ac 100644 --- a/Modules/Scripts/Networking/TrafficManager.ps1 +++ b/Modules/Scripts/Networking/TrafficManager.ps1 @@ -97,5 +97,4 @@ Else { Export-Excel -Path $File -WorksheetName 'Traffic Manager' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style } - <######## Insert Column comments and documentations here following this model #########> } \ No newline at end of file diff --git a/Modules/Scripts/Networking/VNETGTW.ps1 b/Modules/Scripts/Networking/VNETGTW.ps1 index fadc859..e6d7982 100644 --- a/Modules/Scripts/Networking/VNETGTW.ps1 +++ b/Modules/Scripts/Networking/VNETGTW.ps1 @@ -101,6 +101,6 @@ Else { $ExcelVar | ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'VNET Gateways' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style - + } } \ No newline at end of file diff --git a/Modules/Scripts/Networking/VirtualNetwork.ps1 b/Modules/Scripts/Networking/VirtualNetwork.ps1 index d749ca3..0673f2e 100644 --- a/Modules/Scripts/Networking/VirtualNetwork.ps1 +++ b/Modules/Scripts/Networking/VirtualNetwork.ps1 @@ -174,14 +174,6 @@ Else { $ExcelVar | ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Virtual Networks' -AutoSize -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style -NoNumberConversion $noNumberConversion - - - $excel = Open-ExcelPackage -Path $File -KillExcel - - $null = $excel.VirtualNetwork.Cells["F1"].AddComment("Azure DDoS Protection Standard, combined with application design best practices, provides enhanced DDoS mitigation features to defend against DDoS attacks.", "Azure Resource Inventory") - $excel.VirtualNetwork.Cells["F1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/ddos-protection/ddos-protection-overview' - - Close-ExcelPackage $excel } } \ No newline at end of file diff --git a/Modules/Scripts/Networking/VirtualWAN.ps1 b/Modules/Scripts/Networking/VirtualWAN.ps1 index b36e68d..8ac73c8 100644 --- a/Modules/Scripts/Networking/VirtualWAN.ps1 +++ b/Modules/Scripts/Networking/VirtualWAN.ps1 @@ -151,6 +151,6 @@ Else { $ExcelVar | ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Virtual WAN' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -Style $Style - + } } \ No newline at end of file diff --git a/Modules/Scripts/Networking/vNETPeering.ps1 b/Modules/Scripts/Networking/vNETPeering.ps1 index 322b6e9..e4f47cd 100644 --- a/Modules/Scripts/Networking/vNETPeering.ps1 +++ b/Modules/Scripts/Networking/vNETPeering.ps1 @@ -108,6 +108,6 @@ Else { $ExcelVar | ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Peering' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style - + } } \ No newline at end of file diff --git a/Modules/Scripts/Storage/DataExplorerCluster.ps1 b/Modules/Scripts/Storage/DataExplorerCluster.ps1 index 174c1e1..4e3f796 100644 --- a/Modules/Scripts/Storage/DataExplorerCluster.ps1 +++ b/Modules/Scripts/Storage/DataExplorerCluster.ps1 @@ -128,5 +128,4 @@ Else { Export-Excel -Path $File -WorksheetName 'Data Explorer Clusters' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style } - <######## Insert Column comments and documentations here following this model #########> } \ No newline at end of file diff --git a/Modules/Scripts/Storage/NetApp.ps1 b/Modules/Scripts/Storage/NetApp.ps1 index 9258d1f..5435ca1 100644 --- a/Modules/Scripts/Storage/NetApp.ps1 +++ b/Modules/Scripts/Storage/NetApp.ps1 @@ -121,5 +121,4 @@ Else { Export-Excel -Path $File -WorksheetName 'NetApp' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -Style $Style } - <######## Insert Column comments and documentations here following this model #########> } \ No newline at end of file diff --git a/Modules/Scripts/Storage/StorageAcc.ps1 b/Modules/Scripts/Storage/StorageAcc.ps1 index 385f13d..b710089 100644 --- a/Modules/Scripts/Storage/StorageAcc.ps1 +++ b/Modules/Scripts/Storage/StorageAcc.ps1 @@ -228,21 +228,5 @@ Else { ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Storage Acc' -AutoSize -MaxAutoSizeRows 100 -TableName $TableName -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style - <######## Insert Column comments and documentations here following this model #########> - - - $excel = Open-ExcelPackage -Path $File -KillExcel - - $null = $excel.'Storage Acc'.Cells["K1"].AddComment("Is recommended that you configure your storage account to accept requests from secure connections only by setting the Secure transfer required property for the storage account.", "Azure Resource Inventory") - $excel.'Storage Acc'.Cells["K1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/storage/common/storage-require-secure-transfer' - $null = $excel.'Storage Acc'.Cells["L1"].AddComment("When a container is configured for anonymous access, any client can read data in that container. Anonymous access presents a potential security risk, so if your scenario does not require it, we recommend that you remediate anonymous access for the storage account.", "Azure Resource Inventory") - $excel.'Storage Acc'.Cells["L1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/storage/blobs/anonymous-read-access-configure?tabs=portal' - $null = $excel.'Storage Acc'.Cells["M1"].AddComment("By default, Azure Storage accounts permit clients to send and receive data with the oldest version of TLS, TLS 1.0, and above. To enforce stricter security measures, you can configure your storage account to require that clients send and receive data with a newer version of TLS", "Azure Resource Inventory") - $excel.'Storage Acc'.Cells["M1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/storage/common/transport-layer-security-configure-minimum-version?tabs=portal' - $null = $excel.'Storage Acc'.Cells["I1"].AddComment("It's important to be aware of upcoming Azure services and feature retirements to understand their impact on your workloads and plan migration.", "Azure Resource Inventory") - $excel.'Storage Acc'.Cells["I1"].Hyperlink = 'https://learn.microsoft.com/en-us/azure/advisor/advisor-how-to-plan-migration-workloads-service-retirement' - - Close-ExcelPackage $excel - } } diff --git a/Modules/Scripts/Storage/VMDisk.ps1 b/Modules/Scripts/Storage/VMDisk.ps1 index b4ec85f..8f57a22 100644 --- a/Modules/Scripts/Storage/VMDisk.ps1 +++ b/Modules/Scripts/Storage/VMDisk.ps1 @@ -117,15 +117,5 @@ Else ForEach-Object { [PSCustomObject]$_ } | Select-Object -Unique $Exc | Export-Excel -Path $File -WorksheetName 'Disks' -TableName $TableName -MaxAutoSizeRows 100 -TableStyle $tableStyle -ConditionalText $condtxt -Style $Style - - <######## Insert Column comments and documentations here following this model #########> - - $excel = Open-ExcelPackage -Path $File -KillExcel - - $null = $excel.Disks.Cells["D1"].AddComment("When you delete a virtual machine (VM) in Azure, by default, any disks that are attached to the VM aren't deleted. After a VM is deleted, you will continue to pay for unattached disks.", "Azure Resource Inventory") - $excel.Disks.Cells["D1"].Hyperlink = 'https://docs.microsoft.com/en-us/azure/virtual-machines/windows/find-unattached-disks' - - Close-ExcelPackage $excel - } } \ No newline at end of file