Skip to content

Commit

Permalink
Merge pull request proxb#176 from codykonior/master
Browse files Browse the repository at this point in the history
Save and restore $env:PSModulePath until we find why it's being clobbered on PS Core
  • Loading branch information
proxb authored Feb 24, 2018
2 parents 39d4520 + 85842f7 commit 83ce4ae
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions PoshRSJob/PoshRSJob.psd1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#
# PoshRSJob
# Version 1.7.4.3
# Version 1.7.4.4
#
# Boe Prox (c) 2014
# http://learn-powershell.net
Expand All @@ -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'
Expand Down
5 changes: 4 additions & 1 deletion PoshRSJob/PoshRSJob.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -319,4 +320,6 @@ $ExportModule = @{
Variable = @('PoshRS_JobId','PoshRS_Jobs','PoshRS_jobCleanup','PoshRS_RunspacePoolCleanup','PoshRS_RunspacePools')
}
Export-ModuleMember @ExportModule
#endregion Export Module Members
#endregion Export Module Members

$env:PSModulePath = $PSModulePath
2 changes: 2 additions & 0 deletions PoshRSJob/Public/Start-RSJob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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/
Expand Down
5 changes: 5 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -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|
---------
Expand Down

0 comments on commit 83ce4ae

Please sign in to comment.