Hi Bob,
I think you have forgotten leading (or trailing) spaces when assigning the info to variables.
In my tests, I did get errors if the assigned variable started with '
/Option', because when you run the PowerShell statement:
Code:
# The call
& $CMD $arg1 $arg2 $arg3 $arg4 $arg5 $arg6 $arg7
The spaces between the args are not literal.
So each variable assignment will likely need a leading or trailing space to separate the SFXCL options:
Code:
[string]$CMD = 'SFXCL'
[string]$arg1 = ' /Q'
[string]$arg2 = ' /Log ' + $CheminLog + '\Log' + $(get-date -f yyyyMMddHHmmss) + '.log'
[string]$arg3 = ' /I ' + $CheminClePrive
[string]$arg4 = ' /P ''' + $Passphrase + ''''
[string]$arg5 = ' /F ' + $CheminConfigSecureFX
[string]$arg6 = ' \\' + $Serveur + $CheminFichier + $fichier
[string]$arg7 = ' SFTP://' + $UserCCD + '@' + $HostaddressCCD + ':/' + $RepertoireCCD