小编ren*_*egm的帖子

如何制作添加网络路由的脚本?

写景

所以Windows 7

我需要通过cisco vpn连接到远程主机.有时主机目标网络与本地网络相同.示例(ipconfig命令的部分输出):

Ethernet adapter Cisco Vpn Adapter:
   IPv4 Address. . . . . . . . . . . : 192.168.100.12
   Subnet Mask . . . . . . . . . . . : 255.255.255.0

Wireless LAN adapter Wireless Network Connection:
   IPv4 Address. . . . . . . . . . . : 192.168.1.74
   Subnet Mask . . . . . . . . . . . : 255.255.255.0

我需要通过Vpn连接到远程网络上的主机192.168.1.11然后我需要添加新路由(在此配置中,所有到192.168.1.xxx的流量都是到本地网络的路由)路由打印的输出开始于:

Interface List
 17...00 05 9a …

powershell vpn routes batch-file

5
推荐指数
2
解决办法
2万
查看次数

如何从包含“Keys”和“Values”文本的哈希表中检索所有键?

Hashtable在 PowerShell 中,您可以使用以下属性获取所有密钥Keys

$ht=@{
    "1"="10";
    "2"="20";
}
$ht.Keys
Run Code Online (Sandbox Code Playgroud)

这将返回:

2
1
Run Code Online (Sandbox Code Playgroud)

但是这个:

$ht=@{
    "Keys"="Keys text";
    "text1"="text1111"
}
$ht.Keys
Run Code Online (Sandbox Code Playgroud)

将返回Keys text(项目的值Keys

有没有办法强制.Keys返回Keys属性而不是Keys项目的值?

syntax powershell properties hashtable key

5
推荐指数
2
解决办法
2万
查看次数

标签 统计

powershell ×2

batch-file ×1

hashtable ×1

key ×1

properties ×1

routes ×1

syntax ×1

vpn ×1