VMware Cloud Community
jingleharish
Contributor
Contributor
Jump to solution

Transcript problem.

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.

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
jingleharish
Contributor
Contributor
Jump to solution

Thanks Luc.

Reply
0 Kudos