Как вызвать sc create из сценария powershell

Я хочу призватьsc create из сценария powershell. Вот код

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

что дает следующую ошибку:

Set-Content : A positional parameter cannot be found that accepts argument 'binpath=...'.
At line:1 char:1

В чем проблема? Каковы позиционные аргументы?

Ответы на вопрос(2)

Ваш ответ на вопрос