PowerShell Copy-Item 在 Octopus 中给出错误
PowerShell Copy-Item gives error in Octopus
我尝试将一个 DLL 文件从我的计算机复制到另一台计算机并注册它:
net use \RemoteIp\C$\Dev 'pass'/USER:'user'
copy-item "D:\test.dll" -Destination "\RemoteIp\c$\Dev";
regsvr32 "\RemoteIp\C$\Dev\test.dll"
我遇到的问题是,当我尝试从 Octopus 运行 这个脚本时,我收到这个错误:
Copy-Item : Cannot find path 'D:\test.dll' because it does
not exist.
At C:\Octopus\Work160606100457-74\Script.ps1:3 char:10
+ copy-item <<<< "D:\test.dll" -Destination "\RemoteIp\c$\Dev";
+ CategoryInfo : ObjectNotFound: (D:\test.dll
:String) [Copy-Item], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyI
temCommand
The remote script failed with exit code 1
如果我尝试 运行 PowerShell 中的这些代码行,它会正常工作。
有什么建议吗?
谢谢
其实这是我的错。当您在 Octopus 中 运行ning 脚本时,该脚本旨在 运行 在部署目标上:
您必须使用 IP 地址定义您的本地电脑。例如,在我的例子中,我必须这样写地址 "D:\test.dll" : "\192.168.00.00\D$\test.dll" 。
对于 regsvr32
问题,我在服务器上添加了一个 运行 regsvr32 指令的 bat 文件,我只调用该文件,剩下的由它完成。
希望对其他人有所帮助:)
我尝试将一个 DLL 文件从我的计算机复制到另一台计算机并注册它:
net use \RemoteIp\C$\Dev 'pass'/USER:'user'
copy-item "D:\test.dll" -Destination "\RemoteIp\c$\Dev";
regsvr32 "\RemoteIp\C$\Dev\test.dll"
我遇到的问题是,当我尝试从 Octopus 运行 这个脚本时,我收到这个错误:
Copy-Item : Cannot find path 'D:\test.dll' because it does not exist. At C:\Octopus\Work160606100457-74\Script.ps1:3 char:10 + copy-item <<<< "D:\test.dll" -Destination "\RemoteIp\c$\Dev"; + CategoryInfo : ObjectNotFound: (D:\test.dll :String) [Copy-Item], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyI temCommand The remote script failed with exit code 1
如果我尝试 运行 PowerShell 中的这些代码行,它会正常工作。
有什么建议吗?
谢谢
其实这是我的错。当您在 Octopus 中 运行ning 脚本时,该脚本旨在 运行 在部署目标上:
您必须使用 IP 地址定义您的本地电脑。例如,在我的例子中,我必须这样写地址 "D:\test.dll" : "\192.168.00.00\D$\test.dll" 。
对于 regsvr32
问题,我在服务器上添加了一个 运行 regsvr32 指令的 bat 文件,我只调用该文件,剩下的由它完成。
希望对其他人有所帮助:)