我正在尝试运行以下调用命令,该命令将在远程计算机上使用“remove”参数运行 rabbitmq-service.bat。该命令在删除 rabbmitmq-service 后完美执行,但出现以下错误“目录名称无效。”
$Cre = Get-Credential -Message "Enter credentials for $fo1"
$fo1Session = New-PSSession -ComputerName Dedicated-Test1 -Credential $Cre
$action = "C:\Program Files\RabbitMQ Server\rabbitmq_server-3.7.10\sbin\rabbitmq-service.bat"
$remove = "remove"
PS C:\WINDOWS\system32> Invoke-Command -Session $fo1Session -ScriptBlock {& $using:action $using:remove -verb runAs}
The directory name is invalid.
+ CategoryInfo : NotSpecified: (The directory name is invalid.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
+ PSComputerName : Dedicated-Test1
The filename, directory name, or volume label syntax is incorrect.
C:\Program Files\erl10.2\erts-10.2\bin\erlsrv: Service RabbitMQ removed from system.