Skip to content

Commit

Permalink
Merge pull request #220 from kaiaschulz/master
Browse files Browse the repository at this point in the history
v6.3.5
  • Loading branch information
JulianHayward authored Dec 17, 2023
2 parents 8def035 + 9b15886 commit 65457a4
Show file tree
Hide file tree
Showing 6 changed files with 33,187 additions and 83 deletions.
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,10 @@ The [Azure Governance Visualizer Accelerator](https://github.com/Azure/Azure-Gov

## Release history

__Changes__ (2023-Nov-13 / 6.3.4 Minor)

* introduce new parameter `-ARMLocation`. Define the Azure Resource Manager (ARM) location to use (default is to use westeurope; this is used to optimize the built-in Azure RBAC Role definitions tracking)
* hardening the automated AzAPICall PowerShell module installation by adding retry mechanism in case of failure (Azure DevOps/GitHub)
* tolerating more up to date AzAPICall version when executing outside of Azure DevOps/GitHub
* update ARM API-version for Resources. Using `2023-07-01` instead of `2021-04-01`
* update `/.azuredevops/pipelines/AzGovViz.variables.yml`
* add parameter `-ARMLocation`
* update README.md
* update [API reference](#api-reference)
* use [AzAPICall](https://aka.ms/AzAPICall) PowerShell module version 1.1.84
__Changes__ (2023-Dec-15 / 6.3.5 Minor)

* Checking if the response of the storage account properties request is a byte array (type 'byte[]') and decode it to a string
* Different handling of BOM (Byte order mark) for XML returns on storage account properties request (since Powershell version 7.4.0)

[Full release history](history.md)

Expand Down
5 changes: 5 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

### Azure Governance Visualizer version 6

__Changes__ (2023-Dec-15 / 6.3.5 Minor)

* Checking if the response of the storage account properties request is a byte array (type 'byte[]') and decode it to a string
* Different handling of BOM (Byte order mark) for XML returns on storage account properties request (since Powershell version 7.4.0)

__Changes__ (2023-Nov-13 / 6.3.4 Minor)

* introduce new parameter `-ARMLocation`. Define the Azure Resource Manager (ARM) location to use (default is to use westeurope; this is used to optimize the built-in Azure RBAC Role definitions tracking)
Expand Down
24 changes: 20 additions & 4 deletions pwsh/AzGovVizParallel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,14 @@ Param
$Product = 'AzGovViz',

[string]
$ProductVersion = '6.3.4',
$ProductVersion = '6.3.5',

[string]
$GithubRepository = 'aka.ms/AzGovViz',

# <--- AzAPICall related parameters #consult the AzAPICall GitHub repository for details aka.ms/AzAPICall
[string]
$AzAPICallVersion = '1.1.84',
$AzAPICallVersion = '1.1.85',

[switch]
$DebugAzAPICall,
Expand Down Expand Up @@ -12461,7 +12461,15 @@ function processStorageAccountAnalysis {
}
else {
try {
$xmlSaProperties = [xml]([string]$saProperties -replace $saProperties.Substring(0, 3))
# ? https://github.com/JulianHayward/Azure-MG-Sub-Governance-Reporting/issues/218#issuecomment-1854516882
if ($saProperties.gettype().Name -eq 'Byte[]') {
$byteArray = [byte[]]$saProperties
$saProperties = [System.Text.Encoding]::UTF8.GetString($byteArray)
}

# $xmlSaProperties = [xml]([string]$saProperties -replace $saProperties.Substring(0, 3)) # Leading character:  (PS version <= 7.3.9)
# $xmlSaProperties = [xml]([string]$saProperties -replace $saProperties.Substring(0, 1)) # Leading character:  or U+feff (PS version >= 7.4.0)
$xmlSaProperties = [xml]($saProperties -replace '^.*?<', '<') # Universal fix for all PS versions
if ($xmlSaProperties.StorageServiceProperties.StaticWebsite) {
if ($xmlSaProperties.StorageServiceProperties.StaticWebsite.Enabled -eq $true) {
$staticWebsitesState = $true
Expand Down Expand Up @@ -12494,7 +12502,15 @@ function processStorageAccountAnalysis {
}

if ($listContainersSuccess -eq $true) {
$xmlListContainers = [xml]([string]$listContainers -replace $listContainers.Substring(0, 3))
# ? https://github.com/JulianHayward/Azure-MG-Sub-Governance-Reporting/issues/218#issuecomment-1854516882
if ($listContainers.gettype().Name -eq 'Byte[]') {
$byteArray = [byte[]]$listContainers
$listContainers = [System.Text.Encoding]::UTF8.GetString($byteArray)
}

# $xmlListContainers = [xml]([string]$listContainers -replace $listContainers.Substring(0, 3)) # Leading character:  (PS version <= 7.3.9)
# $xmlListContainers = [xml]([string]$listContainers -replace $listContainers.Substring(0, 1)) # Leading character:  or U+feff (PS version >= 7.4.0)
$xmlListContainers = [xml]($listContainers -replace '^.*?<', '<') # Universal fix for all PS versions
$containersCount = $xmlListContainers.EnumerationResults.Containers.Container.Count

foreach ($container in $xmlListContainers.EnumerationResults.Containers.Container) {
Expand Down
Loading

0 comments on commit 65457a4

Please sign in to comment.