2,187
edits
(Initial creation - content from PowerShell Examples page) |
(Typo fix) |
||
Line 1: | Line 1: | ||
This script run's a function at a specific interval throughout the day. The script runs as a continuous task and is a simple scheduling engine. | |||
<source lang="powershell"> | <source lang="powershell"> | ||
$start = Get-Date | $start = Get-Date | ||
Line 23: | Line 23: | ||
function Log-Perf { | function Log-Perf { | ||
# Keeps track of script resource usage | # Keeps track of script resource usage | ||
Log ("Perf CPU(sec): " + [Math]::Round($proc.cpu, 0) + ", Paged Mem (MB): " + [Math]::Round(($proc.pm/1024), 0) + ", WrkSet Mem (MB): " + Math]::Round(($proc.ws/1024), 0)) | Log ("Perf CPU(sec): " + [Math]::Round($proc.cpu, 0) + ", Paged Mem (MB): " + [Math]::Round(($proc.pm/1024), 0) + ", WrkSet Mem (MB): " + [Math]::Round(($proc.ws/1024), 0)) | ||
} | } | ||