-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Minor edits to pre-77 content #12938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |||||
| external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml | ||||||
| Locale: en-US | ||||||
| Module Name: Microsoft.PowerShell.Utility | ||||||
| ms.date: 05/16/2024 | ||||||
| ms.date: 04/08/2026 | ||||||
| online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-json?view=powershell-7.6&WT.mc_id=ps-gethelp | ||||||
| schema: 2.0.0 | ||||||
| title: ConvertTo-Json | ||||||
|
|
@@ -28,21 +28,19 @@ The `ConvertTo-Json` cmdlet converts any .NET object to a string in JavaScript O | |||||
| property values, and the methods are removed. | ||||||
|
|
||||||
| > [!NOTE] | ||||||
| > As of PowerShell 7.2, Extended Type System properties of **DateTime** and | ||||||
| > **String** objects are no longer serialized and only the simple object is | ||||||
| > converted to JSON format | ||||||
| > As of PowerShell 7.2, Extended Type System properties of **DateTime** and **String** objects are | ||||||
| > no longer serialized and only the simple object is converted to JSON format | ||||||
|
|
||||||
| You can then use the `ConvertFrom-Json` cmdlet to convert a JSON-formatted string to a JSON | ||||||
| object, which is easily managed in PowerShell. | ||||||
| You can then use the `ConvertFrom-Json` cmdlet to convert a JSON-formatted string to a JSON object, | ||||||
| which is easily managed in PowerShell. | ||||||
|
|
||||||
| Many web sites use JSON instead of XML to serialize data for communication between servers and | ||||||
| web-based apps. | ||||||
|
|
||||||
| As of PowerShell 7.1, `ConvertTo-Json` emits a warning if the depth of the input object exceeds | ||||||
| the depth specified for the command. This prevents unwanted data loss when converting objects. | ||||||
| As of PowerShell 7.1, `ConvertTo-Json` emits a warning if the depth of the input object exceeds the | ||||||
| depth specified for the command. This prevents unwanted data loss when converting objects. | ||||||
|
|
||||||
| As of PowerShell 7.5-preview.3, `ConvertTo-Json` can serialize **BigInteger** values as raw JSON | ||||||
| numbers. | ||||||
| As of PowerShell 7.5, `ConvertTo-Json` can serialize **BigInteger** values as raw JSON numbers. | ||||||
|
|
||||||
| This cmdlet was introduced in Windows PowerShell 3.0. | ||||||
|
|
||||||
|
|
@@ -84,8 +82,8 @@ Get-Date | ConvertTo-Json; Get-Date | ConvertTo-Json -AsArray | |||||
| ] | ||||||
| ``` | ||||||
|
|
||||||
| This example shows the output from the `ConvertTo-Json` cmdlet with and without the **AsArray** | ||||||
| `[switch]` parameter. You can see the second portion of the output is wrapped in array brackets. | ||||||
| This example shows the output from `ConvertTo-Json` cmdlet with and without the **AsArray** switch | ||||||
|
||||||
| This example shows the output from `ConvertTo-Json` cmdlet with and without the **AsArray** switch | |
| This example shows the output from the `ConvertTo-Json` cmdlet with and without the **AsArray** switch |
Copilot
AI
Apr 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes about_CommonParameters to a fwlink in 7.6 (and similarly in 7.4), but 7.5 appears to keep the repo-relative link. For consistency (and to keep navigation/versioning behavior uniform across the versioned reference set), consider standardizing on one approach across 7.4/7.5/7.6—either keep the relative link everywhere or switch all versions to the fwlink.
| [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). | |
| [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the PowerShell 7.4 reference page, but it now documents a behavior introduced in PowerShell 7.5. That can confuse readers who expect the page to describe 7.4 behavior. Consider removing this sentence from the 7.4 page, or rewriting it to clearly indicate it’s not available in 7.4 and pointing readers to the 7.5+ documentation instead.