Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果您使用 Powershell 在彼此之间创建多个目录,是否可以一次将它们全部删除?rmdir 命令一次删除一个,但我想知道是否有更简单的方法。
谢谢!
我只是在学习通过 Powershell 编写代码,因此感谢您提供任何提示或技巧!
如果在彼此之间是指所有共享共同祖先的目录,则可以递归删除共同祖先和所有后代:
Remove-Item -Recurse -Force DirectoryToDelete
请注意,这也可以使用带有 /s 开关的 rmdir 命令来完成。