【发布时间】:2020-12-24 00:24:48
【问题描述】:
我对powershell很陌生,几乎所有东西都是从其他地方复制过来的,所以请多多包涵。
这是我目前所拥有的(它无法正常工作):
Get-ChildItem -Path "D:\" -Recurse -Filter *.log |
Split-Path -Parent |
%{ Write-Host $_.FullName (dir $_.FullName | Measure-Object).Count }
基本上我要做的是找出 *.log 文件可能在驱动器中的位置。由于我一次将其应用于许多主机,因此我想要这些文件的摘要。
我得到了什么:
D:\Game Files\appdata\BlackCipher\BlackCall.log
D:\Game Files\appdata\BlackCipher\BlackCipher.log
D:\Game Files\appdata\BlackCipher\BlackXchg.log
D:\Game Files\appdata\BlackCipher\NGClient.log
D:\Game Files\Counter-Strike Source\debug.log
D:\Game Files\Games\Furi\2016-07-08_164326\error.log
D:\Game Files\Hearthstone\bnet_client.log
D:\Game Files\Hearthstone\2014-01-06_155616\error.log
D:\Game Files\Hearthstone\2014-02-02_201924\error.log
D:\Game Files\Hearthstone\2014-02-02_201946\error.log
D:\Game Files\Hearthstone\2014-02-02_222450\error.log
D:\Game Files\Hearthstone\2015-06-24_082024\error.log
D:\Game Files\Hearthstone\2015-07-06_174250\error.log
D:\Game Files\Hearthstone\2015-07-25_180738\error.log
D:\Game Files\Hearthstone\2015-10-19_160134\error.log
D:\Game Files\Hearthstone\2016-07-13_164124\error.log
D:\Game Files\Hearthstone\2016-12-19_021056\error.log
D:\Game Files\Hearthstone\2017-08-27_132304\error.log
我想要什么:
D:\Game Files\appdata\BlackCipher 4
D:\Game Files\Counter-Strike Source 1
D:\Game Files\Games\Furi\2016-07-08_164326 1
D:\Game Files\Hearthstone\ 12
【问题讨论】:
标签: powershell file logging find