使用WinRS通过远程网络路径复制项会抛出UnauthorisedAccessException

时间:2017-03-21 12:34:29

标签: powershell winrs

var x = [["x", "y", "15:10", "z"], ["x", "y", "15:20", "z"], ["x", "y", "16:10", "z"]];

var y = x.reduce(function(e,i) {
          if (e.filter((n) => n.timebox == i[2].split(':')[0]+ ":00"+ "-" + (parseInt(i[2].split(':')[0])+1)+ ":00").length == 0)
          	e.push({timebox: i[2].split(':')[0] + ":00" + "-" + (parseInt(i[2].split(':')[0])+1)+ ":00", count: 0});
            
          e.filter((n) => n.timebox == i[2].split(':')[0]+ ":00"+ "-" + (parseInt(i[2].split(':')[0])+1)+ ":00")[0].count += 1;
          return e;
          }
       ,
      []);
      
      
      alert(JSON.stringify(y));

我的PowerShell脚本在MSBuilds中使用WinRS运行。它抛出UnauthorisedAccessException,但在本地服务器上运行时工作正常。

现在我正在使用 $_sourcepath = '\\servername\DriveLetter$\folder\file.zip' $_destinationPath = 'D:\Temp\file.zip' Copy-Item -Path $_sourcepath -Destination $_destinationPath;

我仍然在获取Unauthorized AccessException。

0 个答案:

没有答案