Skip to content

Commit

Permalink
ApartmentState Fix
Browse files Browse the repository at this point in the history
#68 resolved
  • Loading branch information
proxb committed Apr 10, 2016
1 parent 185ee58 commit 4847a3b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 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.5.7.0
# Version 1.5.7.1
#
# Boe Prox (c) 2014
# http://learn-powershell.net
Expand All @@ -14,7 +14,7 @@
ModuleToProcess = 'PoshRSJob.psm1'

# Version number of this module.
ModuleVersion = '1.5.7.0'
ModuleVersion = '1.5.7.1'

# ID used to uniquely identify this module
GUID = '9b17fb0f-e939-4a5c-b194-3f2247452972'
Expand Down
6 changes: 5 additions & 1 deletion PoshRSJob/Public/Start-RSJob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ Function Start-RSJob {
}
}
$RunspacePool = [runspacefactory]::CreateRunspacePool($InitialSessionState)
$RunspacePool.ApartmentState = 'STA'
Try {
#ApartmentState doesn't exist in Nano Server
$RunspacePool.ApartmentState = 'STA'
}
Catch {}
[void]$RunspacePool.SetMaxRunspaces($Throttle)
If ($PSVersionTable.PSVersion.Major -gt 2) {
$RunspacePool.CleanupInterval = [timespan]::FromMinutes(2)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PoshRSJob 1.5.7.0
PoshRSJob 1.5.7.1
===================

[![Build status](https://ci.appveyor.com/api/projects/status/svrd4ho4otugki24?svg=true)](https://ci.appveyor.com/project/proxb/poshrsjob)
Expand Down
3 changes: 2 additions & 1 deletion ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---------
|1.5.7.0|
|1.5.7.1|
---------
* Fixed Issue #64 (HadErrors in PoshRS.PowerShell.RSJob throws errors in PowerShell V2)
* Fixed Issue #67 (Converted Add-Type code for C# classes to be created via Reflection for Nano server support) <- Created custom dll
* Fixed Issue #61 (Receive-RSJob not allowing -Job parameter input)
* Fixed Issue #63 (Replaced Global variables with Script scope)
* Fixed Issue #66 (Parameters don't work with PowerShell V2)
* Fixed Issue #65 (Bug with v2 variable substitution - single-quoted strings get $var references replaced)
* Fixed Issue #68 (ApartmentState Does Not Exist in Nano)

0 comments on commit 4847a3b

Please sign in to comment.