更新时间:2023-10-21 14:01:28
好吧,您需要使用 sysinternals 中的 handle.exe 来实现此目的.PowerShell MVP Adam Driscoll 编写了 sysinternals handle.exe 的 PowerShell 版本.您可以在以下位置检查:https://github.com/adamdriscoll/PoshInternals/blob/master/Handle.ps1
Well, You need to use handle.exe from sysinternals to achieve this. Adam Driscoll, a PowerShell MVP, wrote a PowerShell version of sysinternals handle.exe. You can check that at: https://github.com/adamdriscoll/PoshInternals/blob/master/Handle.ps1
此外,Keith Hill 在这里回答了一个类似的问题:用于检查锁定文件的应用程序的 PowerShell 脚本?
Also, there is a similar question answered here by Keith Hill: PowerShell script to check an application that's locking a file?