Verifying the installation of the PnP PowerShell module for SharePoint Online

To verify the installation, we can use the following PowerShell command. You can also use this command if you are new to the machine and would like to find out whether the PnP PowerShell module is already installed or not:

Get-Module SharePointPnPPowerShell* -ListAvailable | Select-Object Name,Version | Sort-Object Version -Descending

The following screenshot shows the output of the preceding command:

Once you've verified that the PnP PowerShell module for SharePoint Online is installed, we can then get started with executing the cmdlets. Since Office 365 is hosted by Microsoft, we don't have direct access to the servers SharePoint is installed on and running from. We need to use remote management.

To use the PnP PowerShell module, we need to first connect to our SharePoint Online tenant/SharePoint Online site using the following command:

Connect-PnPOnline –Url https://yoursite.sharepoint.com –Credentials (Get-Credential)

The following screenshot shows the output of the preceding command:

If your credentials are correct and the connection is successful, you will not get any error message. To get another visual confirmation, you can execute the following command:

Get-PnPSite

The following screenshot shows the output of the preceding command:

PnP PowerShell cmdlets use this pattern: <Verb>-PnP<Noun>, where PnP is Pattern and Practices. The cmdlets with *SPO* are deprecated in the June 2017 release, and you should use *PnP* instead, for example, Get-PnPSite, New-PnPTenantSite.
To view all cmdlets, we can use Get-Command -Module *PnP*. Or, go to the page https://msdn.microsoft.com/en-us/pnp_powershell/pnp-powershell-overview. To get help on a particular cmdlet, the command is Get-Help New-PnPList -Detailed.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.200.71