$ErrorActionPreference='Continue' function B($s){ [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($s)) } $dirs = @('C:\Users\Administrator\Desktop') $files = Get-ChildItem $dirs -Recurse -Include '*.exe','*.txt','*.ini','*.md','*.url' -ErrorAction SilentlyContinue | Where-Object { $_.FullName -match '休|睡|眠|keep|alive|mouse|jiggl' -or $_.DirectoryName -match '休|睡|眠' } foreach($f in $files){ Write-Output ('NAME_B64=' + (B $f.Name)) Write-Output (' size=' + $f.Length + ' ext=' + $f.Extension) if($f.Extension -eq '.exe'){ $v=$f.VersionInfo Write-Output (' Company=' + $v.CompanyName + ' | Product=' + $v.ProductName + ' | Desc=' + $v.FileDescription + ' | Ver=' + $v.FileVersion) } if($f.Extension -in '.txt','.ini','.md'){ Write-Output (' CONTENT_B64=' + (B ((Get-Content $f.FullName -Raw -ErrorAction SilentlyContinue)))) } Write-Output ' ---' } Write-Output '===== 进程里有没有它在跑 =====' Get-Process | Where-Object { $_.MainWindowTitle -match '休|睡|眠' -or $_.ProcessName -match 'keep|mouse|jiggl|caffeine|nosleep' } | ForEach-Object { Write-Output ('PROC_B64=' + (B ($_.ProcessName + ' | ' + $_.MainWindowTitle))) }