Feb 11 2021 10:39 AM
Feb 11 2021 10:39 AM
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.
Feb 12 2021 12:18 PM - edited Feb 12 2021 12:20 PM
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
Feb 15 2021 02:34 AM
@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!
Feb 15 2021 11:22 AM - edited Feb 15 2021 11:24 AM
It's totally possible, Check this one
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.