# ConvertFrom-JsonAsHashtable **Repository Path**: abgox/ConvertFrom-JsonAsHashtable ## Basic Information - **Project Name**: ConvertFrom-JsonAsHashtable - **Description**: JSON to Hashtable Conversion for Windows PowerShell 5.0+ - **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**: 2025-08-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: ConvertFrom-Json, Powershell ## README
English | 简体中文 | Github | Gitee
---喜欢这个项目?请给它一个 ⭐️ 或 赞赏 💰
## 介绍 - 在 `Windows PowerShell 5.1` 中, `ConvertFrom-Json` 方法没有 `-AsHashtable` 开关 - 这导致转换 json 内容为哈希表的操作变得不方便 - 这个模块用来解决这个问题 - 它会导出一个 `ConvertFrom-JsonAsHashtable` 函数,类似 `ConvertFrom-Json -AsHashtable` ## 使用 1. 安装模块: `Install-Module ConvertFrom-JsonAsHashtable` 2. 导入模块: `Import-Module ConvertFrom-JsonAsHashtable` 3. 使用示例: ```powershell $jsonString = '{ "key1": "value1", "key2": { "subkey1": "subvalue1", "subkey2": ["item1", "item2"] }, "key3": [ {"nestedkey1": "nestedvalue1"}, {"nestedkey2": "nestedvalue2"} ] }' $jsonString | ConvertFrom-JsonAsHashtable ```