Skip to content

Instantly share code, notes, and snippets.

@MatthewJDavis
Last active January 23, 2021 15:07
Show Gist options
  • Select an option

  • Save MatthewJDavis/99f0313f3e89b953e0e841aa0a8ea0c1 to your computer and use it in GitHub Desktop.

Select an option

Save MatthewJDavis/99f0313f3e89b953e0e841aa0a8ea0c1 to your computer and use it in GitHub Desktop.
Timed action with PowerShell
# Run a PowerShell command on a specific interval.
$Timer = [System.Timers.Timer]::new(3000)
Register-ObjectEvent -InputObject $Timer -EventName Elapsed -Action { Get-Item }
$Timer.Start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment