Reputation: 175
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.
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". So it behaves as if the module is not installed at all.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
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