Will delete all worktrees given as first argument. This can either be a simple string or an array as given in the example to delete multiple worktrees.
Note that due to path limitations in Microsoft Windows Remove-Item
might fail for too deep paths.
- windows - How to delete directories with path/names too long for normal delete - Super User
- powershell - Delete directory regardless of 260 char limit - Stack Overflow
- A Sysadmin • Powershell: Path length limitation
- Topic: Remove-Item: the specified path, file name are too long
- Perhaps a workaround is to use
Get-ChildItem
as mentioned here: How to quietly remove a directory with content in PowerShell - Stack Overflow