Consider that json object:
@"
{
""Logging"": {
""LogLevel"": {
""Default"": ""Warning""
}
},
""AllowedHosts"": ""*"",
""ConnectionStrings"": {
""ConnectionString1"": """",
""ConnectionString2"": """",
""ConnectionString3"": """"
}}";
I want to write a function in powershell that will take that json and search for certain property and return the path of it. For instance if the function name is ReturnHierarchyPath(json, propertyName)
When I call it ReturnHierarchyPath(json, "ConnectionString1") , the return should be "ConnectionStrings.ConnectionString1"
I implemeted this in C# but I want to know if it's possible in powershell script?
Here is the example of the C# code: https://dotnetfiddle.net/N5ccWY