, Я использую PowerShell 5.1. Есть идеи?
я есть следующий скрипт PowerShell для проверки моих репозиториев SVN:
$SVNAdminDir = 'C:\Program Files (x86)\VisualSVN Server\bin';
$RepositoryDir = 'C:\My Repositories\App1';
$_cmd = "`"$SVNAdminDir`\svnadmin`" verify `"$RepositoryDir`"";
Write-Host $_cmd; # Copying this into the command prompt runs without an issue...
cmd.exe /c $_cmd; # It's when I try to execute the command from PS that I get the error.
Но когда я пытаюсь выполнить его, я получаю следующее сообщение об ошибке:
cmd.exe : 'C:\Program' is not recognized as an internal or external command,
At line:5 char:12
+ cmd.exe <<<< /c $_cmd;
+ CategoryInfo : NotSpecified: ('C:\Program' is...ternal command,:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
operable program or batch file.
Так как я по сути настройки$cmd = '"C:\Program Files (x86)\VisualSVN Server\bin\svnadmin" verify "C:\My Repositories\App1"';
с двойными кавычками внутри одинарных кавычек, я ожидал пробел вC: \ Program Files (x86) \ ... быть переданным правильно.
Я подозреваю, что есть что-то тривиальное в строке, которую мне не хватает ...