How do you load the PowerShell OfficeP PnP module for SharePoint?
Addendum: I've added a try/catch block to the code. This way you can be sure the module is loaded.
# Loading Office Online PnP Module
try {
if((Get-Module "Microsoft.Online.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
Import-Module Microsoft.Online.SharePoint.PowerShell
Write-Host "PowerShell module Microsoft.Online.SharePoint.PowerShell initialized"
}
else {
Write-Host "PowerShell module Microsoft.Online.SharePoint.PowerShell loaded"
}
}
catch {
throw "PowerShell module Microsoft.Online.SharePoint.PowerShell initialization failed"
exit 3
}