From cf33900106803a368cb557a60e2f6187e489e492 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 6 Jul 2026 01:31:47 +0200 Subject: [PATCH 1/3] Fix README placeholders --- README.md | 78 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 96936ee..e075f4d 100644 --- a/README.md +++ b/README.md @@ -1,69 +1,77 @@ -# {{ NAME }} +# Json -{{ DESCRIPTION }} +Json is a PowerShell module for importing, formatting, and exporting JSON data in scripts and automation workflows. ## Prerequisites -This uses the following external resources: -- The [PSModule framework](https://github.com/PSModule) for building, testing and publishing the module. +- PowerShell with `Microsoft.PowerShell.PSResourceGet` available for `Install-PSResource`. +- The [PSModule framework](https://github.com/PSModule) is used for building, testing, and publishing the module. ## Installation -To install the module from the PowerShell Gallery, you can use the following command: +Install the module from the PowerShell Gallery: ```powershell -Install-PSResource -Name {{ NAME }} -Import-Module -Name {{ NAME }} +Install-PSResource -Name Json +Import-Module -Name Json ``` -## Usage +## Commands -Here is a list of example that are typical use cases for the module. +- `Import-Json` reads JSON files and converts them to PowerShell objects. Wildcards and pipeline input are supported. +- `Format-Json` formats JSON strings or PowerShell objects as indented or compact JSON. +- `Export-Json` writes PowerShell objects or JSON strings to files, with support for indentation, encoding, `-Force`, and `-PassThru`. -### Example 1: Greet an entity +## Usage -Provide examples for typical commands that a user would like to do with the module. +Format a JSON string with two-space indentation: ```powershell -Greet-Entity -Name 'World' -Hello, World! +Format-Json -JsonString '{"name":"Marius","roles":["admin","dev"]}' -IndentationType Spaces -IndentationSize 2 ``` -### Example 2 - -Provide examples for typical commands that a user would like to do with the module. +Convert a PowerShell object to compact JSON: ```powershell -Import-Module -Name PSModuleTemplate +@{ + name = 'Marius' + roles = @('admin', 'dev') +} | Format-Json -Compact ``` -### Find more examples +Import one or more JSON files: -To find more examples of how to use the module, please refer to the [examples](examples) folder. +```powershell +Import-Json -Path 'config.json' +'settings.json', 'users.json' | Import-Json +``` -Alternatively, you can use the Get-Command -Module 'This module' to find more commands that are available in the module. -To find examples of each of the commands you can use Get-Help -Examples 'CommandName'. +Export an object to a JSON file: -## Documentation +```powershell +$config = @{ + database = @{ host = 'localhost'; port = 5432 } + logging = @{ level = 'info' } +} -Link to further documentation if available, or describe where in the repository users can find more detailed documentation about -the module's functions and features. +Export-Json -InputObject $config -Path 'config.json' -Depth 4 -Force +``` -## Contributing +## Examples -Coder or not, you can contribute to the project! We welcome all contributions. +More usage examples are available in the [examples](examples) folder. -### For Users +You can also inspect the available commands and built-in help from PowerShell: -If you don't code, you still sit on valuable information that can make this project even better. If you experience that the -product does unexpected things, throw errors or is missing functionality, you can help by submitting bugs and feature requests. -Please see the issues tab on this project and submit a new issue that matches your needs. +```powershell +Get-Command -Module Json +Get-Help Format-Json -Examples +``` -### For Developers +## Documentation -If you do code, we'd love to have your contributions. Please read the [Contribution guidelines](CONTRIBUTING.md) for more information. -You can either help by picking up an existing issue or submit a new one if you have an idea for a new feature or improvement. +Command documentation is published at [psmodule.io/Json](https://psmodule.io/Json/). -## Acknowledgements +## Contributing -Here is a list of people and projects that helped this project in some way. +Issues and pull requests are welcome. Please use the repository issue tracker to report bugs, request features, or discuss improvements. From d66a237c33b23b2251e047394991c6583d90497a Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 6 Jul 2026 08:27:10 +0200 Subject: [PATCH 2/3] Standardize README landing page --- README.md | 60 +++++-------------------------------------------------- 1 file changed, 5 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index e075f4d..4b9bba0 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,6 @@ # Json -Json is a PowerShell module for importing, formatting, and exporting JSON data in scripts and automation workflows. - -## Prerequisites - -- PowerShell with `Microsoft.PowerShell.PSResourceGet` available for `Install-PSResource`. -- The [PSModule framework](https://github.com/PSModule) is used for building, testing, and publishing the module. +Json is a PowerShell module for common JSON tasks. ## Installation @@ -16,62 +11,17 @@ Install-PSResource -Name Json Import-Module -Name Json ``` -## Commands - -- `Import-Json` reads JSON files and converts them to PowerShell objects. Wildcards and pipeline input are supported. -- `Format-Json` formats JSON strings or PowerShell objects as indented or compact JSON. -- `Export-Json` writes PowerShell objects or JSON strings to files, with support for indentation, encoding, `-Force`, and `-PassThru`. - -## Usage - -Format a JSON string with two-space indentation: - -```powershell -Format-Json -JsonString '{"name":"Marius","roles":["admin","dev"]}' -IndentationType Spaces -IndentationSize 2 -``` - -Convert a PowerShell object to compact JSON: - -```powershell -@{ - name = 'Marius' - roles = @('admin', 'dev') -} | Format-Json -Compact -``` - -Import one or more JSON files: - -```powershell -Import-Json -Path 'config.json' -'settings.json', 'users.json' | Import-Json -``` - -Export an object to a JSON file: - -```powershell -$config = @{ - database = @{ host = 'localhost'; port = 5432 } - logging = @{ level = 'info' } -} - -Export-Json -InputObject $config -Path 'config.json' -Depth 4 -Force -``` - -## Examples +## Documentation -More usage examples are available in the [examples](examples) folder. +Documentation is published at [psmodule.io/Json](https://psmodule.io/Json/). -You can also inspect the available commands and built-in help from PowerShell: +Use PowerShell help and command discovery for module details: ```powershell Get-Command -Module Json -Get-Help Format-Json -Examples +Get-Help -Examples ``` -## Documentation - -Command documentation is published at [psmodule.io/Json](https://psmodule.io/Json/). - ## Contributing Issues and pull requests are welcome. Please use the repository issue tracker to report bugs, request features, or discuss improvements. From e8f716283e380f8e946bb90d946f856da15f1bd0 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 6 Jul 2026 11:02:38 +0200 Subject: [PATCH 3/3] Address Copilot README review --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b9bba0..a641576 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Use PowerShell help and command discovery for module details: ```powershell Get-Command -Module Json -Get-Help -Examples +Get-Help -Name 'CommandName' -Examples ``` ## Contributing