Test Vpn With Powershell


The concern is documenting my attempts to automatically authenticate to hashicorp stack with the start of the terminal — but sometimes I am out of VPN. The need is to check for VPN fast

1. find the VPN adapter

  • go to network and sharing center

Control Panel\Network and Internet\Network Connections

  • rename the VPN adapter to vpn, see below

2. use the bracket notation to check for properties

  • connected to the VPN is up
  • disconnedted is disconnected, for example (the alias is already renamed adapter):
(Get-NetIPConfiguration -InterfaceAlias "vpn").NetAdapter.status

3. sources



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pavol Kutaj

Pavol Kutaj

Infrastructure Support Engineer/Technical Writer (Snowplow Analytics) with a passion for Python/writing documentation. More about me: https://pavol.kutaj.com