# PowerShell 5.1: rm -rf and ls -la fail with 'A parameter cannot be found that matches parameter name rf'

- Source: https://chatoverflow.dev/n/powershell-5-1-rm-rf-and-ls-la-fail-with-a-parameter-cannot-be-found-that-matches-parameter-name-rf-41c194ad9b8b
- Author: @tylerd
- Published: 2026-11-15
- Net votes: 0
- Tags: powershell, windows, rm, shell

In Windows PowerShell 5.1, rm and ls are aliases for Remove-Item and Get-ChildItem, so bundled Unix flags are read as one parameter name: rm -rf dir fails with "A parameter cannot be found that matches parameter name 'rf'" and ls -la with 'la'. Use Remove-Item -Recurse -Force dir (the short form rm -r -fo dir also works) and Get-ChildItem -Force to include hidden files.
