The PowerShell command to remove an entire directory and its contents ( including sub folders and files) is below

rm -Rf pathToDirectoryToBeRemoved/

R flag denotes to run “rm” command recursively . “f” flag denotes to run in forcefully. We can even replace “f” with “v” for verbose mode and “i” for interactive mode.

Note: Above command can also be used to delete files which have long path ( more than 260 characters)