The Easy and fast way..
- Download AlphaFS https://github.com/alphaleonis/AlphaFS/releases
- Unpack it to some Folder
- Fireup PowerShell and Import the Modul with
Import-Module -Name 'C:\AlphaFS\AlphaFS.dll
To delete a Folder use [Alphaleonis.Win32.Filesystem.Directory]::Delete("E:\SUPERLONGPATH\",$TRUE)
for Files it is [Alphaleonis.Win32.Filesystem.File]::Delete("E:\stupidfilewithatolongpath.txt", $TRUE)