At the end of a powershell script, i wanted to starta cmd script.
In order to proceed, i added this : Invoke-Command cmd /c $destinationn\02_creation_de_repertoire.cmd
Result :
Invoke-Command : Impossible de trouver un paramètre positionnel acceptant l'argument «
C:\Users\moamg\Desktop\SPO\02_creation_de_repertoire.cmd».
Au caractère C:\Users\moamg\Desktop\scripts_global\01_install_spo1.ps1:32 : 1
+ Invoke-Command cmd /c $destinationn\02_creation_de_repertoire.cmd
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument : (:) [Invoke-Command], ParameterBindingExcept
ion
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.Invo
keCommandCommand
Any clue ? I started ./FILE.cmd, or FILE.cmd from powershell, and it work. But in the script, it don't.
Invoke-Commandwith the-FilePathtakes its arguments as an array. So `Invoke-Command -filepath Path-To-Cmd 'arg1','arg2'.cmd.exe /c $destinationn\02_creation_de_repertoire.cmdwithout the initialInvoke-Command