PowerShell 那种把一切当作对象的思路,是不是一定比 shell 先进不好说,能少写不少废话倒是真的。刚才要把一个文件夹里所有的 docx 改成 zip(因为这样可以直接把 Word 文档里面的附件拆出来),用 bash 的话我没想到不用循环怎么做,用 PowerShell 就一行 dir | rename-item -NewName {$_.name -replace ".docx", ".zip"} 就完事了

Please be advised that this post was written or last updated a while ago and may therefore contain outdated information or opinions I no longer hold.
请知悉本文自写作或上次更新已届相当时限,或包含过时信息及观点。