Hi Experts,
i am trying to download file by using Power shell script as below,
exec('powershell.exe','-NoLogo -Noninteractive -InputFormat None -NoProfile -ExecutionPolicy Bypass -Command (New-Object System.Net.WebClient).DownloadFile("ftp://ftp.ncdc.noaa.gov/pub/data/gsod/2013/gsod_2013.tar", "\\<Linked Dir>\gsod_2013.tar")',8));
but i am facing the below issue and if you run the same command through command prompt it is working fine. so could you please help me out to solve this issue.
13032 | 16140 | PRINTFN | 3/17/2016 7:38:52 AM | 0: Missing ')' in method call. At line:1 char:48 + (New-Object System.Net.WebClient).DownloadFile( <<<< |
13032 | 16140 | PRINTFN | 3/17/2016 7:38:52 AM | ftp://ftp.ncdc.noaa.gov/ pub/data/gsod/2013/gsod_2013.tar, \\nasgfil3_1\sapbodserv_dev\Predictive_Order\ |
13032 | 16140 | PRINTFN | 3/17/2016 7:38:52 AM | Weather_Data\Actual_Temp_Inbound\gsod_2013.tar) + CategoryInfo : ParserError: (CloseParenToken:TokenId) [], Paren |
13032 | 16140 | PRINTFN | 3/17/2016 7:38:52 AM | tContainsErrorRecordException + FullyQualifiedErrorId : MissingEndParenthesisInMethodCall |
13032 | 16140 | JOB | 3/17/2016 7:38:52 AM | Job <Job_POC_DOWNLOAD> is completed successfully. |