Quantcast
Channel: VMware Communities : Discussion List - Automation Tools
Viewing all articles
Browse latest Browse all 9071

route print info

$
0
0

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}}
}

Viewing all articles
Browse latest Browse all 9071

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>