我有一个问题,试图用PowerShell输出文件,我可以将文件导出到计算机的本地驱动器,但是当我想将其导出到网络位置时,它不会让我。Out-file导出到网络位置powershell
我收到以下错误:
Access to the path '\\fmadt-prod-web5\e$\ftproot\customer\temp\SiteLists\Classic\Hosted1.txt' is denied.
+ CategoryInfo : OpenError: (:) [Out-File], UnauthorizedAccessException
+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand
这是我使用的代码:
$list2 | Format-Table -a -Property "WebAppName", "Version", "State"| Out-File '\\fmadt-prod-web5\e$\ftproot\customer\temp\SiteLists\Classic\Hosted1.txt' -force
是否有可能导出到一个网络位置?我正在使用的用户也具有对该位置的管理权限。
我现在收到一个错误,根目录不存在或不是一个文件夹,我已经验证他们的位置是精确的是存在的。我正在使用网络和服务器上的服务器管理员的凭据。想法? – Brett