Posh-SSH
Posh-SSH copied to clipboard
A bunch of typos exists on cmdlet names and parameters
Know
instead of Known
Get-SSHJsonKnowHost
Get-SSHTrustedHost -KnowHostStore
New-SSHTrustedHost -KnowHostStore
Remove-SSHTrustedHost -KnowHostStore
I think this should be corrected with aliases not to break anything
but there also bunch of Address issues in *Forward cmdlets BoundHost vs Local/Remote Address
Tested the PR an the aliases don’t work, try exporting both and still got errors about finding the cmdlet. Tried exporting both and still I got that the target function of the alias is not recognized or found.
It is very strange.
I compiled and tested the module via import-module -path <fullpath>
and saw both options even without
New-Alias
in Posh-SSH.psm1
PS C:\> Get-SSHJson<Ctrl+Space>
Get-SSHJsonKnowHost _Get-SSHJsonKnownHost_
Get-SSHJsonKnownHost [[-LocalFile] <string>] [<CommonParameters>]
First selection without help
now I compile module and put it into 3.0.8 folder in PSModulePath - also looks ok
btw PoshSSH.dll
it is enough to be in the module directory, in Assembly/ it is not required. May be you change dll only in Assembly/ folder ?
Weird I'm getting this
PS C:\Users\Carlos Perez\Documents\GitHub\Posh-SSH\Posh-SSH> Import-Module .\Posh-SSH.psd1 -verbose
VERBOSE: Loading module from path 'C:\Users\Carlos Perez\Documents\GitHub\Posh-SSH\Posh-SSH\Posh-SSH.psd1'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Carlos
Perez\Documents\GitHub\Posh-SSH\Posh-SSH\Assembly\Newtonsoft.Json.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Carlos
Perez\Documents\GitHub\Posh-SSH\Posh-SSH\Assembly\Newtonsoft.Json.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Carlos
Perez\Documents\GitHub\Posh-SSH\Posh-SSH\Assembly\Renci.SshNet.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Carlos
Perez\Documents\GitHub\Posh-SSH\Posh-SSH\Assembly\Renci.SshNet.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Carlos
Perez\Documents\GitHub\Posh-SSH\Posh-SSH\Assembly\SshNet.Security.Cryptography.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Carlos
Perez\Documents\GitHub\Posh-SSH\Posh-SSH\Assembly\SshNet.Security.Cryptography.dll'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\Users\Carlos
Perez\Documents\GitHub\Posh-SSH\Posh-SSH\Format\SSHSession.Format.ps1xml'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\Users\Carlos
Perez\Documents\GitHub\Posh-SSH\Posh-SSH\Format\SFTPSession.Format.ps1xml'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\Users\Carlos
Perez\Documents\GitHub\Posh-SSH\Posh-SSH\Format\Renci.SshNet.SshCommand.Format.ps1xml'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\Users\Carlos
Perez\Documents\GitHub\Posh-SSH\Posh-SSH\Format\Renci.SshNet.Sftp.SftpFile.Format.ps1xml'.
VERBOSE: Loading module from path 'C:\Users\Carlos Perez\Documents\GitHub\Posh-SSH\Posh-SSH\PoshSSH.dll'.
VERBOSE: Importing cmdlet 'Get-SSHHostKey'.
VERBOSE: Importing cmdlet 'Get-SCPItem'.
VERBOSE: Importing cmdlet 'Get-SFTPItem'.
VERBOSE: Importing cmdlet 'New-SFTPSession'.
VERBOSE: Importing cmdlet 'New-SSHSession'.
VERBOSE: Importing cmdlet 'Set-SCPItem'.
VERBOSE: Importing cmdlet 'Set-SFTPItem'.
VERBOSE: Importing cmdlet 'New-SSHMemoryKnownHost'.
VERBOSE: Importing cmdlet 'Get-SSHJsonKnowHost'.
VERBOSE: Importing cmdlet 'Get-SSHOpenSSHKnownHost'.
VERBOSE: Loading module from path 'C:\Users\Carlos Perez\Documents\GitHub\Posh-SSH\Posh-SSH\Posh-SSH.psm1'.
VERBOSE: Exporting function 'Get-SSHSession'.
VERBOSE: Exporting function 'Remove-SSHSession'.
VERBOSE: Exporting function 'Invoke-SSHCommand'.
VERBOSE: Exporting function 'Get-PoshSSHModVersion'.
VERBOSE: Exporting function 'Invoke-SSHCommandStream'.
VERBOSE: Exporting function 'New-SSHShellStream'.
VERBOSE: Exporting function 'Invoke-SSHStreamExpectAction'.
VERBOSE: Exporting function 'Invoke-SSHStreamExpectSecureAction'.
VERBOSE: Exporting function 'Invoke-SSHStreamShellCommand'.
VERBOSE: Exporting function 'Get-SFTPSession'.
VERBOSE: Exporting function 'Remove-SFTPSession'.
VERBOSE: Exporting function 'Get-SFTPChildItem'.
VERBOSE: Exporting function 'Test-SFTPPath'.
VERBOSE: Exporting function 'Remove-SFTPItem'.
VERBOSE: Exporting function 'Move-SFTPItem'.
VERBOSE: Exporting function 'Set-SFTPLocation'.
VERBOSE: Exporting function 'Get-SFTPLocation'.
VERBOSE: Exporting function 'Rename-SFTPFile'.
VERBOSE: Exporting function 'Get-SFTPPathAttribute'.
VERBOSE: Exporting function 'Set-SFTPPathAttribute'.
VERBOSE: Exporting function 'New-SFTPSymlink'.
VERBOSE: Exporting function 'Get-SFTPContent'.
VERBOSE: Exporting function 'Set-SFTPContent'.
VERBOSE: Exporting function 'New-SFTPFileStream'.
VERBOSE: Exporting function 'New-SFTPItem'.
VERBOSE: Exporting function 'New-SSHLocalPortForward'.
VERBOSE: Exporting function 'New-SSHRemotePortForward'.
VERBOSE: Exporting function 'New-SSHDynamicPortForward'.
VERBOSE: Exporting function 'Get-SSHPortForward'.
VERBOSE: Exporting function 'Stop-SSHPortForward'.
VERBOSE: Exporting function 'Start-SSHPortForward'.
VERBOSE: Exporting function 'Get-SSHTrustedHost'.
VERBOSE: Exporting function 'New-SSHTrustedHost'.
VERBOSE: Exporting function 'Remove-SSHTrustedHost'.
VERBOSE: Exporting function 'Get-SSHRegistryKnownHost'.
VERBOSE: Exporting function 'Convert-SSHRegistryToJSonKnownHost'.
VERBOSE: Exporting alias 'Get-SSHJsonKnowHost'.
VERBOSE: Importing function 'Convert-SSHRegistryToJSonKnownHost'.
VERBOSE: Importing function 'Get-PoshSSHModVersion'.
VERBOSE: Importing function 'Get-SFTPChildItem'.
VERBOSE: Importing function 'Get-SFTPContent'.
VERBOSE: Importing function 'Get-SFTPLocation'.
VERBOSE: Importing function 'Get-SFTPPathAttribute'.
VERBOSE: Importing function 'Get-SFTPSession'.
VERBOSE: Importing function 'Get-SSHPortForward'.
VERBOSE: Importing function 'Get-SSHRegistryKnownHost'.
VERBOSE: Importing function 'Get-SSHSession'.
VERBOSE: Importing function 'Get-SSHTrustedHost'.
VERBOSE: Importing function 'Invoke-SSHCommand'.
VERBOSE: Importing function 'Invoke-SSHCommandStream'.
VERBOSE: Importing function 'Invoke-SSHStreamExpectAction'.
VERBOSE: Importing function 'Invoke-SSHStreamExpectSecureAction'.
VERBOSE: Importing function 'Invoke-SSHStreamShellCommand'.
VERBOSE: Importing function 'Move-SFTPItem'.
VERBOSE: Importing function 'New-SFTPFileStream'.
VERBOSE: Importing function 'New-SFTPItem'.
VERBOSE: Importing function 'New-SFTPSymlink'.
VERBOSE: Importing function 'New-SSHDynamicPortForward'.
VERBOSE: Importing function 'New-SSHLocalPortForward'.
VERBOSE: Importing function 'New-SSHRemotePortForward'.
VERBOSE: Importing function 'New-SSHShellStream'.
VERBOSE: Importing function 'New-SSHTrustedHost'.
VERBOSE: Importing function 'Remove-SFTPItem'.
VERBOSE: Importing function 'Remove-SFTPSession'.
VERBOSE: Importing function 'Remove-SSHSession'.
VERBOSE: Importing function 'Remove-SSHTrustedHost'.
VERBOSE: Importing function 'Rename-SFTPFile'.
VERBOSE: Importing function 'Set-SFTPContent'.
VERBOSE: Importing function 'Set-SFTPLocation'.
VERBOSE: Importing function 'Set-SFTPPathAttribute'.
VERBOSE: Importing function 'Start-SSHPortForward'.
VERBOSE: Importing function 'Stop-SSHPortForward'.
VERBOSE: Importing function 'Test-SFTPPath'.
VERBOSE: Importing alias 'Get-SSHJsonKnowHost'.
VERBOSE: Exporting function 'Convert-SSHRegistryToJSonKnownHost'.
VERBOSE: Exporting function 'Get-PoshSSHModVersion'.
VERBOSE: Exporting function 'Get-SFTPChildItem'.
VERBOSE: Exporting function 'Get-SFTPContent'.
VERBOSE: Exporting function 'Get-SFTPLocation'.
VERBOSE: Exporting function 'Get-SFTPPathAttribute'.
VERBOSE: Exporting function 'Get-SFTPSession'.
VERBOSE: Exporting function 'Get-SSHPortForward'.
VERBOSE: Exporting function 'Get-SSHRegistryKnownHost'.
VERBOSE: Exporting function 'Get-SSHSession'.
VERBOSE: Exporting function 'Get-SSHTrustedHost'.
VERBOSE: Exporting function 'Invoke-SSHCommand'.
VERBOSE: Exporting function 'Invoke-SSHCommandStream'.
VERBOSE: Exporting function 'Invoke-SSHStreamExpectAction'.
VERBOSE: Exporting function 'Invoke-SSHStreamExpectSecureAction'.
VERBOSE: Exporting function 'Invoke-SSHStreamShellCommand'.
VERBOSE: Exporting function 'Move-SFTPItem'.
VERBOSE: Exporting function 'New-SFTPFileStream'.
VERBOSE: Exporting function 'New-SFTPItem'.
VERBOSE: Exporting function 'New-SFTPSymlink'.
VERBOSE: Exporting function 'New-SSHDynamicPortForward'.
VERBOSE: Exporting function 'New-SSHLocalPortForward'.
VERBOSE: Exporting function 'New-SSHRemotePortForward'.
VERBOSE: Exporting function 'New-SSHShellStream'.
VERBOSE: Exporting function 'New-SSHTrustedHost'.
VERBOSE: Exporting function 'Remove-SFTPItem'.
VERBOSE: Exporting function 'Remove-SFTPSession'.
VERBOSE: Exporting function 'Remove-SSHSession'.
VERBOSE: Exporting function 'Remove-SSHTrustedHost'.
VERBOSE: Exporting function 'Rename-SFTPFile'.
VERBOSE: Exporting function 'Set-SFTPContent'.
VERBOSE: Exporting function 'Set-SFTPLocation'.
VERBOSE: Exporting function 'Set-SFTPPathAttribute'.
VERBOSE: Exporting function 'Start-SSHPortForward'.
VERBOSE: Exporting function 'Stop-SSHPortForward'.
VERBOSE: Exporting function 'Test-SFTPPath'.
VERBOSE: Exporting cmdlet 'Get-SSHHostKey'.
VERBOSE: Exporting cmdlet 'Get-SCPItem'.
VERBOSE: Exporting cmdlet 'Get-SFTPItem'.
VERBOSE: Exporting cmdlet 'New-SFTPSession'.
VERBOSE: Exporting cmdlet 'New-SSHSession'.
VERBOSE: Exporting cmdlet 'Set-SCPItem'.
VERBOSE: Exporting cmdlet 'Set-SFTPItem'.
VERBOSE: Exporting cmdlet 'New-SSHMemoryKnownHost'.
VERBOSE: Exporting cmdlet 'Get-SSHOpenSSHKnownHost'.
VERBOSE: Exporting alias 'Get-SSHJsonKnowHost'.
VERBOSE: Importing cmdlet 'Get-SCPItem'.
VERBOSE: Importing cmdlet 'Get-SFTPItem'.
VERBOSE: Importing cmdlet 'Get-SSHHostKey'.
VERBOSE: Importing cmdlet 'Get-SSHOpenSSHKnownHost'.
VERBOSE: Importing cmdlet 'New-SFTPSession'.
VERBOSE: Importing cmdlet 'New-SSHMemoryKnownHost'.
VERBOSE: Importing cmdlet 'New-SSHSession'.
VERBOSE: Importing cmdlet 'Set-SCPItem'.
VERBOSE: Importing cmdlet 'Set-SFTPItem'.
VERBOSE: Importing function 'Convert-SSHRegistryToJSonKnownHost'.
VERBOSE: Importing function 'Get-PoshSSHModVersion'.
VERBOSE: Importing function 'Get-SFTPChildItem'.
VERBOSE: Importing function 'Get-SFTPContent'.
VERBOSE: Importing function 'Get-SFTPLocation'.
VERBOSE: Importing function 'Get-SFTPPathAttribute'.
VERBOSE: Importing function 'Get-SFTPSession'.
VERBOSE: Importing function 'Get-SSHPortForward'.
VERBOSE: Importing function 'Get-SSHRegistryKnownHost'.
VERBOSE: Importing function 'Get-SSHSession'.
VERBOSE: Importing function 'Get-SSHTrustedHost'.
VERBOSE: Importing function 'Invoke-SSHCommand'.
VERBOSE: Importing function 'Invoke-SSHCommandStream'.
VERBOSE: Importing function 'Invoke-SSHStreamExpectAction'.
VERBOSE: Importing function 'Invoke-SSHStreamExpectSecureAction'.
VERBOSE: Importing function 'Invoke-SSHStreamShellCommand'.
VERBOSE: Importing function 'Move-SFTPItem'.
VERBOSE: Importing function 'New-SFTPFileStream'.
VERBOSE: Importing function 'New-SFTPItem'.
VERBOSE: Importing function 'New-SFTPSymlink'.
VERBOSE: Importing function 'New-SSHDynamicPortForward'.
VERBOSE: Importing function 'New-SSHLocalPortForward'.
VERBOSE: Importing function 'New-SSHRemotePortForward'.
VERBOSE: Importing function 'New-SSHShellStream'.
VERBOSE: Importing function 'New-SSHTrustedHost'.
VERBOSE: Importing function 'Remove-SFTPItem'.
VERBOSE: Importing function 'Remove-SFTPSession'.
VERBOSE: Importing function 'Remove-SSHSession'.
VERBOSE: Importing function 'Remove-SSHTrustedHost'.
VERBOSE: Importing function 'Rename-SFTPFile'.
VERBOSE: Importing function 'Set-SFTPContent'.
VERBOSE: Importing function 'Set-SFTPLocation'.
VERBOSE: Importing function 'Set-SFTPPathAttribute'.
VERBOSE: Importing function 'Start-SSHPortForward'.
VERBOSE: Importing function 'Stop-SSHPortForward'.
VERBOSE: Importing function 'Test-SFTPPath'.
VERBOSE: Importing alias 'Get-SSHJsonKnowHost'.
PS C:\Users\Carlos Perez\Documents\GitHub\Posh-SSH\Posh-SSH> Get-SSHJsonKnowHost
Get-SSHJsonKnowHost : The term 'Get-SSHJsonKnownHost' 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
+ Get-SSHJsonKnowHost
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-SSHJsonKnownHost:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\Carlos Perez\Documents\GitHub\Posh-SSH\Posh-SSH> Get-SSHJsonKnownHost
Get-SSHJsonKnownHost : The term 'Get-SSHJsonKnownHost' 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
+ Get-SSHJsonKnownHost
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-SSHJsonKnownHost:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
lol did a reboot and now it works, I tried recompiling, upgrading versions of PS and a reboot fixed it. Got to love Windows
@darkoperator, Due to the presence of breaking changes in v4.0 I propose to remove all the aliases to the parameters and cmdlet names that fixes typos
Good one will remove those and commi them to the 4.0 branch