Private/Class/JobTest.ps1
using namespace System.Management.Automation class SampleJob : Job { SampleJob([string]$command) :base($command) { $this.SetJobState([JobState]::NotStarted) } [string] get_StatusMessage() { throw [System.NotImplementedException]::new() } [bool] get_HasMoreData() { return $true } [string] get_Location() { throw [System.NotImplementedException]::new() } [void] StopJob() { throw [System.NotImplementedException]::new() } [void] ProcessJob() { $this.SetJobState([JobState]::Running) Start-Sleep -Seconds 5 $this.Output.Add('Hello') $this.SetJobState([JobState]::Completed) } } |