From 2e91aca79c1c5e91230895febafaa5a3c47a6c8c Mon Sep 17 00:00:00 2001 From: Bernie White Date: Mon, 25 Apr 2022 22:41:58 +1000 Subject: [PATCH] Fixed assertion failed with newer version #159 --- docs/CHANGELOG-v2.md | 2 ++ powershell.ps1 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG-v2.md b/docs/CHANGELOG-v2.md index 265e913..a3d7154 100644 --- a/docs/CHANGELOG-v2.md +++ b/docs/CHANGELOG-v2.md @@ -15,6 +15,8 @@ What's changed since v2.0.0: - Engineering: - Bump PSRule dependency to v2.0.1. [#158](https://github.com/microsoft/ps-rule/pull/158) - See the [change log](https://microsoft.github.io/PSRule/latest/CHANGELOG-v2/#v201) +- Bug fixes: + - Fixed assertion failed with newer version. [#159](https://github.com/microsoft/ps-rule/issues/159) ## v2.0.0 diff --git a/powershell.ps1 b/powershell.ps1 index 8c06fe9..1a43e9e 100644 --- a/powershell.ps1 +++ b/powershell.ps1 @@ -198,7 +198,7 @@ foreach ($m in $moduleNames) { } try { - $checkParams = @{ RequiredVersion = $checkParams.RequiredVersion.Split('-')[0] } + $checkParams = @{ MinimumVersion = $checkParams.RequiredVersion.Split('-')[0] } $Null = Import-Module PSRule @checkParams -ErrorAction Stop; $version = (Get-Module PSRule).Version; }