Feb 03 2022 07:55 AM
Hello,
I have the following code:
$dbs = Get-AzSqlDatabase -ResourceGroupName $SQLResourceGroup -ServerName $ServerName
$results = foreach ($db in $dbs.DatabaseName)
{
$dbAudit = Get-AzSqlDatabaseAudit -ResourceGroupName $SQLResourceGroup -ServerName $ServerName -DatabaseName $db
[PSCustomObject]@{
Database = $dbAudit.DatabaseName
Storage = $dbAudit.BlobStorageTargetState
}
}
$results | Format-Table -Property @{Expression={$_.DatabaseName};Label="Display Name";width=35}, `
@{Expression={$_.BlobStorageTargetState};Label="Login Name";width=40}
The script originally worked before I added the FT function. Now the display is blank as shown below:
Display Name Login Name
------------ ----------
If I remove the FT function it will display in key/value pairs. I'd like for it to be displayed in columnar format.
Any ideas?
Thanks,
Frank
Feb 06 2022 02:52 AM