FTP/Get-ChildItemFTPWinSCP.ps1
function Get-ChildItemFTPWinSCP { Param( # path to get children from [Parameter(Mandatory=$true)] [string] $Path ) $FtpScript = [string[]](Split-PathToFTPWinSCPScript $Path) $FtpScript += "ls" [array]$cmdOutput = Invoke-FTPWinSCP -Script $FtpScript $foundLsOutput = $false; foreach ($cmdLine in $cmdOutput) { if ($foundLsOutput) { if ($cmdLine.Length -gt 64) { Write-Output $cmdLine.Substring(64) } } else { $foundLsOutput = $cmdLine.StartsWith("D---------") } } } Export-ModuleMember -Function Get-ChildItemFTPWinSCP |