azure-devops - Copy-item command is throwing Access denied error
问题描述
I am using below command from my test01 server from where i want to invoke the copy-item command on the test02 server.. I am facing access is denied issue.
test01 is the servername where my sharefolder is there test02 is the remote machine
$password = ConvertTo-SecureString “pass” -AsPlainText -Force $Cred = New-Object System.Management.Automation.PSCredential (“work”, $password) Invoke-Command -ScriptBlock {Copy-Item '\test01\new' 'c:\test' -Force -Recurse} -ComputerName "test02" -Credential $Cred strong text
解决方案
您的构建代理似乎缺乏执行该操作的管理员权限。(Invoke-Command -ComputerName
需要管理员权限...)
尝试使用管理员帐户更新当前代理或安装新代理(建议创建新代理池),然后使用管理员帐户启动代理。您可以参考此票以获取更多详细信息。
推荐阅读
- oracle - 在没有 JavaScript 的情况下将 Oracle PL/SQL 移植到 Snowflake
- python - 从 Django 中的 for 循环创建新的 for 循环
- windows - REG_BINARY 在 Windows 注册表中可以有多大?
- node.js - 从 mongoose 的数组中按 id 删除对象
- javascript - 在 React 中并排放置每个 div 的 2 个元素
- javascript - 触发后如何取消 setTimeout 操作?
- excel - 有关加快此代码的任何建议?
- vue.js - vue数据中声明的数字不能小于0
- reactjs - 如何创建 redux 操作成功和错误回调以触发反应组件处理程序?
- sql - 使用 SQL 从 1 次通过的表中选择两个计数?