Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Out-file strange format

$
0
0

I have written a small simple script to login to an FTP server as follows

$GenericFTPFile = 'c:\ftp.txt'
$FTPCMD = 'ftp.exe -i -s:'
$BuiltFTP = $FTPCMD+$GenericFTPFile
$FTPServer = "ftp.rsc-dev.org"
$FTPUser = "user1"
$FTPPAss = "pspsps"
$a = @()
$a += $FTPServer
$a += $FTPUser
$a += $FTPPAss
$a | out-file c:\ftp.txt

invoke-expression -command $BuiltFTP

The issue I get is that the ftp.exe -s:c:\ftp.exe can't read the file, instead I get just a weird square character and the first letter in the file displayed and FTP says it 'invalid character'

Any ideas anyone?

Thanks


Alter De Ruine


Viewing all articles
Browse latest Browse all 2562

Trending Articles