Skip to content
Browse files

Added Unregister-ScheduledJob

  • Loading branch information...
1 parent 8ad9ec0 commit 42da50dd8569298f35e8ef4f5e4912116ba740da @dfinke committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 chapter11/StartScheduledJobIn.ps1
View
6 chapter11/StartScheduledJobIn.ps1
@@ -16,5 +16,7 @@ function Start-ScheduledJobIn {
}
cls
-ipmo PSScheduledJob -Force
-Start-ScheduledJobIn TestGetService 5 {Get-Service}
+
+$JobName = "TestGetServiceJob"
+Get-ScheduledJob -Name $JobName -ea 0 | Unregister-ScheduledJob
+Start-ScheduledJobIn $JobName 5 {Get-Service}

0 comments on commit 42da50d

Please sign in to comment.
Something went wrong with that request. Please try again.