Package calls a command utility to import an XML config file after install. My script copies the file to the local path and runs the CLI.
If I were to run the import from a prompt, it would be
"C:\Program Files\Fortinet\FortiClient\FCConfig.exe" -m vpn -f "C:\Program Files\Fortinet\FortiClient\IntegraVPN.conf" -o import -p <password>
To get PSADT to work without error. I learned I did not need to include the path for the .CONF file to get it to run successfully
Start-ADTProcess -FilePath "$envProgramFiles\Fortinet\FortiClient\FCConfig.exe" -ArgumentList "-m vpn -f IntegraVPN.conf -o import -p <password>"
However, after import into Intune and run the package. it does not seem to resolve where the CONF file is and fails the entire post install section of my script. Intune error shows
The filename, directory name, or volume label syntax is incorrect (0x8007007B)
Trace Log shows
[Post-Install] :: Executing [C:\Program Files\Fortinet\FortiClient\FCConfig.exe -m vpn -f IntegraVPN.conf -o import -p “password”]…
[Post-Install] :: Execution failed with exit code [-1073741701].
For Intune to work, I need to put in the path for the config file in my -ArguementList, but I am missing something properly declaring the path.
I have tried
AppImport = '"$envProgramFiles\Fortinet\FortiClient\FIntegraVPN.conf"'
Start-ADTProcess -FilePath "$envProgramFiles\Fortinet\FortiClient\FCConfig.exe" -ArgumentList "-m vpn -f $($adtSession.AppImport) -o import -p <password>"
(I had set my variable with and without double quotes) The PSADT script fails because it’s not recognizing the variable $envProgramFiles.
From the logs;
[Post-Install] :: Executing [C:\Program Files\Fortinet\FortiClient\FCConfig.exe -m vpn -f $envProgramFiles\Fortinet\FortiClient\FIntegraVPN.conf -o import -p “password”]…
[Post-Install] :: Execution failed with exit code [-1073741515].
If I try to just put the path into the -ArguementList with escape quotes, everything after is misrepresented.
`Start-ADTProcess -FilePath "$envProgramFiles\Fortinet\FortiClient\FCConfig.exe" -ArgumentList "-m vpn -f '"$envProgramFiles\Fortinet\FortiClient\FCConfig.exe'" -o import -p <password>"`
If I encapsulate the argument in single quotes, the string looks right, but the outcome is the same.
Start-ADTProcess -FilePath "$envProgramFiles\Fortinet\FortiClient\FCConfig.exe" -ArgumentList '-m vpn -f "$envProgramFiles\Fortinet\FortiClient\FCConfig.exe" -o import -p <password>'
What am I missing?
TIA