Files
linux-workspace/bin/mosh-clean.ps1
2020-11-06 06:58:49 +01:00

11 lines
183 B
PowerShell
Executable File

#!/usr/bin/env pwsh
$days = 5
$to_delete = ps *mosh-server* | ? { $_.RunTime -gt (New-TimeSpan -Days $days) }
foreach ($proc in $to_delete) {
$proc | fl Id,RunTime
kill $proc
}