I'm having trouble finding out how to export data from a invoke-AZVMRUNcommand in parallel to a csv file. Usually this is simple to do but this time it got me the csv is not showing any data.. Can someone share a little knowledge of what to do.
$myAzureVMs | ForEach-Object -Parallel {
$out = Invoke-AzVMRunCommand `
-ResourceGroupName *********** `
-Name $_.Name `
-CommandId 'RunPowerShellScript' `
-ScriptPath C:\Users\user******\Downloads\ListCertificates\ListCertificates.ps1
#Formating the Output with the VM name
$output = $_.Name + " " + $out.Value[0].Message
$output} | Export-Csv -Path C:\CertList\CertEXPlist.csv

