Created
March 16, 2018 07:05
-
-
Save jeevan-vj/131ea9259ab5478473b42a648381774e to your computer and use it in GitHub Desktop.
Read write json file in powershell
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
$filePath = "C:\jeevan\sample.json" | |
$file = ([System.IO.File]::ReadAllText($filePath) | ConvertFrom-Json) | |
Write-Host $file.property1 | |
$file.property1 = Get-Random | |
$file | ConvertTo-Json | Out-File -FilePath $filePath -Encoding utf8 -Force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment