From 182fe09b64dd84a33bfdc3ddb93e192a9c435978 Mon Sep 17 00:00:00 2001 From: Martin Wiethan <47688561+Marterich@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:34:45 +0200 Subject: [PATCH] Change Preset Type and Contains (#2789) --- functions/public/Invoke-WPFImpex.ps1 | 3 +-- functions/public/Invoke-WPFPresets.ps1 | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/functions/public/Invoke-WPFImpex.ps1 b/functions/public/Invoke-WPFImpex.ps1 index d97f025e03..32539750a6 100644 --- a/functions/public/Invoke-WPFImpex.ps1 +++ b/functions/public/Invoke-WPFImpex.ps1 @@ -56,8 +56,7 @@ function Invoke-WPFImpex { } } } - - $flattenedJson = [string]$flattenedJson + Invoke-WPFPresets -preset $flattenedJson -imported $true } } diff --git a/functions/public/Invoke-WPFPresets.ps1 b/functions/public/Invoke-WPFPresets.ps1 index 90493899c7..1535ffe5f6 100644 --- a/functions/public/Invoke-WPFPresets.ps1 +++ b/functions/public/Invoke-WPFPresets.ps1 @@ -17,7 +17,7 @@ function Invoke-WPFPresets { param ( [Parameter(position=0)] - [string]$preset = "", + [Array]$preset = "", [Parameter(position=1)] [bool]$imported = $false, @@ -51,7 +51,7 @@ function Invoke-WPFPresets { } # Check if the checkbox name exists in the flattened JSON hashtable - if ($CheckBoxesToCheck.Contains($checkboxName)) { + if ($CheckBoxesToCheck -contains $checkboxName) { # If it exists, set IsChecked to true $sync.$checkboxName.IsChecked = $true Write-Debug "$checkboxName is checked"