Hi Guys,
Need help with the Powershell command to output the results in a csv file.
The file gets created but the contents is blank or shows something which isn't the results.
Using Powershell ISE I can see the command is executing and giving the results but its not writing to the file. I'm sure its something simple that I am missing, just can't spot it.
$servers = "geekzone.co.nz","trademe.co.nz"
foreach ( $server in $servers )
{
Write-Host "Starting Ping for $server 'n" -ForegroundColor Yellow
test-Connection -ComputerName $server -Count 3
Write-Host "Completed `n" -ForegroundColor Yellow
}
$DesktopPath = [Environment]::GetFolderPath("Desktop") |
Export-Csv -Path "$DesktopPath\Ping.csv" -Append
Also tried to change from Export to Out-File but no dice (however the export and out-file should will give me the file so I think its something else I am missing.
Out-File -filepath "$DesktopPath\Ping.txt"