# ConvertFrom-JsonAsHashtable **Repository Path**: abgox/ConvertFrom-JsonAsHashtable ## Basic Information - **Project Name**: ConvertFrom-JsonAsHashtable - **Description**: 适用于 Windows PowerShell 5.0+ 的 JSON 到哈希表的转换,类似于 PowerShell 7.0+ 的 'ConvertFrom-Json -AsHashtable' - **Primary Language**: PowerShell - **License**: MIT - **Default Branch**: main - **Homepage**: https://www.powershellgallery.com/packages/ConvertFrom-JsonAsHashtable - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-05-16 - **Last Updated**: 2026-07-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: ConvertFrom-Json, Powershell ## README

✨ConvertFrom-JsonAsHashtable✨

English | 简体中文 | Powershell Gallery | Github | Gitee

license version PowerShell Gallery code size repo size created

---

喜欢这个项目?请给它 Star ⭐️ 或 赞赏 💰

## 介绍 适用于 [Windows PowerShell 5+](https://learn.microsoft.com/powershell/scripting/what-is-windows-powershell) 的 JSON 到哈希表的转换,类似于 [PowerShell 7+](https://learn.microsoft.com/powershell/scripting/overview) 的 `ConvertFrom-Json -AsHashtable` - **PowerShell 7+**:直接委托给原生的 `ConvertFrom-Json -AsHashtable` - **PowerShell 5+**:使用手写的迭代 JSON 解析器 ## 安装 - [Install-Module](https://learn.microsoft.com/powershell/module/powershellget/install-module) ```powershell Install-Module ConvertFrom-JsonAsHashtable ``` - [Install-PSResource](https://learn.microsoft.com/powershell/module/microsoft.powershell.psresourceget/install-psresource) ```powershell Install-PSResource ConvertFrom-JsonAsHashtable ``` - [Scoop](https://scoop.sh) - 添加 [abyss](https://abyss.abgox.com) bucket ([Github](https://github.com/abgox/abyss) 或 [Gitee](https://gitee.com/abgox/abyss)) - 安装它 ```shell scoop install abyss/abgox.ConvertFrom-JsonAsHashtable ``` ## 使用 ```powershell $jsonString = '{ "key1": "value1", "key2": { "subKey1": "subValue1", "subKey2": ["item1", "item2"] }, "key3": [ {"nestedKey1": "nestedValue1"}, {"nestedKey2": "nestedValue2"} ] }' $jsonString | ConvertFrom-JsonAsHashtable ```