如何修改執行此 ps 腳本的結果:
(Get-ChildItem -Path E:\Logs\Application -Filter "*Log*" -Recurse -Directory).Fullname
連接\*.log到每個,像這樣:
E:\Logs\application\Service1\logs\*.log
E:\Logs\application\Service2\logs\*.log
E:\Logs\application\Service3\logs\*.log
謝謝
uj5u.com熱心網友回復:
您可以使用Join-Pathcmdlet:
$directories = Get-ChildItem -Path E:\Logs\Application -Filter "*Log*" -Recurse -Directory
$logGlobPaths = $directories |Join-Path -Path {$_.FullName} -ChildPath '*.log'
$logGlobPaths 現在包含所需字串的陣列
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/338511.html
標籤:电源外壳
