From e0ce2137e35b171ddadd6a3071e3ac16d46122cb Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Fri, 26 Jan 2024 09:09:00 -0800 Subject: [PATCH 1/2] fix version check in psgroup resource --- powershellgroup/powershellgroup.resource.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/powershellgroup/powershellgroup.resource.ps1 b/powershellgroup/powershellgroup.resource.ps1 index 4a8b5763..c2d526b0 100644 --- a/powershellgroup/powershellgroup.resource.ps1 +++ b/powershellgroup/powershellgroup.resource.ps1 @@ -21,7 +21,7 @@ function RefreshCache $script:ResourceCache = @{} $DscResources = Get-DscResource - + foreach ($r in $DscResources) { $moduleName = ""; @@ -33,7 +33,7 @@ function RefreshCache } } -if (($PSVersionTable.PSVersion.Major -ge 7) -and ($PSVersionTable.PSVersion.Minor -ge 4) ` +if (($PSVersionTable.PSVersion.Major -ge 7) -and ($PSVersionTable.PSVersion.Minor -eq 4) ` -and ($PSVersionTable.PSVersion.PreReleaseLabel.StartsWith("preview"))) { throw "PowerShell 7.4-previews are not supported by PowerShellGroup resource; please use PS 7.4.0-rc.1 or newer." @@ -153,7 +153,7 @@ elseif ($Operation -eq 'Get') { $inputht = @{} $ResourceTypeName = ($inputobj_pscustomobj.type -split "/")[1] - $inputobj_pscustomobj.psobject.properties | %{ + $inputobj_pscustomobj.psobject.properties | %{ if ($_.Name -ne "type") { $inputht[$_.Name] = $_.Value @@ -227,7 +227,7 @@ elseif ($Operation -eq 'Set') { $inputht = @{} $ResourceTypeName = ($inputobj_pscustomobj.type -split "/")[1] - $inputobj_pscustomobj.psobject.properties | %{ + $inputobj_pscustomobj.psobject.properties | %{ if ($_.Name -ne "type") { $inputht[$_.Name] = $_.Value @@ -301,7 +301,7 @@ elseif ($Operation -eq 'Test') { $inputht = @{} $ResourceTypeName = ($inputobj_pscustomobj.type -split "/")[1] - $inputobj_pscustomobj.psobject.properties | %{ + $inputobj_pscustomobj.psobject.properties | %{ if ($_.Name -ne "type") { $inputht[$_.Name] = $_.Value From d1d83c88f29d2232486ad9b6f1414481714ed321 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Fri, 26 Jan 2024 12:50:59 -0800 Subject: [PATCH 2/2] Update powershellgroup/powershellgroup.resource.ps1 --- powershellgroup/powershellgroup.resource.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powershellgroup/powershellgroup.resource.ps1 b/powershellgroup/powershellgroup.resource.ps1 index c2d526b0..dcc3ba1d 100644 --- a/powershellgroup/powershellgroup.resource.ps1 +++ b/powershellgroup/powershellgroup.resource.ps1 @@ -33,7 +33,7 @@ function RefreshCache } } -if (($PSVersionTable.PSVersion.Major -ge 7) -and ($PSVersionTable.PSVersion.Minor -eq 4) ` +if (($PSVersionTable.PSVersion.Major -eq 7) -and ($PSVersionTable.PSVersion.Minor -eq 4) ` -and ($PSVersionTable.PSVersion.PreReleaseLabel.StartsWith("preview"))) { throw "PowerShell 7.4-previews are not supported by PowerShellGroup resource; please use PS 7.4.0-rc.1 or newer."