Skip to content

Commit 4d54c85

Browse files
author
Staffan Gustafsson
committed
Minor bugfixes
1 parent b744107 commit 4d54c85

File tree

7 files changed

+38
-43
lines changed

7 files changed

+38
-43
lines changed

module/PSParallel.psd1

0 Bytes
Binary file not shown.

scripts/Install.ps1

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,32 @@ if ('' -eq $InstallDirectory)
1818
$InstallDirectory = Join-Path -Path $personalModules -ChildPath PSParallel
1919
}
2020

21-
if (!(Test-Path $InstallDirectory))
21+
if(-not (Test-Path $InstallDirectory))
2222
{
23-
$null = mkdir $InstallDirectory
23+
$null = mkdir $InstallDirectory
2424
}
2525

26-
27-
$moduleFileList = @(
28-
'PSParallel.psd1'
29-
)
30-
$binaryFileList = 'src\PsParallel\bin\Release\PSParallel.dll'
31-
$localizations = @{
32-
'en-us' = @(
33-
'PSParallel.dll-Help.xml'
34-
'about_PSParallel.Help.txt'
35-
)
36-
}
37-
38-
foreach($kv in $localizations.GetEnumerator())
39-
{
40-
$lang = $kv.Name
41-
if(-not (Test-Path $InstallDirectory\$lang))
42-
{
43-
$null = MkDir $InstallDirectory\$lang
44-
}
45-
foreach($v in $kv.Value){
46-
$locPath = Join-Path $lang $v
47-
Copy-Item $rootDir\module\$locPath -Destination $InstallDirectory\$locPath
48-
}
26+
@(
27+
'module\PSParallel.psd1'
28+
'src\PsParallel\bin\Release\PSParallel.dll'
29+
).Foreach{Copy-Item "$rootdir\$_" -Destination $InstallDirectory }
30+
31+
$lang = @('en-us')
32+
33+
$lang.Foreach{
34+
$lang = $_
35+
$langDir = "$InstallDirectory\$lang"
36+
if(-not (Test-Path $langDir))
37+
{
38+
$null = MkDir $langDir
39+
}
40+
41+
@(
42+
'PSParallel.dll-Help.xml'
43+
'about_PSParallel.Help.txt'
44+
).Foreach{Copy-Item "$rootDir\module\$lang\$_" -Destination $langDir}
4945
}
5046

51-
$binaryFileList | foreach { Copy-Item "$rootDir\$_" -Destination $InstallDirectory }
52-
$moduleFileList | foreach {Copy-Item "$rootdir\module\$_" -Destination $InstallDirectory\$_ }
53-
5447
Get-ChildItem -Recurse -Path $InstallDirectory
5548

5649
$cert = Get-Item Cert:\CurrentUser\My\98D6087848D1213F20149ADFE698473429A9B15D

scripts/Publish-ToGallery.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $p = @{
44
LicenseUri = "https://github.com/powercode/PSParallel/blob/master/LICENSE"
55
IconUri = "https://github.com/powercode/PSParallel/blob/master/images/PSParallel_icon.png"
66
Tag = "Parallel","Runspace","Invoke","Foreach"
7-
ReleaseNote = "Adding argumentcompleter"
7+
ReleaseNote = "Minor bugfixes"
88
ProjectUri = "https://github.com/powercode/PSParallel"
99
}
1010

src/PSParallel/ImportArgumentCompleter.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,23 @@ namespace PSParallel
99
{
1010
public class ImportArgumentCompleter : IArgumentCompleter
1111
{
12-
private static readonly CompletionResult[] EmptyCompletion = new CompletionResult[0];
13-
12+
private static readonly CompletionResult[] EmptyCompletion = new CompletionResult[0];
13+
1414
public IEnumerable<CompletionResult> CompleteArgument(string commandName, string parameterName, string wordToComplete,
1515
CommandAst commandAst, IDictionary fakeBoundParameters)
1616
{
17-
var fakeParam = fakeBoundParameters[parameterName];
1817
var paramList = new List<string>();
19-
if (fakeParam.GetType().IsArray)
20-
{
21-
paramList.AddRange(from i in (object[]) fakeParam select i.ToString());
22-
}
23-
else
24-
{
25-
paramList.Add(fakeParam.ToString());
18+
var fakeParam = fakeBoundParameters[parameterName];
19+
if(fakeParam != null)
20+
{
21+
if (fakeParam.GetType().IsArray)
22+
{
23+
paramList.AddRange(from i in (object[]) fakeParam select i.ToString());
24+
}
25+
else
26+
{
27+
paramList.Add(fakeParam.ToString());
28+
}
2629
}
2730
using (var powerShell = PowerShell.Create(RunspaceMode.CurrentRunspace))
2831
{

src/PSParallel/InvokeParallelCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ protected override void EndProcessing()
236236
protected override void StopProcessing()
237237
{
238238
m_cancelationTokenSource.Cancel();
239-
m_powershellPool.Stop();
239+
m_powershellPool?.Stop();
240240
}
241241

242242
private void WriteOutputs()

src/PSParallel/PowershellPool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void Dispose()
8888
{
8989
Streams.Dispose();
9090
m_availablePoolMembers.Dispose();
91-
m_runspacePool.Dispose();
91+
m_runspacePool?.Dispose();
9292
}
9393

9494
public void ReportAvailable(PowerShellPoolMember poolmember)

src/PSParallel/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
// General Information about an assembly is controlled through the following
@@ -33,4 +32,4 @@
3332
// by using the '*' as shown below:
3433
// [assembly: AssemblyVersion("1.0.*")]
3534
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
35+
[assembly: AssemblyFileVersion("2.1.3.0")]

0 commit comments

Comments
 (0)