In cmd I can write a batch file like so, which will provide an alias for an executable.
SuperUtil.bat
call Mine.Library.SuperUtil.exe %*
So I can call
SuperUtil -t SomeParam
This is my attempt of a PowerShell equivalent
Start-Process Mine.Library.SuperUtil.exe -NoNewWindow -ArgumentList $args
However when I call it with no parameters I get an error.
Start-Process : Cannot validate argument on parameter 'ArgumentList'. The argument is null, empty, or an element of the argument collection contains a null value. Supply a collection that does not contain any null values and then try the command again.
I've tried the following but doesn't pass the arguments, plus it's quite verbose:
if ($args -ne $Null)
{
Start-Process Mine.Library.SuperUtil.exe -NoNewWindow -ArgumentList $args -Wait
}
else
{
Start-Process Mine.Library.SuperUtil.exe -NoNewWindow -Wait
}
So I want to optionally pass the arguments or not, in order to explore the command line options.