I’m attempting to pull some information using the Az module and display it in a dashboard using a table. I keep getting a “Cannot bind argument to paramenter ‘Data’ because it is null” error. When I run the same script on PowerShell I get the correct data. This is the code I’m using. Do I need to find out a way to connect to the AZAccount?
New-UDRow -Columns {
New-UDColumn -LargeSize 6 -Content {
New-UDRow -Columns {
$AzureInvoicesTableData = try {
Get-AzBillingInvoice | Select Name, Status, `
@{Name = "DueDate"; Expression = {Get-Date ($_.DueDate) -Format 'MM/dd/yyyy'}}, `
@{Name = "BilledAmount"; Expression={ $_.BilledAmount.Value}}, `
InvoiceDate, InvoicePeriodStartDate, InvoicePeriodEndDate
}
catch {}
$Columns = @(
New-UDTableColumn -Property Name -Title Name -ShowSort -IncludeInExport -IncludeInSearch -ShowFilter -FilterType text
New-UDTableColumn -Property Status -Title Status -ShowSort -DefaultSortColumn -IncludeInExport -IncludeInSearch -ShowFilter -FilterType select
New-UDTableColumn -Property DueDate -Title "Due Date" -IncludeInExport -ShowFilter -FilterType select
New-UDTableColumn -Property BilledAmount -Title Amount -IncludeInExport -ShowFilter -FilterType select
)
New-UDTable -Id 'Invoices' -Data $AzureInvoicesTableData -Columns $Columns -Title 'Invoices' -ShowSearch -ShowPagination -Dense
}
}
}
Product: PowerShell Universal
Version: 1.5.16