Hi,
I am trying to run the below cmdlet but the output is truncated and I am unable to expand it.
Get-AzAutomationJobOutput -Id $job.JobId -AutomationAccountName Myautomation -ResourceGroupName MyautomationRG -Stream "any" |
Get-AzAutomationJobOutputRecord | select summary -ExpandProperty summary
Eventually what I am trying to achieve is, to store the azure runbook job all outputs to a txt file in SPO using the below code but the output was truncated.
$job = Start-AzAutomationRunbook -ResourceGroupName "MyautomationRG" `
-AutomationAccountName "Myautomation" -Name "outputwithverbose"
$doLoop = $true
While ($doLoop) {
$job = Get-AzAutomationJob -ResourceGroupName "MyautomationRG" `
-AutomationAccountName "Myautomation" -Id $job.JobId
$status = $job.Status
$doLoop = (($status -ne "Completed") -and ($status -ne "Failed") -and ($status -ne "Suspended") -and ($status -ne "Stopped"))
}
Get-AzAutomationJobOutput -ResourceGroupName "MyautomationRG" `
-AutomationAccountName "Myautomation" -Id $job.JobId -Stream Output
# For more detailed job output, pipe the output of Get-AzAutomationJobOutput to Get-AzAutomationJobOutputRecord
$logoutput = Get-AzAutomationJobOutput -ResourceGroupName "MyautomationRG" `
-AutomationAccountName "Myautomation" -Id $job.JobId -Stream Any | Get-AzAutomationJobOutputRecord | Out-String
$logoutputarray = Get-AzAutomationJobOutput -ResourceGroupName "MyautomationRG" `
-AutomationAccountName "Myautomation" -Id $job.JobId -Stream Any | Get-AzAutomationJobOutputRecord
$stream = [IO.MemoryStream]::new([Text.Encoding]::UTF8.GetBytes($logoutput))
Add-pnpfile -Folder "Shared Documents" -FileName "logoutputs.txt" -Stream $stream
Screenshot from the local machine - powershell.
Complete output on runbook job details
I wonder how can I get the complete output in powershell. Thank you


