Error mapping to Quick Access links

I have a script I use to map Office 365 document libraries and Onedrive to Quick Access links in Windows 10. This has worked well using Internet Explorer. Now that IE is going away I want to do the same with Chrome, but getting errors. Creating a Quick Access link to a o365 document library works, but when I try to do the same for OneDrive it gives and error. Even if I hardcode my name in the $env it still errors out.

Here is what works:

$chrome = Start-Process -WindowStyle Minimized -file chrome.exe -ArgumentList '--new-window', '' -PassThru
$folder = '\\\DavWWWRoot\sites\Site\DocumentLibrary'

I get an error with this last command:

$chrome = Start-Process -WindowStyle Minimized -file chrome.exe -ArgumentList '--new-window', "${env:username}_mycompany_com\Documents" -Passthru 
$folder2 = "\\\DavWWWRoot\personal\${env:username}_mycompany_com\Documents"

Error: InvalidOperation: You cannot call a method on a null-valued expression.

how about doing like

-ArgumentList "--new-window${env:username}_mycompany_com\Documents"

Thanks for the suggestion kvprasoon, but still getting same error.

Does it make any difference if the backslash is changed to a forward slash?

unfortunately still getting error. The first two lines run fine. It’s the last line that gives me the error.

Can you share your code that populates the variable $QuickAccess?

To fix this, we need to work out why $QuickAccess is NULL.

$QuickAccess = New-Object -ComObject shell.application

Ok, so that bit is probably OK.

What’s the output of:





What happens it you try:


output for $QuickAccess

Application Parent

System.__ComObject System.__ComObject

no output from $QuickAccess.NameSpace($folder2)

no output from $QuickAccess.NameSpace($folder2).self

The first command runs fine. The second throws the error:
InvalidOperation: Method invocation failed because [System.__ComObject] does not contain a method named 'InvokeVerb'.

What happens if you simply use:


The default verb is “Open”

I get same error as orignal issue:

InvalidOperation: You cannot call a method on a null-valued expression.

Do you have any other way of validating that the UNC path for $folder2 is correct? e.g. does it open for you in Explorer?

I’m pretty sure that the problem is it doesn’t like that path. I’ve tried several variations with my own OneDrive and I cannot get a working UNC path.

It doesn’t work in Explorer, but this script works fine with IE.

If it’s OK with IE, the only thing I can suggest that might be affecting it is Trusted Sites; because that’s what the error I’m getting relates to when I try to browse to it in Directory Opus. Perhaps Chrome has a similar problem.

PowerShell and File Explorer don’t give any error, they just hang for a while.


I have added it to Trusted Sites but no dice.

Here is what I have under Trusted Sites:

Local Intranet:

Thanks your help on this.