-
Notifications
You must be signed in to change notification settings - Fork 30
Get WinSCPChildItem
Recursively enumerates remote files.
Get-WinSCPChildItem -WinSCPSession <Session> [[-Path] <String[]>] [-Filter <String>] [-Recurse]
[-Depth <Int32>] [-Name] [-Directory] [-File] [<CommonParameters>]
Recursively enumerates remote files.
PS C:\> Get-WinSCPChildItem
Directory: ./
Mode LastWriteTime Length Name
---- ------------- ------ ----
--------- 6/30/2017 8:50:37 AM ftpDir1
--------- 6/30/2017 8:50:44 AM ftpDir2
--------- 6/30/2017 8:50:52 AM 0 ftpDoc1.txt
--------- 6/30/2017 8:50:52 AM 0 ftpDoc2.txt
PS C:\> $sessionOption = New-WinSCPSessionOption -HostName $env:COMPUTERNAME -Protocol Ftp
PS C:\> New-WinSCPSession -SessionOption $sessionOption
Opened Timeout HostName
------ ------- --------
True 00:01:00 ftp.dotps1.github.io
PS C:\> Get-WinChildItem -File
Directory: ./
Mode LastWriteTime Length Name
---- ------------- ------ ----
--------- 6/30/2017 8:50:52 AM 0 ftpDoc1.txt
--------- 6/30/2017 8:50:52 AM 0 ftpDoc2.txt
PS C:\> Remove-WinSCPSession
It represents a session and provides methods for manipulating remote files over SFTP, SCP or FTP session.
Type: Session
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Full path to root remote directory to start enumeration in.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
Windows wildcard to filter files. To select all files, use null.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Null
Accept pipeline input: False
Accept wildcard characters: False
Recurse into subdirectories.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
The amount of directories to recurse.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Gets only the names of the items in the locations.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Select directory objects only.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Select file objects only.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
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 (http://go.microsoft.com/fwlink/?LinkID=113216).
System.String[]
If both -Directory and -File switches are used, return nothing. This mimics the functionality of Get-ChildItem.