Created
October 8, 2019 14:02
-
-
Save itpropro/5fbb2f24b0122f494d89a3b2be9342ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$storageTable = (Get-AzStorageTable -Context $storageContext -Name $storageTableName).CloudTable | |
$resources = Search-AzGraph -Query 'where type !in ("microsoft.compute/virtualmachines/extensions", "microsoft.compute/restorepointcollections", "microsoft.portal/dashboards")| project id, name, location, resourceGroup, properties.storageProfile, properties.hardwareProfile, type' -First 2000 | |
foreach ($res in $resources) { | |
$properties = $res.PSObject.Properties | |
$tableEntry = @{} | |
foreach ($prop in $properties) { | |
if ($prop.value) { | |
$tableEntry.add($prop.name, $prop.value) | |
} | |
} | |
$null = Add-AzTableRow -table $storageTable -partitionKey 'westeurope' -rowKey $res.id.replace('/','') -property $tableEntry -UpdateExisting | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment