-
Notifications
You must be signed in to change notification settings - Fork 29
New WinSCPSessionOption
Defines information to allow an automatic connection and authentication of the session.
New-WinSCPSessionOption [-Confirm] [-Credential <PSCredential>] [-FtpMode <FtpMode>] [-FtpSecure <FtpSecure>]
[-GiveUpSecurityAndAcceptAnySshHostKey] [-GiveUpSecurityAndAcceptAnyTlsHostCertificate] -HostName <String>
[-PortNumber <Int32>] [-Protocol <Protocol>] [-RawSetting <Hashtable>]
[-SecurePrivateKeyPassphrase <SecureString>] [-SshHostKeyFingerprint <String[]>] [-SshPrivateKeyPath <String>]
[-Timeout <TimeSpan>] [-TlsClientCertificatePath <String>] [-TlsHostCertificateFingerprint <String>]
[-WebdavRoot <String>] [-WebdavSecure] [-WhatIf] [<CommonParameters>]
Defines information to allow an automatic connection and authentication of the session. Is used with the New-WinSCPSession and Get-WinSCPSshHostKeyFingerprint methods.
PS C:\> New-WinSCPSessionOption -HostName ftp.dotps1.github.io
Protocol : Sftp
HostName : ftp.dotps1.github.io
PortNumber : 0
UserName : anonymous
Password :
SecurePassword : System.Security.SecureString
NewPassword :
SecureNewPassword :
Timeout : 00:00:15
TimeoutInMilliseconds : 15000
PrivateKeyPassphrase :
SshHostKeyFingerprint :
GiveUpSecurityAndAcceptAnySshHostKey : False
SshPrivateKeyPath :
SshPrivateKeyPassphrase :
FtpMode : Passive
FtpSecure : None
WebdavSecure : False
WebdavRoot :
TlsHostCertificateFingerprint :
GiveUpSecurityAndAcceptAnyTlsHostCertificate : False
TlsClientCertificatePath :
PS C:\> New-WinSCPSessionOption -HostName ftp.dotps1.github.io -Protocol Sftp -SshHostKeyFingerPrint "ssh-dss 2048 01:aa:23:bb:45:cc:67:dd:89:ee:01:ff:23:aa:45:bb" -Credential (Get-Credential)
Protocol : Sftp
HostName : ftp.dotps1.github.io
PortNumber : 0
UserName : dotps1
Password :
SecurePassword : System.Security.SecureString
NewPassword :
SecureNewPassword :
Timeout : 00:00:15
TimeoutInMilliseconds : 15000
PrivateKeyPassphrase :
SshHostKeyFingerprint : ssh-dss 2048 01:aa:23:bb:45:cc:67:dd:89:ee:01:ff:23:aa:45:bb
GiveUpSecurityAndAcceptAnySshHostKey : False
SshPrivateKeyPath :
SshPrivateKeyPassphrase :
FtpMode : Passive
FtpSecure : None
WebdavSecure : False
WebdavRoot :
TlsHostCertificateFingerprint :
GiveUpSecurityAndAcceptAnyTlsHostCertificate : False
TlsClientCertificatePath :
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseRepresents a set of security credentials, such as a user name and a password.
Type: PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalsePossible values are FtpMode.Passive (default) and FtpMode.Active.
Type: FtpMode
Parameter Sets: (All)
Aliases:
Accepted values: Passive, Active
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalsePossible values are FtpSecure.None (default), FtpSecure.Implicit and FtpSecure.Explicit.
Type: FtpSecure
Parameter Sets: (All)
Aliases:
Accepted values: None, Implicit, Explicit
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseGive up security and accept any SSH host key. To be used in exceptional situations only, when security is not required. When set, log files will include warning about insecure connection. To maintain security, use SshHostKeyFingerprint.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseGive up security and accept any FTPS/WebDAVS server TLS/SSL certificate. To be used in exceptional situations only, when security is not required. When set, log files will include warning about insecure connection. To maintain security, use TlsHostCertificateFingerprint.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseName of the host to connect to. Mandatory property.
Type: String
Parameter Sets: (All)
Aliases: ComputerName
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalsePort number to connect to. Keep default 0 to use the default port for the protocol.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseProtocol to use for the session. Possible values are Protocol.Sftp (default), Protocol.Scp, Protocol.Ftp, Protocol.Webdav and Protocol.S3.
Type: Protocol
Parameter Sets: (All)
Aliases:
Accepted values: Sftp, Scp, Ftp, Webdav, S3
Required: False
Position: Named
Default value: Sftp
Accept pipeline input: False
Accept wildcard characters: FalseAllows configuring any site settings using raw format as in an INI file.
Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseEncrypted passphrase for encrypted private keys and client certificates.
Type: SecureString
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseFingerprint of SSH server host key (or several alternative fingerprints separated by semicolon). It makes WinSCP automatically accept host key with the fingerprint. Mandatory for SFTP/SCP protocol.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseFull path to SSH private key file.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseServer response timeout. Defaults to 15 seconds.
Type: TimeSpan
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseFull path to TLS/SSL client certificate.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseFingerprint of FTPS/WebDAVS server TLS/SSL certificate to be automatically accepted (useful for certificates signed by untrusted authority).
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseWebDAV root path.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseUse WebDAVS (WebDAV over TLS/SSL), instead of WebDAV.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.