Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ondemand publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:

- name: Publish to Gallery
shell: pwsh
run: .\publish.ps1
run: .\publish.ps1 PSParallelPipeline
env:
PSGALLERY_TOKEN: ${{ secrets.PSGALLERY_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:

- name: Publish to Gallery
shell: pwsh
run: .\publish.ps1
run: .\publish.ps1 PSParallelPipeline
env:
PSGALLERY_TOKEN: ${{ secrets.PSGALLERY_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PSParallelPipeline.psm1'

# Version number of this module.
ModuleVersion = '1.0.1'
ModuleVersion = '1.0.2'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ function Invoke-Parallel {

$usingParams = @{}

# Credits to mklement0 for catching up a bug here. Thank you!
# https://github.com/mklement0
foreach($usingstatement in $ScriptBlock.Ast.FindAll({ $args[0] -is [UsingExpressionAst] }, $true)) {
$varText = $usingstatement.Extent.Text
$varPath = $usingstatement.SubExpression.VariablePath.UserPath

# Credits to mklement0 for catching up a bug here. Thank you!
# https://github.com/mklement0
$key = [Convert]::ToBase64String([Encoding]::Unicode.GetBytes($varText))
$key = [Convert]::ToBase64String([Encoding]::Unicode.GetBytes($varText.ToLower()))
if(-not $usingParams.ContainsKey($key)) {
$usingParams.Add($key, $ExecutionContext.SessionState.PSVariable.Get($varPath).Value)
$usingParams.Add($key, $ExecutionContext.SessionState.PSVariable.GetValue($varPath))
}
}

Expand All @@ -177,7 +177,8 @@ function Invoke-Parallel {
$args[0].InvokeWithContext($null, [psvariable]::new('_', $args[1]))
}).AddArgument($ScriptBlock.Ast.GetScriptBlock()).AddArgument($InputObject)

# This is how `Start-Job` does it's magic. Credits to Jordan Borean for his help here.
# This is how `Start-Job` does it's magic.
# Credits to Jordan Borean for his help here.
# https://github.com/jborean93

# Reference in the source code:
Expand Down
5 changes: 4 additions & 1 deletion publish.ps1
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
Publish-Module -Path $PSScriptRoot -NuGetApiKey $env:PSGALLERY_TOKEN
param([string] $ModuleName)

$path = Join-Path $PSScriptRoot -ChildPath $ModuleName
Publish-Module -Path $path -NuGetApiKey $env:PSGALLERY_TOKEN