I have a json file, test.json, like the below
[
{ "STORE":"2001", "UUID":"d7985d5f", "Clock1":"91", "Type":"IP" },
{ "STORE":"2002", "UUID":"821a0368", "Clock1":"92", "Type":"GT" }
]
And I am getting a comma-separated string as below
$StoreInput = "2001,2002"
$StoreArray = $StoreInput.Split(",")
$storemap = "location\test.json" | ConvertFrom-Json
What I want to do is, read $StoreArray, check the Type of each store against $storemap, and run function according to the type, passing uuid and Clock1
if (type = IP) {
Function1 -Clock $Clock1 (from the json) -UUID $UUID (from the json) #Value of 2001's
}
elseif (type = GT) {
Function2 -Clock $Clock1 (from the json) -UUID $UUID (from the json) #Value of 2002's
}
How do I go about doing this?