News for hackers. Stuff that matters.

tempaway41114

At least another 5 years I'm afraid

    $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...
edited my comment above for clarity - I didn't mean literally CallMethod, I meant that normally Powershell uses 'shell' syntax where parameters are separated by spaces

Do-Something withthisfile.txt -AdditionalParam 23

But if you're calling a .NET method you switch to C# syntax with brackets and commas:

$str.Trim('-')

I mean thats kindof obvious but its one of the many things that makes Powershell's learning curve a little steeper. But hey we can always just google it which is par for the course anyway nowadays

Powershell does take a while to become fun. Key thing (I assume you know this?) is that while bash pipes a string-stream, powershell pipes a stream of structured objects. This is powerfull but also quite confusing sometimes.

The other key thing is that Powershell has straight access to the whole .NET framework (or whatever its called these days) except you've gotta switch to .CallMethod(with,brackets) syntax for that.

This list of common Gotchas on SO was useful to me: https://stackoverflow.com/a/69644807/22194

Powershell is quite good at working with CSV: Import-CSV, Export-CSV, Where-Object, Select-Object, Sort-Object, Group-Object etc become quite handy when used together.

imagines dystopic future where instead of going to prison, people convicted of crimes get 'outserviced' and all their accounts get deleted and then they exist as ghosts on the outskirts of everyone else's digital lives
Re:We’re All Just Temporarily Abled on Monday August 21, 2023 @09:00AM (#37208963)
My daughter has a very serious learning disability and she loves to swipe through home photos or videos on an android phone or on an ipad. She can mostly get on OK but when you look at it from her point of view, its _amazing_ how complicated 'swiping through pics' has become.

Swipe from the top? that brings the notifications

Swipe from the bottom? Brings up photo options. Press on one of those by accident and you end up in a nest of menus and features that can be hard to get out of.

Want to play a video? Tap once, the video controls fade in, you've then got to tap the play button in the middle of the screen within half a second or so, or it fades out again

Long press while scrolling through list of photos? Now you're in 'select mode' and every photo you press gets added to the selection rather than getting displayed. Can be very confusing.

Press the wrong button in IOS and you end up in very confusing picture-in-picture mode

One great thing about iOS is the 'guided access' feature, you can use it to lock the ipad into one app and even disable parts of the touchscreen so that a child can use the ipad without accidentally finding their way out of the app and into your email. I dont think Android has an equivalent.

Re:Even Been to This Free London Yew Maze? on Sunday August 20, 2023 @04:50PM (#37202832)
There's another great maze in London called "Zone 1", many tourists and locals get completely lost in there every day