Powershell 执行外部命令


免责声明 本站所提供的部分内容,为作者提供、网友推荐、互联网整理而来,仅供学习参考,如有侵犯您的版权,请联系我们,本站将在三个工作日内删除。

通过netstat查看网络端口状态

PS C:\PS> netstat

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    192.168.0.100:3049    192.168.0.88:7575       ESTABLISHED
  TCP    192.168.0.100:3052    192.168.0.88:7575       ESTABLISHED
  TCP    192.168.0.100:3061    192.168.0.88:7575       ESTABLISHED

通过IPConfig查看自己的网络配置

PS C:\PS> ipconfig

Windows IP Configuration

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . : www.mossfly.com
   Link-local IPv6 Address . . . . . : fe80::b9dd:91e33:33f0:7885%10
   IPv4 Address. . . . . . . . . . . : 192.168.140.100
   Subnet Mask . . . . . . . . . . . : 255.255.252.0
   Default Gateway . . . . . . . . . : 192.168.140.1

Tunnel adapter isatap.www.mossfly.com:

   Connection-specific DNS Suffix  . : www.mossfly.com
   Link-local IPv6 Address . . . . . : fe80::5efe:192.168.140.100%11
   Default Gateway . . . . . . . . . :

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

route print查看路由信息

PS C:\PS> route print
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0     192.168.140.1   192.168.140.100     20
        192.0.0.0        255.0.0.0         On-link         192.0.0.1    306
        192.0.0.1  255.255.255.255         On-link         192.0.0.1    306
  192.255.255.255  255.255.255.255         On-link         192.0.0.1    306
     192.168.140.0    255.255.252.0         On-link    192.168.140.100    276
   192.168.140.100  255.255.255.255         On-link    192.168.140.100    276
   192.168.143.255  255.255.255.255         On-link    192.168.140.100    276
        224.0.0.0        240.0.0.0         On-link         192.0.0.1    306
        224.0.0.0        240.0.0.0         On-link    192.168.140.100    276
  255.255.255.255  255.255.255.255         On-link         192.0.0.1    306
  255.255.255.255  255.255.255.255         On-link    192.168.140.100    276
===========================================================================
Persistent Routes:
  None

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
  1    306 ::1/128                  On-link
 10    276 fe80::/64                On-link
 11    281 fe80::5efe:192.168.140.100/128
                                    On-link
 10    276 fe80::b965:91f3:33a0:7285/128
                                    On-link
  1    306 ff00::/8                 On-link
 10    276 ff00::/8                 On-link
===========================================================================
Persistent Routes:
  None