I am trying to delete a folder with subfolders/files.
Remove-Item -Force -Recurse -Path $directoryPath
I am getting the error Cannot remove item. The directory is not empty.
My PowershellScript.ps1 has executionPolicy unrestricted. The root folder I try to delete with the current logged in user has full permission on this folder.
On my local pc the code works but not on my Windows Server 2012 R2
.