We are running PnP PowerShell scripts against SharePoint Online and have had a snag with some of the cmdlets from the PnP library where some of them are not being found (as if they have been removed for the library or it's accessing a previous library than what's listed).
Here's code up to the error:
Connect-PnPOnline -Url $NewSite -Credentials $Credentials ### Works Add-PnPSiteCollectionAdmin -Owners @($Owner1, $Owner2) ### Works Remove-PnPPage -Identity "Home" -Recycle -Force ### Errors Out (below) Add-PnPPage -Name "NewHomePage"
The strange error from Remove-PnPPage (Add-PnPPage will throw same error):
Error: The term 'Remove-PnPPage' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
I checked the version we have using Get-Module SharePointPnPPowerShell... and lists only one version, the latest (as of this post).
PS C:\WINDOWS\system32> Get-Module SharePointPnPPowerShell* -ListAvailable | Select-Object Name,Version | Sort-Object Version -Descending Name Version ---- ------- SharePointPnPPowerShellOnline 3.29.2101.0
I have Uninstalled the SharePointPnpPowerShellOnline module and then reinstalled it without any luck of working. Any ideas are welcome!