3 ms·
PowerShell is one of Microsoft's better offerings, it runs rings around Batch, thank heaven. However, it has its own quirks. Loads and loads of stuff done impli
by gargravarr 10y ago
PowerShell is one of Microsoft's better offerings, it runs rings around Batch, thank heaven. However, it has its own quirks. Loads and loads of stuff done implicitly (unwrapping arrays as parameters when constructing an object?) and the .Net integration can be annoyingly flaky. Add in the bizarre syntax, some kind of halfway house between Bash and C#, and you quickly end up writing enough code to hang yourself.
My favourite: defining functions more or less like any other C-inspired language:
function abc([string]$param1, [string]$param2)
{
#do stuff
}
...but if you CALL that like any other C-inspired language:
abc("string1", "string2)
PowerShell mashes the two strings together and ignores the second parameter. Drove me mad when I started out. Incredibly inconsistent.
I like Microsoft's effort here, and the design is a lot better, working with objects, but not on my Devuan box!!