Michael Kreich
Michael Kreich

Reputation: 175

How to use SharePointPnpPowerShellOnline PowerShell module in Azure DevOps?

I am failing to use the SharePointPnpPowerShellOnline PS Module as part of my release pipeline. We are using Azure DevOps with a hosted build agent on a Azure VM. I want to accomplish uploading build artifacts into Microsoft Teams/Sharepoint.

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...

Upvotes: 1

Views: 2170

Answers (1)

Michael Kreich
Michael Kreich

Reputation: 175

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

Upvotes: 1

Related Questions