Guest User

Untitled

a guest
Mar 28th, 2018
339
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Param(
  2.     [string]$searchPath,
  3.     [int]$daysToScan
  4. )
  5. $returnCode = Get-ChildItem -Recurse -Path $searchPath | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-$daysToScan)} | Measure-Object | %{$_.Count}
  6. Write-Host "<prtg>"
  7. Write-Host "<result>"
  8. Write-Host "<channel>ReturnCode</channel>"
  9. Write-Host "<value>" $returnCode "</value>"
  10. Write-Host "</result>"
  11. Write-Host "</prtg>"
RAW Paste Data