我运行了 Get-Help,它询问我是否要运行 Update-Help,我照做了。
如何从 powershell CLI 中获得有关使用 Posh-SSH 的帮助?
PS C:\>
PS C:\> Get-Command -Name *ssh*
CommandType Name Version Source
----------- ---- ------- ------
Function Get-PoshSSHModVersion 2.2 Posh-SSH
Function Get-SSHPortForward 2.2 Posh-SSH
Function Get-SSHSession 2.2 Posh-SSH
Function Get-SSHTrustedHost 2.2 Posh-SSH
Function Get-TwitterDirectMessages_EventsShow 0.0.7 PSTwitterAPI
Function Get-TwitterDirectMessages_WelcomeMessagesRulesShow 0.0.7 PSTwitterAPI
Function Get-TwitterDirectMessages_WelcomeMessagesShow 0.0.7 PSTwitterAPI
Function Get-TwitterLists_MembersShow 0.0.7 PSTwitterAPI
Function Get-TwitterLists_SubscribersShow 0.0.7 PSTwitterAPI
Function Invoke-SSHCommand 2.2 Posh-SSH
Function Invoke-SSHCommandStream 2.2 Posh-SSH
Function Invoke-SSHStreamExpectAction 2.2 Posh-SSH
Function Invoke-SSHStreamExpectSecureAction 2.2 Posh-SSH
Function Invoke-SSHStreamShellCommand 2.2 Posh-SSH
Function New-SSHDynamicPortForward 2.2 Posh-SSH
Function New-SSHLocalPortForward 2.2 Posh-SSH
Function New-SSHRemotePortForward 2.2 Posh-SSH
Function New-SSHShellStream 2.2 Posh-SSH
Function New-SSHTrustedHost 2.2 Posh-SSH
Function Remove-SSHSession 2.2 Posh-SSH
Function Remove-SSHTrustedHost 2.2 Posh-SSH
Function Start-SSHPortForward 2.2 Posh-SSH
Function Stop-SSHPortForward 2.2 Posh-SSH
Cmdlet New-SSHSession 2.2 Posh-SSH
Application start-ssh-agent.cmd 0.0.0.0 C:\Program Files\Git\cmd\start-ssh-agent.cmd
Application start-ssh-pageant.cmd 0.0.0.0 C:\Program Files\Git\cmd\start-ssh-pageant.cmd
PS C:\>
PS C:\> posh-ssh New-SSHSession -ComputerName bandit.labs.overthewire.org 2220
posh-ssh : The term 'posh-ssh' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:1
+ posh-ssh New-SSHSession -ComputerName bandit.labs.overthewire.org 222 ...
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (posh-ssh:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\>
PS C:\>
也许我只是用错了语法。
或者,可能没有正确安装。从另一个控制台:
`PS C:\Users\thufir> PS C:\Users\thufir> 帮助 New-SSHSession
名称 新 SSH 会话
句法
别名 无
备注 无
PS C:\Users\thufir>
`
更新帮助似乎挂在具有管理员权限的新控制台中:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\WINDOWS\system32> Update-Help -Force -Verbose -ErrorAction SilentlyContinue
也可以看看: