0

我用 powershell 创建了一个新的远程会话,这样:

$pass = ConvertTo-SecureString "pass" -AsPlainText -force
$credential = New-Object System.Management.Automation.PsCredential("computername\admin", $securePassword)
try { 
        $s = New-PSSession -ComputerName "computername" -Authentication CredSSP -Credential $credential
        Invoke-Command -ComputerName computername -FilePath "M:\revertToSnapshot Release1.ps1"
Remove-PSSession $s

而且我不知道如何在 M 驱动器中运行脚本。

如果我尝试以下操作:

Invoke-Command -ComputerName jm_ci -FilePath "m:\revertTosnapshot release1.ps1"

我收到以下错误:调用命令:找不到驱动器。名为“m”的驱动器不存在。

用户是计算机管理员。

4

0 回答 0