Any possible way to get route print from the VM's .
I am trying using invoke method but can't write the output properly to csv.
foreach($vms in Get-ResourcePool test1 |Get-VM |? {$_.PowerState -eq 'Poweredon'}){ $command1 = @' $hst=hostname route print '@ $command2 = @' $hst1=hostname ipconfig /all '@ $output1=Invoke-VMScript -VM $vms -GuestUser 'administrator' -GuestPassword 'Adm1n1strat0r' -ScriptType Powershell -ScriptText $command1 | Select -ExpandProperty ScriptOutPut $output2=Invoke-VMScript -VM $vms -GuestUser 'administrator' -GuestPassword 'Adm1n1strat0r' -ScriptType Powershell -ScriptText $command2 | Select -ExpandProperty ScriptOutPut ""|select @{Name="VM Name";E={$vms.name}},@{Name="Route Print";E={$output1}},@{Name="ipconfig";E={$output2}} }