From 7be912ff98a6e9fb34d60a8782ba7747c8c6f8ff Mon Sep 17 00:00:00 2001 From: Cody Konior Date: Sun, 25 Feb 2018 00:06:58 +0800 Subject: [PATCH 1/2] #175 Save and restore $env:PSModulePath until we find why it's being clobbered on PS Core --- PoshRSJob/PoshRSJob.psd1 | 4 ++-- PoshRSJob/PoshRSJob.psm1 | 5 ++++- README.md | 6 +++--- ReleaseNotes.md | 5 +++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/PoshRSJob/PoshRSJob.psd1 b/PoshRSJob/PoshRSJob.psd1 index 5a5b660..7e62a70 100644 --- a/PoshRSJob/PoshRSJob.psd1 +++ b/PoshRSJob/PoshRSJob.psd1 @@ -1,7 +1,7 @@  # # PoshRSJob -# Version 1.7.4.3 +# Version 1.7.4.4 # # Boe Prox (c) 2014 # http://learn-powershell.net @@ -14,7 +14,7 @@ ModuleToProcess = 'PoshRSJob.psm1' # Version number of this module. -ModuleVersion = '1.7.4.3' +ModuleVersion = '1.7.4.4' # ID used to uniquely identify this module GUID = '9b17fb0f-e939-4a5c-b194-3f2247452972' diff --git a/PoshRSJob/PoshRSJob.psm1 b/PoshRSJob/PoshRSJob.psm1 index fbbc174..a719c26 100644 --- a/PoshRSJob/PoshRSJob.psm1 +++ b/PoshRSJob/PoshRSJob.psm1 @@ -115,6 +115,7 @@ New-Variable PoshRS_RunspacePoolCleanup -Value ([hashtable]::Synchronized(@{})) Write-Verbose "Creating routine to monitor RS jobs" $PoshRS_jobCleanup.Flag=$True $PoshRS_jobCleanup.Host = $Host +$PSModulePath = $env:PSModulePath $PoshRS_jobCleanup.Runspace =[runspacefactory]::CreateRunspace() $PoshRS_jobCleanup.Runspace.Open() $PoshRS_jobCleanup.Runspace.SessionStateProxy.SetVariable("PoshRS_jobCleanup",$PoshRS_jobCleanup) @@ -319,4 +320,6 @@ $ExportModule = @{ Variable = @('PoshRS_JobId','PoshRS_Jobs','PoshRS_jobCleanup','PoshRS_RunspacePoolCleanup','PoshRS_RunspacePools') } Export-ModuleMember @ExportModule -#endregion Export Module Members \ No newline at end of file +#endregion Export Module Members + +$env:PSModulePath = $PSModulePath diff --git a/README.md b/README.md index dadd9e8..9357712 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -PoshRSJob 1.7.4.3 +PoshRSJob 1.7.4.4 [![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) @@ -11,8 +11,8 @@ Provides an alternative to PSjobs with greater performance and less overhead to Install-Module -Name PoshRSJob ``` -#### Download the latest release (1.7.4.3) -https://github.com/proxb/PoshRSJob/releases/download/1.7.4.3/PoshRSJob.zip +#### Download the latest release (1.7.4.4) +https://github.com/proxb/PoshRSJob/releases/download/1.7.4.4/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 7df1eca..836d0a4 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,3 +1,8 @@ +--------- +|1.7.4.4| +--------- +* #175 Save and restore $env:PSModulePath until we find why it's being clobbered on PS Core + --------- |1.7.4.3| --------- From 85842f714463e9b8a5fbc28d9b32f6c38c2f5081 Mon Sep 17 00:00:00 2001 From: Cody Konior Date: Sun, 25 Feb 2018 00:17:16 +0800 Subject: [PATCH 2/2] #175 Save and restore $env:PSModulePath until we find why it's being clobbered on PS Core --- PoshRSJob/Public/Start-RSJob.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PoshRSJob/Public/Start-RSJob.ps1 b/PoshRSJob/Public/Start-RSJob.ps1 index 558b4f7..336a1e6 100644 --- a/PoshRSJob/Public/Start-RSJob.ps1 +++ b/PoshRSJob/Public/Start-RSJob.ps1 @@ -511,6 +511,7 @@ Function Start-RSJob { Else { Write-Verbose "Creating new runspacepool <$Batch>" $RunspacePoolID = $Batch + $PSModulePath = $env:PSModulePath $RunspacePool = [runspacefactory]::CreateRunspacePool($InitialSessionState) If ($RunspacePool.psobject.Properties["ApartmentState"]) { #ApartmentState doesn't exist in Nano Server @@ -530,6 +531,7 @@ Function Start-RSJob { #[System.Threading.Monitor]::Enter($PoshRS_RunspacePools.syncroot) #Temp add [void]$PoshRS_RunspacePools.Add($RSPObject) + $env:PSModulePath = $PSModulePath } } finally {