My text file has below text in Json format. Its huge file below is sample. I would like this data loaded in hash table so later in script i can query data for processing.
{
"cohwpcu01": {
"lx-wpcpo1kji04": 6397,
"ut14003": 6761,
"HFS Citrix 12-2014": 9952,
"ut08647": 7678
}
"cohwpcu02": {
"lx-wpcpo1kji05": 6397,
"ut140056": 6761,
"HFS Citrix 12-2019": 9952,
"ut08650": 7678
}
}
I have tried below $hash=Get-Content -Path .\hash_table.txt|ConvertFrom-StringData
ConvertFrom-StringData : Data line '{' is not in 'name=value' format. At line:1 char:42
- $hash=Get-Content -Path .\hash_table.txt|ConvertFrom-StringData
-
~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (:) [ConvertFrom-StringData], PSInvalidOperationException
- FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.ConvertFromStringDataCommand
Any idea how do i make hash table out of these data ???
Thank you