Install-Module PnP.PowerShell
Once the PnP PowerShell Module is installed successfully, we need to run the below command to register Azure AD Application and Grant Access to the Office 365 tenant by Accepting the Consent on behalf of your organization.
Register-PnPManagementShellAccess
While migration to SharePoint Online, from SharePoint 2007, 2010 & 2013 versions, there is a chance to copy over the lists and Libraries created by "This system library was created by the Publishing feature" where you don't see option to delete those lists or libraries.
We can achieve that by using the below Powershell Script.
In the below PowerShell Script, we targeted Form Templates Library technically called as FormServerTemplates.
#Parameters
$SiteURL
=
"https://gurram.sharepoint.com/sites/pro"
$ListName
=
"FormServerTemplates"
#Connect to PnP Online
Connect-PnPOnline
-Url
$SiteURL
-Interactive
#Get the List
$List
=
Get-PnPList
-Identity
$ListName
#Enable Delete option for the list
$List
.AllowDeletion =
$True
$List
.Update()
Invoke-PnPQuery
No comments:
Post a Comment