From c21bd8f4f803088d676499eac089c9d82f0f6677 Mon Sep 17 00:00:00 2001 From: Boe Prox Date: Mon, 29 Aug 2016 20:26:01 -0500 Subject: [PATCH] Bugfix Fixes #87 --- PoshRSJob/PoshRSJob.psd1 | 4 ++-- PoshRSJob/Public/Stop-RSJob.ps1 | 16 +++++++++------- README.md | 6 +++--- ReleaseNotes.md | 5 +++++ 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/PoshRSJob/PoshRSJob.psd1 b/PoshRSJob/PoshRSJob.psd1 index 5039a68..a69855b 100644 --- a/PoshRSJob/PoshRSJob.psd1 +++ b/PoshRSJob/PoshRSJob.psd1 @@ -1,7 +1,7 @@  # # PoshRSJob -# Version 1.7.2.2 +# Version 1.7.2.3 # # Boe Prox (c) 2014 # http://learn-powershell.net @@ -14,7 +14,7 @@ ModuleToProcess = 'PoshRSJob.psm1' # Version number of this module. -ModuleVersion = '1.7.2.2' +ModuleVersion = '1.7.2.3' # ID used to uniquely identify this module GUID = '9b17fb0f-e939-4a5c-b194-3f2247452972' diff --git a/PoshRSJob/Public/Stop-RSJob.ps1 b/PoshRSJob/Public/Stop-RSJob.ps1 index dc87952..f058838 100644 --- a/PoshRSJob/Public/Stop-RSJob.ps1 +++ b/PoshRSJob/Public/Stop-RSJob.ps1 @@ -126,14 +126,16 @@ Function Stop-RSJob { } Else { $ToStop = $List } - [System.Threading.Monitor]::Enter($PoshRS_jobs.syncroot) - $ToStop | ForEach { - Write-Verbose "Stopping $($_.InstanceId)" - if ($_.State -ne 'Completed') { - Write-Verbose "Killing job $($_.InstanceId)" - [void] $_.InnerJob.Stop() + If ($ToStop) { + [System.Threading.Monitor]::Enter($PoshRS_jobs.syncroot) + $ToStop | ForEach { + Write-Verbose "Stopping $($_.InstanceId)" + if ($_.State -ne 'Completed') { + Write-Verbose "Killing job $($_.InstanceId)" + [void] $_.InnerJob.Stop() + } } + [System.Threading.Monitor]::Exit($PoshRS_jobs.syncroot) } - [System.Threading.Monitor]::Exit($PoshRS_jobs.syncroot) } } diff --git a/README.md b/README.md index bf8f46a..d949152 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -PoshRSJob 1.7.2.2 +PoshRSJob 1.7.2.3 =================== [![Build status](https://ci.appveyor.com/api/projects/status/svrd4ho4otugki24?svg=true)](https://ci.appveyor.com/project/proxb/poshrsjob) [![Join the chat at https://gitter.im/proxb/PoshRSJob](https://badges.gitter.im/proxb/PoshRSJob.svg)](https://gitter.im/proxb/PoshRSJob?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) @@ -10,8 +10,8 @@ Provides an alternative to PSjobs with greater performance and less overhead to Install-Module -Name PoshRSJob ``` -####Download the latest release (1.7.2.0) -https://github.com/proxb/PoshRSJob/releases/download/1.7.2.0/PoshRSJob.zip +####Download the latest release (1.7.2.3) +https://github.com/proxb/PoshRSJob/releases/download/1.7.2.3/PoshRSJob.zip More information and examples here: http://learn-powershell.net/2015/04/19/latest-updates-to-poshrsjob/ diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 82cc8a5..83ac16e 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,3 +1,8 @@ +--------- +|1.7.2.3| +--------- +* Fixed Issue #87 (Stop-RSJob gives an error if it has no input) + --------- |1.7.2.2| ---------