Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Parse JSON file in PowerShell

$
0
0

I am writing a script to manage public folder permissions and would like to parse a JSON file to get the values. Here's a sample file.

'\Technology':                           {recursive: 'yes', user: 'Default', AccessRights: 'Contributor'},

'\Technology':                           {recursive: 'yes', user: 'Anonymous', AccessRights: 'CreateItems'},

'\Technology':                           {recursive: 'yes', user: 'gr_systems', AccessRights: 'Author'},

'\Technology\Testing':                   {recursive: 'yes', user: 'gr_itdev', AccessRights: 'Non-EditingAuthor'},

'\Technology\Testing\Tes1':              {recursive: 'yes', user: 'gr_developers', AccessRights: 'Non-EditingAuthor'},

I would like to parse this file from a PS script and assign to variables.

$Identity = "\Technology"

$recursive= "yes"

$user = "gr_itdev"

$AccessRights = "Non-EditingAuthor"

Can someone point to online documentation or add a code snippet or two for the same.

Thanks for the help!!


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>