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

invoke-expression problem :-)

$
0
0

Hi,

My script is running the windows ftp client but after it completes its not following on with the next section, instead its getting stuck in FTP.  It's supposed to run  

remove-item $GenericFTPFile but the scripots hangs.  If I kill ftp.exe in task scheduler I can see FTP has uploaded but the script ends.  Is this something I am doing wrong using invoke-expression, is there an alternative?

$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 $BuiltFTP

remove-item $GenericFTPFile


Alter De Ruine


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>