xxxxxxxxxx
Remove-Item -LiteralPath "foldertodelete" -Force -Recurse
xxxxxxxxxx
# Get the path of the folder you want to remove
$folderPath = "C:\path\to\folder"
# Check if the folder exists
if (Test-Path $folderPath) {
# Remove the folder recursively
Remove-Item -Path $folderPath -Recurse -Force
Write-Host "Folder removed successfully."
} else {
Write-Host "Folder does not exist."
}
xxxxxxxxxx
// to delete a folder or file with windows powershell
Remove-Item <folder-name> or <file-name>
Remove-Item Test-Folder or Test.txt