• JustARegularNerd@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    5
    ·
    9 days ago

    There is still not a neat replacement for wmic in PowerShell. If I want to do the equivalent of wmic product where name="some shitware" call uninstall it looks like this:

    $instance = Get-CimInstance win32_process -Filter "Name = 'powershell_ise.exe'" $instance | Invoke-CimMethod -MethodName 'Terminate'

    Like how the hell is that easier to understand Microsoft? Everything else in PowerShell follows a general pattern of Upper Camelcase.

    That’s just one instance of what I’ve found working with pwsh at work that leaves me thinking wtf

      • Matthew@midwest.social
        link
        fedilink
        English
        arrow-up
        2
        ·
        9 days ago

        I used to love batch as a kid. One time I was feeling devious so I wrote out a little script that deletes system32 and I emailed it to a classmate. I immediately burst into tears after hitting send and called her to let her know to delete the email.