0

Powershell guru's --

Two questions that have been driving me crazy:

Question 1:

I see this code everywhere in powershell examples:

= [System.Net.WebRequestMethods+Ftp]::UploadFile

Where is this syntax documented????????????????????????? !!!!!, namely:

[System.Net.WebRequestMethods+Ftp]

I get what is going on (just using the WebRequestMethods.Ftp class field UploadFile), but I thought (by reading the .NET class docs ) that one should be able to use:

[System.Net.WebRequestMethods.Ftp.UploadFile]

Can someone please explain the [System.Net.WebRequestMethods+FTP] powershell syntax -- or at least send me to a page where it is documented??

Question 2:

Does anyone have an example of a powershell script that can read a list of file paths and upload them to an FTP server? For example if the file "upload_files.txt contains these two lines:

D:\www\index.html
D:\www\test\index.html

The code would read each line in the "upload_files.txt" file and the 2 local files would be uploaded to the FTP server.

bdcoder
  • 3,280
  • 8
  • 35
  • 55
  • If you have two questions, you should post two questions. These two are unrelated, really. – Mike Zboray Jul 27 '14 at 23:42
  • Sorry - I thought because both were powershell and FTP related I should group them -- next time I'll do that. – bdcoder Jul 27 '14 at 23:53
  • The first one is really just because it is using Reflection which mangles the names. The documentation for it is [here](http://stackoverflow.com/questions/1867385/upload-files-with-ftp-using-powershell). – Mike Zboray Jul 28 '14 at 00:11
  • HA -- FOUND #1 See [this link](http://stackoverflow.com/questions/14141690/special-use-of-plus-sign-in-powershell) and [this link](http://blogs.msdn.com/b/powershell/archive/2009/08/27/plus-in-net-class-names.aspx) – bdcoder Jul 28 '14 at 01:46

0 Answers0