-
Notifications
You must be signed in to change notification settings - Fork 30
New WinSCPSession
This is the main interface class of the WinSCP assembly.
New-WinSCPSession [-AdditionalExecutableArguments <String>] [-Confirm] [-DebugLogLevel <Int32>]
[-DebugLogPath <String>] [-ExecutableProcessCredential <PSCredential>] [-ReconnectTime <TimeSpan>]
[-SessionLogPath <String>] -SessionOption <SessionOptions> [-WhatIf] [<CommonParameters>]
This is the main interface class of the WinSCP assembly. It represents a session and provides methods for manipulating remote files over SFTP, SCP or FTP session.
PS C:\> New-WinSCPSession -SessionOption (New-WinSCPSessionOption -HostName ftp.dotps1.github.io -Protocol Ftp)
Opened Timeout HostName
------ ------- --------
True 00:01:00 ftp.dotps1.github.io
PS C:\> $credential = Get-Credential
PS C:\> $sshHostKeyFingerprint = "ssh-dss 2048 01:aa:23:bb:45:cc:67:dd:89:ee:01:ff:23:aa:45:bb"
PS C:\> $sessionOption = New-WinSCPSessionOption -HostName ftp.dotps1.github.io -SshHostKeyFingerprint $sshHostKeyFingerprint -Credential $credential
PS C:\> New-WinSCPSession -SessionOption $sessionOption
Opened Timeout HostName
------ ------- --------
True 00:01:00 ftp.dotps1.github.io
Additional command-line arguments to be passed to winscp.com. In general, this should be left with default null.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
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: False
Logging level of debug log to. The default value is 0. The maximal logging level is 2.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Path to store assembly debug log to. Default null means, no debug log file is created. See also SessionLogPath.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Null
Accept pipeline input: False
Accept wildcard characters: False
If the .NET process is running in an impersonated environment, you need to provide credentials of the impersonated account, so that the winscp.exe process can be started with the same privileges.
Type: PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Sets time limit in seconds to try reconnecting broken sessions. Default is 120 seconds. Use TimeSpan.MaxValue to remove any limit.
Type: TimeSpan
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Path to store session log file to. Default null means, no session log file is created. See also DebugLogPath.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Null
Accept pipeline input: False
Accept wildcard characters: False
Defines information to allow an automatic connection and authentication of the session. Returned from the New-WinSCPSessionOption command.
Type: SessionOptions
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
Shows 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: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.