powershell - 从 powershell 在 HP 交换机上执行命令时出错
问题描述
在进行 SSH 会话(使用 POSH-SSH)后,我正在执行以下命令以针对 HP 交换机创建用户
$Session = New-SSHSession -ComputerName $sHost -Credential $cred
[string]$SystemView = $(Invoke-SSHCommand -SSHSession $Session -Command "system-view").Output
$SystemView
[string]$CreateUser = $(Invoke-SSHCommand -SSHSession $Session -Command "local-user nocadmin class manage").Output
$CreateUser
我得到的结果
<AAA6HPEDIS00>local-user nocadmin class manage ^ % Unrecognized command found at '^' position.
当我通过腻子时,它工作正常
当我检查第一个命令的“$Session”时它是True,但是当它来到第二个命令时,它变成了False
请让我知道是什么问题。
解决方案
推荐阅读
- tcp - 在使用 FIN 数据包发起终止之后从 TCP 连接接收数据包有多常见?
- reactjs - 如何在 reactjs 的一个组件表中打开模态编辑和 addClient
- php - 如果传递参数,Curl PHP 不会获取数据
- java - 找到4个元素的第i个数字的最小值
- jquery - jQuery中是否有任何等效的函数 myfunction(x, y) ?
- java - Java + Spring Boot + REST 安全问题
- python-3.x - Anaconda 安装在 Chromebook 中不起作用
- angular - 有没有办法从不同的目录获取组件?
- java - 尝试在空对象引用上调用虚拟方法“java.lang.String com.google.android.gms.auth.api.signin.GoogleSignInAccount.getIdToken()”
- java - 获取传入类的属性到参数Java中