【发布时间】:2014-02-18 03:41:05
【问题描述】:
我有这个脚本...
查看给定的网络位置,然后遍历所有文件夹/子文件夹以搜索特定的单词/短语。希望修改以能够对 ZIP 文件执行相同的操作。以相同的方式工作,报告包含所列出的单词的所有 ZIP 文件以及 ZIP 中的任何文件...
有什么帮助吗?
"`n"
write-Host "Search Running" -ForegroundColor Red
$filePath = "\\fileserver\mydepts\IT"
"`n"
Get-ChildItem -Recurse -Force $filePath -ErrorAction SilentlyContinue | Where-Object { ($_.PSIsContainer -eq $false) -and ( $_.Name -like "*test*" -or $_.Name -like "*bingo*" -or $_.Name -like "*false*" -or $_.Name -like "*one two*" -or $_.Name -like "*england*") } | Select-Object Name,Directory,CreationTime,LastAccessTime,LastWriteTime | Export-Csv "C:\scripts\searches\csv\results.csv" -notype
write-Host "------------END of Result--------------------" -ForegroundColor Green
【问题讨论】:
标签: powershell scripting