macOS PowerShell Connect PnPOnline因advapi32.dll而失败



当我尝试运行以下命令时:

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

我得到这个错误:

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

什么是"Advapi32.dll",如何解决此问题?

我的环境:
macOS 10.15.3
PowerShell 7.0.0,使用自制程序安装(如此处所述(
SharepointPnpPowerShellOnline,安装方式如下:Install-Module SharePointPnPPowerShellOnline

这里的解决方案是使用设备登录方法,即

Connect-PnPOnline -PnPO365ManagementShell

它对我来说就像一种魅力。

这种方法要求您使用浏览器输入代码并在浏览器中进行身份验证。

有用的上下文和来源:https://www.erwinmcm.com/cross-platform-pnp-powershell/

最新更新