Last active
April 7, 2023 15:00
-
-
Save bixb0012/0a26229fd80079915f7dc03170d65ef7 to your computer and use it in GitHub Desktop.
Powershell: Conversion-related
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 5.1 | |
# Reference: 1) https://learn.microsoft.com/en-us/dotnet/api/system.web.script.serialization.javascriptserializer | |
# Example 1: Convert JSON text to native .NET data types | |
# Useful for PowerShell limited to .NET Framework classes | |
Add-Type -AssemblyName System.Web.Extensions | |
$Json = # JSON text | |
$Jss = [Web.Script.Serialization.JavaScriptSerializer]::New() | |
$Object = $Jss.DeserializeObject((Get-Content -Path $Json)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment