-
Notifications
You must be signed in to change notification settings - Fork 30
Get WinSCPChildItem
Shows the contents of a remote directory.
Get-WinSCPChildItem [-WinSCPSession] <Session> [[-Path] <String[]>] [[-Filter] <String>] [-Recurse] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]
Displays the contents within a remote directory, including other directories and files.
A valid open WinSCP.Session, returned from New-WinSCPSession.
Required? | true |
Position? | 0 |
Default value | |
Accept pipeline input? | true (ByValue) |
Accept wildcard characters? | false |
Specifies a path to one or more locations. Wildcards are permitted. The default location is the home directory of the user making the connection.
Required? | false |
Position? | 1 |
Default value | / |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
Filter to be applied to returned objects.
Required? | false |
Position? | 2 |
Default value | * |
Accept pipeline input? | false |
Accept wildcard characters? | false |
Return items from all subdirectories.
Required? | false |
Position? | named |
Default value | false |
Accept pipeline input? | false |
Accept wildcard characters? | false |
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
It represents a session and provides methods for manipulating remote files over SFTP, SCP or FTP session.
Represents text as a series of Unicode characters.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the base class for all arrays in the common language runtime.
If the WinSCPSession is piped into this command, the connection will be closed and the object will be disposed upon completion of the command.
PS C:\> New-WinSCPSession -Credential (New-Object -TypeName System.Managemnet.Automation.PSCredential -ArgumentList $env:USERNAME, (New-Object -TypeName System.Security.SecureString)) -HostName $env:COMPUTERNAME -Protocol Ftp | Get-WinSCPChildItem -Path '/rDir/'Directory: /rDir
FileType LastWriteTime Length Name
D 1/1/2015 12:00:00 AM 0 rSubDir
-
1/1/2015 12:00:00 AM 0 rTextFile.txt</pre>
PS C:\> $credential = Get-Credential PS C:\> $session = New-WinSCPSession -Credential $credential -Hostname 'myftphost.org' -SshHostKeyFingerprint 'ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx' Get-WinSCPChildItem -WinSCPSession $session -Path '/rDir/' -RecurseDirectory: /rDir
FileType LastWriteTime Length Name
D 1/1/2015 12:00:00 AM 0 rSubDir
-
1/1/2015 12:00:00 AM 0 rTextFile.txt
Directory: /rDir/rSubDir
FileType LastWriteTime Length Name
-
1/1/2015 12:00:00 AM 0 rSubDirTextFile.txt</pre>