From b7b2ee5a86511f3f5acbcbbccd876f667ffbd11d Mon Sep 17 00:00:00 2001 From: wild-devops <33394863+wild-devops@users.noreply.github.com> Date: Sun, 20 Jun 2021 15:27:34 +0300 Subject: [PATCH 1/2] v1.6.0 --- README.md | 4 ++-- pwshake/pwshake.psd1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bb58af6..74ccba0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![GitHub workflows (all tests)](https://github.com/wild-devops/pwshake/workflows/all%20tests/badge.svg)](../../actions/workflows/tests.yml) -[![GitHub release (latest by date)](https://img.shields.io/github/v/release/wild-devops/pwshake)](../../releases/tag/v1.5.1) +[![GitHub release (latest by date)](https://img.shields.io/github/v/release/wild-devops/pwshake)](../../releases/tag/v1.6.0) [![PowerShell Gallery](https://img.shields.io/powershellgallery/v/pwshake)](https://www.powershellgallery.com/packages/pwshake) [![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/pwshake)](https://www.powershellgallery.com/packages/pwshake) @@ -123,7 +123,7 @@ invoke_tasks: attributes: pwshake_module_path: /path/to/pwshake/module/source pwshake_path: /absolute/path/to/your/working/directory - pwshake_version: 1.5.1 + pwshake_version: 1.6.0 work_dir: /absolute/path/to/process/working/directory pwshake_log_path: /absolute/path/to/your/working/directory/my_pwshake.log some_attribute: this is an attribute value diff --git a/pwshake/pwshake.psd1 b/pwshake/pwshake.psd1 index 7776dad..6be8e2e 100644 --- a/pwshake/pwshake.psd1 +++ b/pwshake/pwshake.psd1 @@ -12,7 +12,7 @@ RootModule = 'pwshake.psm1' # Version number of this module. -ModuleVersion = '1.5.1' +ModuleVersion = '1.6.0' # Supported PSEditions # CompatiblePSEditions = @() From 3ebfd517815e752670abafe97d0f576dd5b5f712 Mon Sep 17 00:00:00 2001 From: wild-devops <33394863+wild-devops@users.noreply.github.com> Date: Fri, 26 Nov 2021 13:44:50 +0300 Subject: [PATCH 2/2] Fix some bugs --- README.md | 4 +- examples/8.filters/v1.5/filters_pwshake.yaml | 2 +- pwshake/context/filters.yaml | 4 +- pwshake/pwshake.psd1 | 150 +++++++++---------- pwshake/scripts/Build-Context.ps1 | 2 +- pwshake/scripts/Invoke-Step.ps1 | 2 +- 6 files changed, 82 insertions(+), 82 deletions(-) diff --git a/README.md b/README.md index 74ccba0..2cc890a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![GitHub workflows (all tests)](https://github.com/wild-devops/pwshake/workflows/all%20tests/badge.svg)](../../actions/workflows/tests.yml) -[![GitHub release (latest by date)](https://img.shields.io/github/v/release/wild-devops/pwshake)](../../releases/tag/v1.6.0) +[![GitHub release (latest by date)](https://img.shields.io/github/v/release/wild-devops/pwshake)](../../releases/tag/v1.5.2) [![PowerShell Gallery](https://img.shields.io/powershellgallery/v/pwshake)](https://www.powershellgallery.com/packages/pwshake) [![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/pwshake)](https://www.powershellgallery.com/packages/pwshake) @@ -123,7 +123,7 @@ invoke_tasks: attributes: pwshake_module_path: /path/to/pwshake/module/source pwshake_path: /absolute/path/to/your/working/directory - pwshake_version: 1.6.0 + pwshake_version: 1.5.2 work_dir: /absolute/path/to/process/working/directory pwshake_log_path: /absolute/path/to/your/working/directory/my_pwshake.log some_attribute: this is an attribute value diff --git a/examples/8.filters/v1.5/filters_pwshake.yaml b/examples/8.filters/v1.5/filters_pwshake.yaml index 857312c..b74f2d9 100644 --- a/examples/8.filters/v1.5/filters_pwshake.yaml +++ b/examples/8.filters/v1.5/filters_pwshake.yaml @@ -1,7 +1,7 @@ attributes: crypto_key: '{{$([PWSHAKE.Cryptography]::GenerateKey())}}' crypto_iv: '{{$([PWSHAKE.Cryptography]::GenerateIV())}}' - secret: '{{$encrypt:PWSHAKE,{{crypto_key}},{{crypto_iv}}}}' + secret: '{{$encrypt:PWSHAKE,PWSHAKE,PWSHAKE,{{crypto_key}},{{crypto_iv}}}}' name: '{{$decrypt:{{secret}},{{crypto_key}},{{crypto_iv}}}}' hello: 'Hello {{name}}!' my_attr: '{{$capsed:my_attr_value}}' diff --git a/pwshake/context/filters.yaml b/pwshake/context/filters.yaml index 5cc9163..de790b4 100644 --- a/pwshake/context/filters.yaml +++ b/pwshake/context/filters.yaml @@ -11,7 +11,7 @@ pwshake-context: f-$encrypt: |- { - if ($_ -match '^(?.+?),(?\S+),(?\S+)$') { + if ($_ -match '^(?.+),(?\S+?),(?\S+?)$') { $key = [Convert]::FromBase64String($matches.key) $vector = [Convert]::FromBase64String($matches.vector) [PWSHAKE.Cryptography]::Encrypt($matches.input, $key, $vector); @@ -20,7 +20,7 @@ pwshake-context: f-$decrypt: |- { - if ($_ -match '^(?.+?),(?\S+),(?\S+)$') { + if ($_ -match '^(?.+),(?\S+?),(?\S+?)$') { $key = [Convert]::FromBase64String($matches.key) $vector = [Convert]::FromBase64String($matches.vector) [PWSHAKE.Cryptography]::Decrypt($matches.input, $key, $vector); diff --git a/pwshake/pwshake.psd1 b/pwshake/pwshake.psd1 index 6be8e2e..a413a7e 100644 --- a/pwshake/pwshake.psd1 +++ b/pwshake/pwshake.psd1 @@ -8,117 +8,117 @@ @{ -# Script module or binary module file associated with this manifest. -RootModule = 'pwshake.psm1' + # Script module or binary module file associated with this manifest. + RootModule = 'pwshake.psm1' -# Version number of this module. -ModuleVersion = '1.6.0' + # Version number of this module. + ModuleVersion = '1.5.2' -# Supported PSEditions -# CompatiblePSEditions = @() + # Supported PSEditions + # CompatiblePSEditions = @() -# ID used to uniquely identify this module -GUID = 'b0a83342-5256-427e-aba6-6a536a8dbe8a' + # ID used to uniquely identify this module + GUID = 'b0a83342-5256-427e-aba6-6a536a8dbe8a' -# Author of this module -Author = 'wild-devops' + # Author of this module + Author = 'wild-devops' -# Company or vendor of this module -CompanyName = 'wild-devops' + # Company or vendor of this module + CompanyName = 'wild-devops' -# Copyright statement for this module -Copyright = '(c) wild-devops. All rights reserved.' + # Copyright statement for this module + Copyright = '(c) wild-devops. All rights reserved.' -# Description of the functionality provided by this module -Description = 'Yet another maker based on Powershell and Yaml configurations' + # Description of the functionality provided by this module + Description = 'Yet another maker based on Powershell and Yaml configurations' -# Minimum version of the PowerShell engine required by this module -# PowerShellVersion = '' + # Minimum version of the PowerShell engine required by this module + # PowerShellVersion = '' -# Name of the PowerShell host required by this module -# PowerShellHostName = '' + # Name of the PowerShell host required by this module + # PowerShellHostName = '' -# Minimum version of the PowerShell host required by this module -# PowerShellHostVersion = '' + # Minimum version of the PowerShell host required by this module + # PowerShellHostVersion = '' -# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. -# DotNetFrameworkVersion = '' + # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. + # DotNetFrameworkVersion = '' -# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. -# CLRVersion = '' + # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. + # CLRVersion = '' -# Processor architecture (None, X86, Amd64) required by this module -# ProcessorArchitecture = '' + # Processor architecture (None, X86, Amd64) required by this module + # ProcessorArchitecture = '' -# Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( - @{ModuleName="powershell-yaml"; RequiredVersion="0.4.0";Guid="6a75a662-7f53-425a-9777-ee61284407da"} -) + # Modules that must be imported into the global environment prior to importing this module + RequiredModules = @( + @{ModuleName = "powershell-yaml"; RequiredVersion = "0.4.0"; Guid = "6a75a662-7f53-425a-9777-ee61284407da" } + ) -# Assemblies that must be loaded prior to importing this module -# RequiredAssemblies = @() + # Assemblies that must be loaded prior to importing this module + # RequiredAssemblies = @() -# Script files (.ps1) that are run in the caller's environment prior to importing this module. -# ScriptsToProcess = @() + # Script files (.ps1) that are run in the caller's environment prior to importing this module. + # ScriptsToProcess = @() -# Type files (.ps1xml) to be loaded when importing this module -# TypesToProcess = @() + # Type files (.ps1xml) to be loaded when importing this module + # TypesToProcess = @() -# Format files (.ps1xml) to be loaded when importing this module -# FormatsToProcess = @() + # Format files (.ps1xml) to be loaded when importing this module + # FormatsToProcess = @() -# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess -# NestedModules = @() + # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess + # NestedModules = @() -# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. -FunctionsToExport = 'Invoke-pwshake' + # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. + FunctionsToExport = 'Invoke-pwshake' -# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. -CmdletsToExport = '*' + # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. + CmdletsToExport = '*' -# Variables to export from this module -VariablesToExport = '*' + # Variables to export from this module + VariablesToExport = '*' -# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. -AliasesToExport = 'pwshake' + # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. + AliasesToExport = 'pwshake' -# DSC resources to export from this module -# DscResourcesToExport = @() + # DSC resources to export from this module + # DscResourcesToExport = @() -# List of all modules packaged with this module -# ModuleList = @() + # List of all modules packaged with this module + # ModuleList = @() -# List of all files packaged with this module -# FileList = @() + # List of all files packaged with this module + # FileList = @() -# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. -PrivateData = @{ + # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. + PrivateData = @{ - PSData = @{ + PSData = @{ - # Tags applied to this module. These help with module discovery in online galleries. - Tags = @("PWSHAKE") + # Tags applied to this module. These help with module discovery in online galleries. + Tags = @("PWSHAKE") - # A URL to the license for this module. - # LicenseUri = '' + # A URL to the license for this module. + # LicenseUri = '' - # A URL to the main website for this project. - ProjectUri = 'https://github.com/wild-devops/pwshake' + # A URL to the main website for this project. + ProjectUri = 'https://github.com/wild-devops/pwshake' - # A URL to an icon representing this module. - IconUri = 'https://raw.githubusercontent.com/wild-devops/pwshake/master/pwshake.png' + # A URL to an icon representing this module. + IconUri = 'https://raw.githubusercontent.com/wild-devops/pwshake/master/pwshake.png' - # ReleaseNotes of this module - # ReleaseNotes = '' + # ReleaseNotes of this module + # ReleaseNotes = '' - } # End of PSData hashtable + } # End of PSData hashtable -} # End of PrivateData hashtable + } # End of PrivateData hashtable -# HelpInfo URI of this module -# HelpInfoURI = '' + # HelpInfo URI of this module + # HelpInfoURI = '' -# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. -# DefaultCommandPrefix = '' + # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. + # DefaultCommandPrefix = '' } diff --git a/pwshake/scripts/Build-Context.ps1 b/pwshake/scripts/Build-Context.ps1 index 151da9d..6cdf3e9 100644 --- a/pwshake/scripts/Build-Context.ps1 +++ b/pwshake/scripts/Build-Context.ps1 @@ -35,7 +35,7 @@ function Build-Context { } $context.types | ForEach-Object type | ForEach-Object { - Add-Type -TypeDefinition $_ -Language CSharp + Add-Type -IgnoreWarnings -TypeDefinition $_ -Language CSharp } return $context diff --git a/pwshake/scripts/Invoke-Step.ps1 b/pwshake/scripts/Invoke-Step.ps1 index 1dae259..9f7b636 100644 --- a/pwshake/scripts/Invoke-Step.ps1 +++ b/pwshake/scripts/Invoke-Step.ps1 @@ -37,7 +37,7 @@ function Invoke-Step { if (-not (Invoke-Expression $step.when)) { "`tBypassed because of: [$($step.when)] = $(Invoke-Expression $step.when)" | f-log-info | Out-Null - return + return; } $logOutputs = @()