The code for Get NIC information.txt is: netsh interface ipv4 show interfaces get-wmiobject win32_networkadapter | select netconnectionid, name, InterfaceIndex, netconnectionstatus get-wmiobject win32_networkadapter -filter "netconnectionstatus = 2" | select netconnectionid, name, InterfaceIndex, netconnectionstatus