早晨,
我想问题就在标题里。我有一个脚本,它通过导入 CSV 的文件夹结构运行,与每个脚本一起工作,然后在完成后尝试删除它们。
遗憾的是,其中很多都锁定在 PowerShell 上,而我删除它们的唯一方法就是关闭 PS。
有什么方法可以卸载csv吗?
我在这里找到了另一个建议 $IMPORT.dispose() 的帖子,但我得到的是:
Method invocation failed because [System.Management.Automation.PSCustomObject] does not contain a method named 'Dispose'.
任何帮助,将不胜感激。
谢谢
@beatcracker
我想不出还有什么可以锁定它们,它们是通过登录脚本生成的,并且不会由 PowerShell 以外的任何其他东西打开。
这是我得到的,不确定我的上下文是否正确?
Write-Host $(& 'handle.exe' '\\fileshare\CDRIVE\user1\user1SEARCH.csv' )
www.sysinternals.com No matching handles found.
Move-Item '\\fileshare\CDRIVE\user1\user1SEARCH.csv' "$PST_PARENT\"
Move-Item : The process cannot access the file because it is being used by another process.
At line:1 char:1 + Move-Item '\\fileshare\CDRIVE\user1\user1SEARCH.csv...
@VinceG
$IMPORT_TOTAL_CSV = Import-Csv "$PST_PARENT\DailyReports\1) DiscoveryCollective\Search Report Total.csv"
$ALL_CSV | foreach { $IMPORT_EACH_CSV = Import-Csv $_ }
@alroc
抱歉,仍在习惯 StackOverFlow
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)