[英]How to use SharePointPnpPowerShellOnline PowerShell module in Azure DevOps?
I am failing to use the SharePointPnpPowerShellOnline PS Module as part of my release pipeline.我没有将 SharePointPnpPowerShellOnline PS 模块用作发布管道的一部分。 We are using Azure DevOps with a hosted build agent on a Azure VM.
我们将 Azure DevOps 与 Azure VM 上的托管构建代理结合使用。 I want to accomplish uploading build artifacts into Microsoft Teams/Sharepoint.
我想完成将构建工件上传到 Microsoft Teams/Sharepoint。
Connect-PnPOnline -Url https://... -Credentials ...
).Connect-PnPOnline -Url https://... -Credentials ...
)。 Error message: "Connect-PnPOnline : The term 'Connect-PnPOnline' is not recognized as the name of a cmdlet, function, script file". Shouldn't the build agent be able to find the installed module, as I installed it for its user?构建代理是否应该能够找到已安装的模块,因为我为其用户安装了它?
Edit: I did some more "debugging", namely:编辑:我做了更多的“调试”,即:
My guess is I'm doing a stupid beginner mistake because I haven't that much experience with PowerShell...我的猜测是我犯了一个愚蠢的初学者错误,因为我对 PowerShell 没有太多经验......
Answering my own question: In the end I just installed the Module again as part of the script by prepending the following two lines.回答我自己的问题:最后,我通过添加以下两行再次将模块安装为脚本的一部分。 Of course I'd be happy if somebody could explain why it didn't work the other way...
当然,如果有人能解释为什么它不能以其他方式工作,我会很高兴......
Install-PackageProvider Nuget -ForceBootstrap -Force
Install-Module -Name SharePointPnPPowerShellOnline -Force -Verbose -Scope CurrentUser
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.