Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

Need Test connection output in the csv file

$
0
0

Hi,

I am completely newbie to Powershell.

Just I am trying to ping multiple VMs using the scripts. I created a file with list of VMs

-----------------------------------------------------------------------------------------------------------

$vms = Get-Content $file

foreach($vm in $vms)

{

if(Test-Connection -ComputerName $vm -Quiet)   

}

-------------------------------------------------------------

From here how can i get the output in the form of Excel sheet as below.

VMName  Ping Status

VM1            Ok or Failed

 


Viewing all articles
Browse latest Browse all 8583

Trending Articles