Open Windows Powershell as Administrator.
Run the following
Type A when prompted.
To verify the version installed type the following:
Get-Module SharePointPnPPowerShell* -ListAvailable | Select-Object Name,Version | Sort-Object Version -Descending
Type the following to connect to your SharePoint Online Environment replacing <YourTenant> with your Tenancy alias, e.g alanlearnsstuff12345
Connect-PnPOnline –Url https://<YourTenant>.sharepoint.com –Credentials (Get-Credential)
Note: This command can fail with an error message mentioning
DTD is prohibited on this XML document. There can be many causes, (see this link) but the usual fix is to change the DNS settings to use 188.8.131.52 in some cases.
Enter your Admin Credentials when prompted.
Type Get-Command -Module *PnP* or Get-Command -Module *PnP* | Select -First 5, as I have and verify a list of commands return.