Closes a PowerShell gap where recursive Remove-Item deletions of directories outside the working directory were allowed whenever -Force was absent.
Fixed
- Fixed PowerShell recursive deletes being judged only when
-Recurseand-Forceappeared together, which allowedRemove-Item -Recurse <dir-outside-cwd>on the standard, strict, and paranoid levels.-Recursealone already removes a non-empty directory without a prompt, so the checks now key on-Recurseby itself, the same wayrm -rdoes. (#348)- Covers relative and absolute targets,
-Pathand-LiteralPath, and theri,del,erase,rd,rm, andrmdiraliases. The current-directory, home-directory, strict dynamic-target, and paranoid checks now apply to plain-Recurseas well. - Recursive deletes inside the working directory on standard, temp paths,
allow_pathsentries, and-WhatIfcommands stay allowed, and commands without-Recurseare unaffected. - Known limitation:
-Recurse:$falseis still read as recursive, soRemove-Item -Recurse:$false ../outside.txtis now blocked even though it does not delete recursively.
- Covers relative and absolute targets,
Changed
- Changed
Remove-Item -r -f .to be blocked as a delete of the current directory. It was previously allowed only because-fis too short to be recognized as-Force.