From 0456865fb4a075e0d45b6d104c2d0ccd7d07d913 Mon Sep 17 00:00:00 2001 From: Santiago Squarzon Date: Mon, 2 Jan 2023 11:36:23 -0300 Subject: [PATCH 1/2] fix: $using: statements require lower case #3 --- .github/workflows/ondemand publish.yml | 2 +- .github/workflows/release publish.yml | 2 +- .../PSParallelPipeline.psd1 | 2 +- .../PSParallelPipeline.psm1 | 9 ++++----- publish.ps1 | 5 ++++- 5 files changed, 11 insertions(+), 9 deletions(-) rename PSParallelPipeline.psd1 => PSParallelPipeline/PSParallelPipeline.psd1 (99%) rename PSParallelPipeline.psm1 => PSParallelPipeline/PSParallelPipeline.psm1 (96%) diff --git a/.github/workflows/ondemand publish.yml b/.github/workflows/ondemand publish.yml index c55ea61..f9f9523 100644 --- a/.github/workflows/ondemand publish.yml +++ b/.github/workflows/ondemand publish.yml @@ -16,6 +16,6 @@ jobs: - name: Publish to Gallery shell: pwsh - run: .\publish.ps1 + run: .\publish.ps1 PSParallelPipeline env: PSGALLERY_TOKEN: ${{ secrets.PSGALLERY_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release publish.yml b/.github/workflows/release publish.yml index 6e777c2..d1943f7 100644 --- a/.github/workflows/release publish.yml +++ b/.github/workflows/release publish.yml @@ -20,6 +20,6 @@ jobs: - name: Publish to Gallery shell: pwsh - run: .\publish.ps1 + run: .\publish.ps1 PSParallelPipeline env: PSGALLERY_TOKEN: ${{ secrets.PSGALLERY_TOKEN }} \ No newline at end of file diff --git a/PSParallelPipeline.psd1 b/PSParallelPipeline/PSParallelPipeline.psd1 similarity index 99% rename from PSParallelPipeline.psd1 rename to PSParallelPipeline/PSParallelPipeline.psd1 index 1b704ed..34f9f74 100644 --- a/PSParallelPipeline.psd1 +++ b/PSParallelPipeline/PSParallelPipeline.psd1 @@ -12,7 +12,7 @@ RootModule = 'PSParallelPipeline.psm1' # Version number of this module. -ModuleVersion = '1.0.1' +ModuleVersion = '1.0.2' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/PSParallelPipeline.psm1 b/PSParallelPipeline/PSParallelPipeline.psm1 similarity index 96% rename from PSParallelPipeline.psm1 rename to PSParallelPipeline/PSParallelPipeline.psm1 index f0ad85d..a5cb0f0 100644 --- a/PSParallelPipeline.psm1 +++ b/PSParallelPipeline/PSParallelPipeline.psm1 @@ -152,11 +152,9 @@ function Invoke-Parallel { $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)) } } @@ -177,7 +175,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: diff --git a/publish.ps1 b/publish.ps1 index 698ee4a..69db938 100644 --- a/publish.ps1 +++ b/publish.ps1 @@ -1 +1,4 @@ -Publish-Module -Path $PSScriptRoot -NuGetApiKey $env:PSGALLERY_TOKEN \ No newline at end of file +param([string] $ModuleName) + +$path = Join-Path $PSScriptRoot -ChildPath $ModuleName +Publish-Module -Path $path -NuGetApiKey $env:PSGALLERY_TOKEN \ No newline at end of file From 08cb9116aea0fe72aa03658af95cddb8837fe28f Mon Sep 17 00:00:00 2001 From: Santiago Squarzon Date: Mon, 2 Jan 2023 11:39:56 -0300 Subject: [PATCH 2/2] fix: $using: statements require lower case #3 --- PSParallelPipeline/PSParallelPipeline.psm1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PSParallelPipeline/PSParallelPipeline.psm1 b/PSParallelPipeline/PSParallelPipeline.psm1 index a5cb0f0..b2b7500 100644 --- a/PSParallelPipeline/PSParallelPipeline.psm1 +++ b/PSParallelPipeline/PSParallelPipeline.psm1 @@ -148,6 +148,8 @@ 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