PowerCLI

 View Only
  • 1.  VM can ping the default gateway

    Posted Sep 28, 2021 03:40 PM

    I have assigned a project to check that VM can ping the default gateway using PowerShell CLI. How do I ping the default gateway of VM?



  • 2.  RE: VM can ping the default gateway

    Posted Sep 28, 2021 03:50 PM

    I guess you need to do that from within the Guest OS of the VM.
    If the VM has VMware Tools installed you can use the Invoke-VMScript cmdlet.

    If you want to do that from a PowerShell script, you can use the Test-Connection cmdlet.



  • 3.  RE: VM can ping the default gateway

    Posted Mar 26, 2024 09:32 PM

    To run en masse against Linux (RHEL or similar, at least), something like 'ping -c 4 `route -n | grep UG | cut -d '' '' -f10`' as a ScriptText would work.