How do I start a new powershell instance and tell that instance to execute a certain command?
What I've tried:
(Assuming vim.exe
and file.txt
is in cwd)
Start-Process powershell.exe .\vim.exe .\file.txt
vim.exe
is the parameter to powershell.exe
file.txt
is the parameter to vim.exe
Error says:
Start-Process : A positional parameter cannot be found that accepts argument
'.\file.txt'.At line:1 char:1
+ Start-Process powershell.exe .\vim.exe .\file.txt
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Start-Process], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand
I've also tried powershell.exe -ArgumentList {.\vim.exe .\file.txt}
and no dice.