Connect-SSHCmdlet
Parameters Output Objects Config Settings
The Connect-SSH cmdlet is used to create a persistent connection object.
Syntax
$cnn = Connect-SSH [parameters]
Remarks
This cmdlet allows you to create a persistent connection object to be used with related cmdlets.When executing the cmdlet a connection object is returned. Pass this object to the Connection parameter of related cmdlets to use the newly created connection object.
To disconnect call Disconnect-SSH.
Parameter List
The following is the full list of the parameters of the cmdlet with short descriptions. Click on the links for further details.
LogFile | The location of a file to which debug information is written. |
AuthMode | The type of authentication used by the component. |
CertPassword | The password to the certificate store. |
CertStore | The name of the certificate store for the client certificate. |
CertStoreType | The type of certificate store for the client certificate. |
CertSubject | The subject of the certificate used for client authentication. |
CompressionAlgorithms | A comma-separated list containing all allowable compression algorithms. |
Config | Specifies one or more configuration settings. |
Credential | The PSCredential object to use for user/password authentication. |
EncryptionAlgorithms | A comma-separated list containing all allowable compression algorithms. |
FirewallHost | Name or IP address of firewall. |
FirewallPassword | A password if authentication is to be used when connecting through the firewall. |
FirewallPort | The port of the firewall to which to connect. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
Force | Forces the component to accept the default behavior instead of querying the user. |
LocalIP | The IP address of the local interface to use. |
LogFile | The location of a file to which debug information is written. |
Password | The password to use for authentication. |
PasswordPrompt | The shell prompt used for keyboard-interactive authentication. |
Port | The port to be used. |
Server | The address of the Server. |
ShellPrompt | Specifies the shell prompt to wait for. |
ShellPromptExpression | A regular expression to match the shell prompt returned by the server. |
SSHAccept | The hex-encoded fingerprint of the host to trust explicitly. |
Timeout | The maximum time allowed for the operation. |
User | The username to use for authentication. |
Output Objects
The following is the full list of the output objects returned by the cmdlet with short descriptions. Click on the links for further details.
SSHConnection | The connection object. |
Config Settings
The following is a list of config settings for the cmdlet with short descriptions. Click on the links for further details.
EnableEcho | Whether the commands sent to the server should be echoed. |
SexecExitStatusVar | The name of a variable to store the exit status of a command executed via the SExec protocol. |
TerminalHeight | The height of the terminal display. |
TerminalUsePixel | Whether the terminal's dimensions are in columns/rows or pixels. |
TerminalWidth | The width of the terminal display. |
DisconnectOnChannelClose | Whether to automatically close the connection when a channel is closed. |
EncodedTerminalModes | The terminal mode to set when communicating with the SSH host. |
StdInFile | The file to use as Stdin data. |
TerminalHeight | The height of the terminal display. |
TerminalModes | The terminal mode to set when communicating with the SSH host. |
TerminalUsePixel | Whether the terminal's dimensions are in columns/rows or pixels. |
TerminalWidth | The width of the terminal display. |
UseTerminal | Whether to executes commands within a pseudo-terminal. |
ChannelDataEOL[ChannelId] | Used to break the incoming data stream into chunks. |
ChannelDataEOLFound[ChannelId] | Determines if ChannelDataEOL was found. |
ClientSSHVersionString | The SSH version string used by the component. |
EnablePageantAuth | Whether to use a key stored in Pageant to perform client authentication. |
KerberosDelegation | If true, asks for credentials with delegation enabled during authentication. |
KerberosRealm | The fully qualified domain name of the Kerberos Realm to use for GSSAPI authentication. |
KerberosSPN | The Kerberos Service Principal Name of the SSH host. |
KeyRenegotiationThreshold | Sets the threshold for the SSH Key Renegotiation. |
LogLevel | Specifies the level of detail that is logged. |
MaxChannelDataLength[ChannelId] | The maximum amount of data to accumulate when no ChannelDataEOL is found. |
MaxPacketSize | The maximum packet size of the channel, in bytes. |
MaxWindowSize | The maximum window size allowed for the channel, in bytes. |
PasswordPrompt | The text of the password prompt used in keyboard-interactive authentication. |
PreferredDHGroupBits | The size (in bits) of the preferred modulus (p) to request from the server. |
RecordLength | The length of received data records. |
ServerSSHVersionString | The remote host's SSH version string. |
SignedSSHCert | The CA signed client public key used when authenticating. |
SSHAcceptAnyServerHostKey | If set the component will accept any key presented by the server. |
SSHAcceptServerCAKey | The CA public key that signed the server's host key. |
SSHAcceptServerHostKeyFingerPrint | The fingerprint of the server key to accept. |
SSHFingerprintHashAlgorithm | The algorithm used to calculate the fingerprint. |
SSHFingerprintMD5 | The server hostkey's MD5 fingerprint. |
SSHFingerprintSHA1 | The server hostkey's SHA1 fingerprint. |
SSHFingerprintSHA256 | The server hostkey's SHA256 fingerprint. |
SSHKeepAliveCountMax | The maximum number of keep alive packets to send without a response. |
SSHKeepAliveInterval | The interval between keep alive packets. |
SSHKeyExchangeAlgorithms | Specifies the supported key exchange algorithms. |
SSHKeyRenegotiate | Causes the component to renegotiate the SSH keys. |
SSHMacAlgorithms | Specifies the supported Mac algorithms. |
SSHPubKeyAuthSigAlgorithms | Specifies the enabled signature algorithms that may be used when attempting public key authentication. |
SSHPublicKeyAlgorithms | Specifies the supported public key algorithms for the server's public key. |
SSHVersionPattern | The pattern used to match the remote host's version string. |
TryAllAvailableAuthMethods | If set to true, the component will try all available authentication methods. |
UseStrictKeyExchange | Specifies how strict key exchange is supported. |
WaitForChannelClose | Whether to wait for channels to be closed before disconnected. |
WaitForServerDisconnect | Whether to wait for the server to close the connection. |
ConnectionTimeout | Sets a separate timeout value for establishing a connection. |
FirewallAutoDetect | Tells the component whether or not to automatically detect and use firewall system settings, if available. |
FirewallHost | Name or IP address of firewall (optional). |
FirewallPassword | Password to be used if authentication is to be used when connecting through the firewall. |
FirewallPort | The TCP port for the FirewallHost;. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
KeepAliveInterval | The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received. |
KeepAliveTime | The inactivity time in milliseconds before a TCP keep-alive packet is sent. |
Linger | When set to True, connections are terminated gracefully. |
LingerTime | Time in seconds to have the connection linger. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The port in the local host where the component binds. |
MaxLineLength | The maximum amount of data to accumulate when no EOL is found. |
MaxTransferRate | The transfer rate limit in bytes per second. |
ProxyExceptionsList | A semicolon separated list of hosts and IPs to bypass when using a proxy. |
TCPKeepAlive | Determines whether or not the keep alive socket option is enabled. |
TcpNoDelay | Whether or not to delay when sending packets. |
UseIPv6 | Whether to use IPv6. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
MaskSensitive | Whether sensitive data is masked in log messages. |
UseInternalSecurityAPI | Tells the component whether or not to use the system security libraries or an internal implementation. |
LogFile Parameter (Connect-SSH Cmdlet)
The location of a file to which debug information is written.
Syntax
Connect-SSH -LogFile string
Remarks
When specified, the cmdlet will log debug information to the file. If the file exists, the information will be appended.Default Value
null
AuthMode Parameter (Connect-SSH Cmdlet)
The type of authentication used by the component.
Syntax
Connect-SSH -AuthMode string
Remarks
Default Value
2
CertPassword Parameter (Connect-SSH Cmdlet)
The password to the certificate store.
Syntax
Connect-SSH -CertPassword string
Remarks
Default Value
""
Parameter Alias
CertificatePassword
CertStore Parameter (Connect-SSH Cmdlet)
The name of the certificate store for the client certificate.
Syntax
Connect-SSH -CertStore string
Remarks
Default Value
"MY"
Parameter Alias
CertificateStore
CertStoreType Parameter (Connect-SSH Cmdlet)
The type of certificate store for the client certificate.
Syntax
Connect-SSH -CertStoreType string
Remarks
Default Value
0
CertSubject Parameter (Connect-SSH Cmdlet)
The subject of the certificate used for client authentication.
Syntax
Connect-SSH -CertSubject string
Remarks
Default Value
"*"
Command Parameter (Connect-SSH Cmdlet)
The command to be sent to the server.
Syntax
Connect-SSH -Command string
Remarks
Default Value
""
Parameter Position
2
This is a required parameter.
CompressionAlgorithms Parameter (Connect-SSH Cmdlet)
A comma-separated list containing all allowable compression algorithms.
Syntax
Connect-SSH -CompressionAlgorithms string
Remarks
Default Value
"none"
Config Parameter (Connect-SSH Cmdlet)
Specifies one or more configuration settings.
Syntax
Connect-SSH -Config string[]
Remarks
Default Value
null
Credential Parameter (Connect-SSH Cmdlet)
The PSCredential object to use for user/password authentication.
Syntax
Connect-SSH -Credential PSCredential
Remarks
Default Value
null
Parameter Position
1
Parameter Alias
auth
EncryptionAlgorithms Parameter (Connect-SSH Cmdlet)
A comma-separated list containing all allowable compression algorithms.
Syntax
Connect-SSH -EncryptionAlgorithms string
Remarks
Default Value
"aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,arcfour256,arcfour128,arcfour,cast128-cbc,aes256-gcm@openssh.com,aes128-gcm@openssh.com"
EOL Parameter (Connect-SSH Cmdlet)
The end of line character to use for parsing the response.
Syntax
Connect-SSH -EOL string
Remarks
Default Value
"'n"
FirewallHost Parameter (Connect-SSH Cmdlet)
Name or IP address of firewall.
Syntax
Connect-SSH -FirewallHost string
Remarks
Default Value
""
FirewallPassword Parameter (Connect-SSH Cmdlet)
A password if authentication is to be used when connecting through the firewall.
Syntax
Connect-SSH -FirewallPassword string
Remarks
Default Value
""
FirewallPort Parameter (Connect-SSH Cmdlet)
The port of the firewall to which to connect.
Syntax
Connect-SSH -FirewallPort int
Remarks
Default Value
0
FirewallType Parameter (Connect-SSH Cmdlet)
Determines the type of firewall to connect through.
Syntax
Connect-SSH -FirewallType string
Remarks
Default Value
0
FirewallUser Parameter (Connect-SSH Cmdlet)
A user name if authentication is to be used connecting through a firewall.
Syntax
Connect-SSH -FirewallUser string
Remarks
Default Value
""
Force Parameter (Connect-SSH Cmdlet)
Forces the component to accept the default behavior instead of querying the user.
Syntax
Connect-SSH -Force SwitchParameter
Remarks
Default Value
false
LocalIP Parameter (Connect-SSH Cmdlet)
The IP address of the local interface to use.
Syntax
Connect-SSH -LocalIP string
Remarks
Default Value
""
Parameter Alias
LocalAddress
LogFile Parameter (Connect-SSH Cmdlet)
The location of a file to which debug information is written.
Syntax
Connect-SSH -LogFile string
Remarks
Default Value
""
Password Parameter (Connect-SSH Cmdlet)
The password to use for authentication.
Syntax
Connect-SSH -Password string
Remarks
Default Value
""
PasswordPrompt Parameter (Connect-SSH Cmdlet)
The shell prompt used for keyboard-interactive authentication.
Syntax
Connect-SSH -PasswordPrompt string
Remarks
Default Value
"password"
Port Parameter (Connect-SSH Cmdlet)
The port to be used.
Syntax
Connect-SSH -Port int
Remarks
Default Value
22
Server Parameter (Connect-SSH Cmdlet)
The address of the Server.
Syntax
Connect-SSH -Server string
Remarks
Default Value
""
Parameter Position
0
This is a required parameter.
ShellPrompt Parameter (Connect-SSH Cmdlet)
Specifies the shell prompt to wait for.
Syntax
Connect-SSH -ShellPrompt string
Remarks
Default Value
""
ShellPromptExpression Parameter (Connect-SSH Cmdlet)
A regular expression to match the shell prompt returned by the server.
Syntax
Connect-SSH -ShellPromptExpression string
Remarks
Default Value
""
SSHAccept Parameter (Connect-SSH Cmdlet)
The hex-encoded fingerprint of the host to trust explicitly.
Syntax
Connect-SSH -SSHAccept string
Remarks
Default Value
""
Parameter Alias
Fingerprint
Stdin Parameter (Connect-SSH Cmdlet)
The text to feed the expression/command on the standard input stream.
Syntax
Connect-SSH -Stdin string
Remarks
Default Value
""
Timeout Parameter (Connect-SSH Cmdlet)
The maximum time allowed for the operation.
Syntax
Connect-SSH -Timeout int
Remarks
Default Value
10
User Parameter (Connect-SSH Cmdlet)
The username to use for authentication.
Syntax
Connect-SSH -User string
Remarks
Default Value
""
SSHConnection Output Object (Connect-SSH Cmdlet)
The connection object.
Syntax
Object SSHConnection {string AuthMode;
string CertPassword;
string CertStore;
string CertStoreType;
string CertSubject;
string CompressionAlgorithms;
string[] Config;
PSCredential Credential;
string EncryptionAlgorithms;
string FirewallHost;
string FirewallPassword;
int FirewallPort;
string FirewallType;
string FirewallUser;
SwitchParameter Force;
string LocalIP;
string LogFile;
string Password;
string PasswordPrompt;
int Port;
string Server;
string ShellPrompt;
string ShellPromptExpression;
string SSHAccept;
int Timeout;
string User;
}