I am using start-process to start a RVtools (as that is what my company are using to report on…i know i can use Power-Cli, and I would but for now would like like to embrace existing processes using RVtools and then seek to improve it…).
I am using a method that was shown to me before by passing an argument list.
I have the relevant sections below:
$vcentre = ‘vcentreserver’
$arglist = '-s {0} ’ -f $vcentre
$path = ‘C:\Program Files (x86)\Robware\RVTools’
$tskParams = @{
FilePath =“$path\RVTools.exe”
ArgumentList = $argList
Wait = $true
NoNewWindow = $true
}
Start-Process $tskParams
Yet when I run this I get the error :
Start-Process : This command cannot be run due to the error: The system cannot find the file specified.
At line:1 char:9
+ Start-Process $tskParams -ErrorVariable test
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (
[Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
However when I use
Start-Process -FilePath “C:\Program Files (x86)\Robware\RVTools\RVTools.exe”
it works. I am not quite sure what is going on…any help appreciated