Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
映射快速访问的Powershell脚本不工作_Powershell - Fatal编程技术网

映射快速访问的Powershell脚本不工作

映射快速访问的Powershell脚本不工作,powershell,Powershell,我正在尝试在Windows资源管理器(Windows 10)中设置快速访问链接,但遇到一个错误“您不能对空值表达式调用方法。位于C:\scripts\new1.ps1:3 char:1 $folder2 = '\\disabilityrightstexas- my.sharepoint.com@SSL\DavWWWRoot\personal\' + $env:username + '_disabilityrightstx_org\Documents' $QuickAccess =

我正在尝试在Windows资源管理器(Windows 10)中设置快速访问链接,但遇到一个错误“您不能对空值表达式调用方法。位于C:\scripts\new1.ps1:3 char:1

$folder2 = '\\disabilityrightstexas- 
   my.sharepoint.com@SSL\DavWWWRoot\personal\' + $env:username + 
   '_disabilityrightstx_org\Documents'
$QuickAccess = New-Object -ComObject shell.application
$QuickAccess.Namespace($folder2).Self.InvokeVerb("pintohome")

您研究过吗?路径需要存在,并且可能不适用于库。看起来我可以映射到本地驱动器,但不能映射到包括OneDrive在内的o365文档库。在尝试映射QuickAccess链接之前,我需要一种传递凭据的方法。