I am using the following script to test the network connectivity after the new builds are completed.
Stop-Transcript ping.log
$ips = get-content (vm.txt)
ForEach ($ip in $ips) {
ping $ip }
Stop-Transcript
Transcript log (ping.log) doesnt contains the ping results details.
I assume that first line is a typo and should read Start-Transcript ?
Capturing output from external commands is a known "feature" in PS.
The bypass is to pipe these external commands to Write-Output
Something like this
Start-Transcript C:\ping.log $ips = get-content (vm.txt) foreach ($ip in $ips) { ping $ip | Write-Output } Stop-Transcript
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I assume that first line is a typo and should read Start-Transcript ?
Capturing output from external commands is a known "feature" in PS.
The bypass is to pipe these external commands to Write-Output
Something like this
Start-Transcript C:\ping.log $ips = get-content (vm.txt) foreach ($ip in $ips) { ping $ip | Write-Output } Stop-Transcript
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference