Hello. Need some help, I'm trying to get a report with specific details from the Get-AzRecoveryServicesBackupJobDetail command.
So I'm saving the result in an array to later export to a CSV like this:
$JobCompletedDetails = Get-AzRecoveryServicesBackupJobDetail -Job $JobsCompleted[$i] -VaultId $vault.ID
$jobsArray += $JobCompletedDetails
After I complete building the array when I try to export to a CSV, I want to pass the backup size, which is included in the properties (placing myself in position 0 of the array)
PS C:\Users\userName> $jobsArray[0].Properties
Key Value
VM Name Vmname
Backup Size 1127 MB
If I try to export it like this it doesn't get any values.
$jobsArray | Select-Object WorkloadName, Status, JobId, StartTime, EndTime, Duration, Properties.Values | Export-Csv -NoTypeInformation -Path $file
How can I get the value of the size only like this to get passed as a column in my CSV?:
PS C:\Users\UserName> $jobsArray[0].Properties.Values
Vmname
1127 MB (This is the only value I want)
Thanks for the help.