Forum Discussion
SAURAV KUMAR
Mar 12, 2022Copper Contributor
Need to remove one drive folder using PnP Powershell
Hi Team, I'm trying to remove a folder using PnP and its throwing error as 404 Not Found, commands i am using as below Connect-PnPOnline -Url "onedrive Url" - credential (Get-Credential) $name ...
SvenSieverding
Oct 13, 2022Bronze Contributor
Are you trying to delete the folder "Document\Nest1" or "Document\Nest1\Nest1"?
This Powershell script tries to delete "Document\Nest1\Nest1"....
If you want to delete "Document\Nest1" then try
Remove-PnPFolder -Name "Nest1" -Folder "Document" - Force -Recycle
This Powershell script tries to delete "Document\Nest1\Nest1"....
If you want to delete "Document\Nest1" then try
Remove-PnPFolder -Name "Nest1" -Folder "Document" - Force -Recycle
- pk_TechDec 21, 2023Copper ContributorHi ,
I have run same command but getting the error message
Remove-PnPFolder -Name "lab_November" -Folder "Document" -Force -Recycle
Error Message: Remove-PnPFolder : The remote server returned an error: (403) Forbidden.