I want to invoke sc create from a powershell script. Here is the code.
function Execute-Command
{
    param([string]$Command, [switch]$ShowOutput=$True)
    echo $Command
    if ($ShowOutput) {
        Invoke-Expression $Command
    } else {
        $out = Invoke-Expression $Command
    }
}
$cmd="sc create `"$ServiceName`" binpath=`"$TargetPath`" displayname=`"$DisplayName`" "
Execute-Command -Command:$cmd
which gives the following error:
Set-Content : A positional parameter cannot be found that accepts argument 'binpath=...'.
At line:1 char:1
What is the problem? What are positional arguments?
