2

When I try to run the following command:

PS /Users/<user>> Connect-PnPOnline -Url https://<tenant>.sharepoint.com/sites/<site>

I get this error:

Connect-PnPOnline: Unable to load shared library 'Advapi32.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libAdvapi32.dll, 1): image not found

What is "Advapi32.dll", and how can I resolve this?

My environment:
macOS 10.15.3
PowerShell 7.0.0, installed using homebrew (as described here)
SharepointPnpPowerShellOnline, installed like this: Install-Module SharePointPnPPowerShellOnline.

  • 3
    I don't think the dependent Sharepoint libraries are available for .NET Core yet. `Advapi32.dll` is a core Windows API, I believe. There is an issue on GitHub for this [here](https://github.com/SharePoint/PnP-PowerShell/issues/869). – Ash Mar 11 '20 at 10:38

1 Answers1

0

Workaround here is to use tbe device login approach, which would be

Connect-PnPOnline -PnPO365ManagementShell

And it worked like a charm for me.

This approach would ask you to use a browser to enter the code and authenticate in the browser.

Helpful context and source: https://www.erwinmcm.com/cross-platform-pnp-powershell/