Connect-PnPOnline problem after installing PnP.Powershell

%3CLINGO-SUB%20id%3D%22lingo-sub-2122177%22%20slang%3D%22en-US%22%3EConnect-PnPOnline%20problem%20after%20installing%20PnP.Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2122177%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20afraid%20this%20question%20lays%20bare%20a%20pretty%20huge%20gap%20in%20my%20PowerShell%20knowledge%2C%20so%20be%20gentle.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20keen%20to%20start%20using%20the%20PnP%20commands%20for%20managing%20Teams%2C%20so%20Get-PnPTeamsTeam%20etc.%20I%20already%20have%26nbsp%3BSharePointPnPPowerShellOnline%20module%20installed%20and%20I%20use%20it%20occasionally%20with%20various%20scripts%20I%20have.%20However%2C%20to%20use%20Get-PnPTeamsTeam%20(for%20example)%20it%20appears%20I%20need%20to%20install%20PnP.Powershell.%20So%20I%20installed%20the%20module%2C%20was%20told%20it%20already%20had%20lots%20of%20commands%20already%20downloaded%20(by%20SharePointPnP%20I%20assume)%20and%20I%20should%20use%20-AllowClobber%20to%20continue.%20So%20I%20-AllowClobber%20and%20now%20PnP.Powershell%20installs.%20However%2C%20the%20Connect%20command%20I%20was%20using%20Connect-PnPOnline%20-Scopes%20%22stuff%22%20-Credentials%20%24creds%20no%20longer%20works%2C%20and%20when%20I%20use%20type%20ahead%20I%20can%20see%20-Scopes%20is%20no%20longer%20an%20option%20with%20Connect-PnPOnline.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo...%20my%20question%20is%2C%20what%20I%20am%20doing%20that%20is%20stupid%3F%20I%20watched%20a%20video%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DvMnehvDQ7Ts%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DvMnehvDQ7Ts%3C%2FA%3E%20-%20where%20Guru%20Erwin%20connects%20to%20PnP%20using%20-Scopes%20and%20then%20runs%20various%20PnPTeams%20commands.%20So%20I%20know%20it%20can%20be%20done.%20What%20am%20I%20missing%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20use%20PowerShell%20ISE%2C%20badly.%20Any%20help%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPaul%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2122177%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2129721%22%20slang%3D%22en-US%22%3ERe%3A%20Connect-PnPOnline%20problem%20after%20installing%20PnP.Powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2129721%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F30476%22%20target%3D%22_blank%22%3E%40Paul%20Chapman%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%3C%2FP%3E%3CP%3EThese%20commands%20can%20be%20changed%20and%20update.%3C%2FP%3E%3CP%3Ethe%20easy%20way%20to%20see%20what%20are%20the%20command%20supported%20by%20your%20version%20is%20using%20Help%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3Ehelp%20Connect-PnPOnline%20-Examples%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EYou%20will%20see%20the%20different%20method%20and%20way%20to%20connect.%3C%2FP%3E%3CP%3EHope%20this%20help%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E----------------%3C%2FP%3E%3CP%3EIf%20this%20answer%20help%2C%20please%20mark%20it%20as%20Best%20Response%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

Hi,

 

I'm afraid this question lays bare a pretty huge gap in my PowerShell knowledge, so be gentle.

 

I'm keen to start using the PnP commands for managing Teams, so Get-PnPTeamsTeam etc. I already have SharePointPnPPowerShellOnline module installed and I use it occasionally with various scripts I have. However, to use Get-PnPTeamsTeam (for example) it appears I need to install PnP.Powershell. So I installed the module, was told it already had lots of commands already downloaded (by SharePointPnP I assume) and I should use -AllowClobber to continue. So I -AllowClobber and now PnP.Powershell installs. However, the Connect command I was using Connect-PnPOnline -Scopes "stuff" -Credentials $creds no longer works, and when I use type ahead I can see -Scopes is no longer an option with Connect-PnPOnline.

 

So... my question is, what I am doing that is stupid? I watched a video - https://www.youtube.com/watch?v=vMnehvDQ7Ts - where Guru Erwin connects to PnP using -Scopes and then runs various PnPTeams commands. So I know it can be done. What am I missing?

 

I use PowerShell ISE, badly. Any help appreciated.

 

Paul

 

In this 12-minute Developer focused demo, Erwin van Hunen - shows several cmdlets for Microsoft Teams that are included with PnP PowerShell. Erwin steps thr...
3 Replies

@Paul Chapman 

Hi

These commands can be changed and update.

the easy way to see what are the command supported by your version is using Help

 

 

help Connect-PnPOnline -Examples

 

You will see the different methods and ways to connect.

Connect-PnPOnline -Url "https://contoso.sharepoint.com" -Credentials (Get-Credential)

Hope this help

 

 

----------------

If this answer help, please mark it as Best Response 

@farismalaeb Thanks Faris. I'm a big fan of the -examples tag :)

 

In this case it looks like the module I had installed first (SharePointPnPPowerShell) has been superceded by an updated module (PnP.Powershell). I've uninstalled the earlier module, and now in the new module (PnP.Powershell) I no longer see a -scopes option. So I am working on the assumption that the video I watched (and referenced in my first post) was using an earlier version of PnP.Powershell that still had a -scopes option. But that may be wrong!

@Paul Chapman 

It's totally possible, Check this one

https://www.powershellgallery.com/packages?q=PnP.PowerShell

This link is for the PSGallary which includes all the previous versions of PnP.Powershell, you can try the old version, which is not a recommended thing to do.

I guess you need to tune the connection to be able to connect using the available parameters.

 

 

-------------

If the answer was helpful, Please click on Best Response.