From f8ddb0fe678f8b8fa3b45de398f419dafeb24972 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 16 Mar 2024 23:34:56 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Load=20as=20hashtable?= =?UTF-8?q?=20(#5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description - Load as hashtable ## Type of change - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas --- src/Store/private/Initialize-VariableStore.ps1 | 2 +- src/Store/private/Set-StoreVariable.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Store/private/Initialize-VariableStore.ps1 b/src/Store/private/Initialize-VariableStore.ps1 index 6f16436..d3adae1 100644 --- a/src/Store/private/Initialize-VariableStore.ps1 +++ b/src/Store/private/Initialize-VariableStore.ps1 @@ -19,6 +19,6 @@ Set-StoreVariable -Name 'ConfigFileName' -Value $configFilePath } - $script:Store = Get-Content -Path $configFilePath | ConvertFrom-Json + $script:Store = Get-Content -Path $configFilePath | ConvertFrom-Json -AsHashtable } diff --git a/src/Store/private/Set-StoreVariable.ps1 b/src/Store/private/Set-StoreVariable.ps1 index 58647d1..94f2175 100644 --- a/src/Store/private/Set-StoreVariable.ps1 +++ b/src/Store/private/Set-StoreVariable.ps1 @@ -24,6 +24,6 @@ } else { $script:Store["$Name"] = $Value } - $script:Store | ConvertTo-Json | Set-Content -Path $script:Store.ConfigFileName -Force + $script:Store | ConvertTo-Json -Depth 100 | Set-Content -Path $script:Store.ConfigFileName -Force } }