News for hackers. Stuff that matters.
Re:Simple PowerShell things allowing you to dig a bit deeper... by jabroni_salad on Tuesday August 22, 2023 @09:24AM (#37222361)
powershell's json handling leaves a lot to be desired. It's been awhile since I poked around but I never found a good parser and usually just switch to python for that and basically everything else to do with APIs (invoke-webrequest is really annoying to use also).

powershell is good for controlling the windows operating system and doing basic things with objects. sysadmins are more likely to have a decent time with it than developers. Although, you can use it to interpret dotnet which is kinda neat.

Re:Simple PowerShell things allowing you to dig a bit deeper... by tempaway41114 on Tuesday August 22, 2023 @09:51AM (#37222721)

    $myJson = Get-Content .\test.json -Raw | ConvertFrom-Json 
    $myJson.Accounts.Users.asmith.department = "Senior Leadership" 
    $myJson | ConvertTo-Json -Depth 4 | Out-File .\test.json 
from: https://techcommunity.microsoft.com/t5/core-infrastructure-a...
Re:Simple PowerShell things allowing you to dig a bit deeper... by hobs on Tuesday August 22, 2023 @10:31AM (#37223289)
And the depth maxes out at 100, for some reason. This is my problem with most PS data things, they work well on the surface but when you really get your hands dirty they run like dogs or have weird limitations.