views:

191

answers:

1

Hey all,

Little new to powershell. I am trying to locate a get-childitem like command that will work on an ftp site.

Here is some psuedo-code:

$target = "c:\file.txt"
$username = "username"
$password = "password"
$ftp = "ftp://$username:$password@myftpsite"

$webclient = New-Object System.Net.WebClient 
$uri = New-Object System.Uri($ftp) 

#below is the code that does not work, get-childitem needs a local path
$name = get-childitem -path $ftp

The get-childitem only works with a local path. Does anyone know how I could access the filenames in this manner when on an ftp site?

Thanks

A: 

What you would need is a PowerShell provider for FTP if you wanted Get-ChildItem to work on a remote filesystem accessed by FTP. This forum post mentions work being done by Nick Howell on an FTP provider. Other than that, I haven't heard of any other FTP providers for PowerShell.

Keith Hill