home.social

#powershell-mac — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #powershell-mac, aggregated by home.social.

fetched live
  1. Script To Download the Current Version of PowerShell

    One of the annoying things about well, any software is checking to see if you have the currrent version. This is a thing with PowerShell, and because the PowerShell team in its finite wisdom has decided to not just have a "latest stable/lts/preview" url, we have to figure this out manually. It's not too bad though, fortunately, the PowerShell team gives us…

    bynkiidotcom.wordpress.com/202

    #PowershellMac
    #powershellmacos
    #powershell

  2. Script To Download the Current Version of PowerShell

    One of the annoying things about well, any software is checking to see if you have the currrent version. This is a thing with PowerShell, and because the PowerShell team in its finite wisdom has decided to not just have a "latest stable/lts/preview" url, we have to figure this out manually. It's not too bad though, fortunately, the PowerShell team gives us…

    bynkiidotcom.wordpress.com/202

    #PowershellMac
    #powershellmacos
    #powershell

  3. PowerShell script signer is done!

    Well, it's a 1.0.1, there’s a few things I want to add, but it's not bad at the moment. It's on the PowerShell Gallery at: powershellgallery.com/packages and the github link is at: github.com/johncwelch/pwshsign

    the readme on the github repo has the small number of future improvements I have planned, but for now, it's a solid MVP.

    #PowershellMac
    #powershellmacos
    #powershell

  4. PowerShell script signer is done!

    Well, it's a 1.0.1, there’s a few things I want to add, but it's not bad at the moment. It's on the PowerShell Gallery at: powershellgallery.com/packages and the github link is at: github.com/johncwelch/pwshsign

    the readme on the github repo has the small number of future improvements I have planned, but for now, it's a solid MVP.

    #PowershellMac
    #powershellmacos
    #powershell

  5. Getting Warranty Info on your Mac with PowerShell

    This was a feature someone asked for with Get-MacInfo. Here's the basics, the script is on the github site, and VERY REAL WARNINGS:

    This is incredibly fragile, as it relies on a directory, com.apple.NewDeviceOutreach, being in ~/Library/Application Support/ for the user running the script. I'm not even going to try to play "peekaboo in other user homedirs" with a…

    bynkiidotcom.wordpress.com/202

    #powershell
    #powershellmac
    #powershellmacos

  6. Getting Warranty Info on your Mac with PowerShell

    This was a feature someone asked for with Get-MacInfo. Here's the basics, the script is on the github site, and VERY REAL WARNINGS:

    This is incredibly fragile, as it relies on a directory, com.apple.NewDeviceOutreach, being in ~/Library/Application Support/ for the user running the script. I'm not even going to try to play "peekaboo in other user homedirs" with a…

    bynkiidotcom.wordpress.com/202

    #powershell
    #powershellmac
    #powershellmacos

  7. One advantage of moving to JSON for system_profiler output as opposed to line numbers is that I can get rid of a LOT of duplication.

    Directly addressing elements doesn’t suck.

    #powershell
    #powershellmac

  8. One advantage of moving to JSON for system_profiler output as opposed to line numbers is that I can get rid of a LOT of duplication.

    Directly addressing elements doesn’t suck.

    #powershell
    #powershellmac

  9. Script I used to work out grabbing json system_profiler data. Tpowershellmacos complicated because there’s things that aren’t always there, and a LOT of info if they’re all there.

    github.com/johncwelch/Get-MacI

    #powershell
    #powershellmac
    #powershellmacos

  10. Script I used to work out grabbing json system_profiler data. Tpowershellmacos complicated because there’s things that aren’t always there, and a LOT of info if they’re all there.

    github.com/johncwelch/Get-MacI

    #powershell
    #powershellmac
    #powershellmacos

  11. this will be very nice for the updates I want to do for Get-MacInfo.

    Now if anyone with a desktop mac, intel or applesilcon feels like sending me the output from system_profiler SPPowerDataType -json?

    I don't actually have one, so I'm unsure of what it actually looks like

    #PowershellMac #powershell

  12. this will be very nice for the updates I want to do for Get-MacInfo.

    Now if anyone with a desktop mac, intel or applesilcon feels like sending me the output from system_profiler SPPowerDataType -json?

    I don't actually have one, so I'm unsure of what it actually looks like

    #PowershellMac #powershell

  13. OMFG, figured out how to get structured data from system_profiler I can use in PowerShell!

    powershell use the -json option for the SP data type you want info on, because the XML is a gods-damned mess. JSON is WAY easier.

    three steps:
    1) Get output of the system-profiler command with -json. Creates array of strings
    2) Convert Array to string with out-string
    3) Feed string to ConvertFrom-Json as -InputObject

    from there, it acts like an array of objects. Very nice!
    #PowershellMac
    #powershell

  14. OMFG, figured out how to get structured data from system_profiler I can use in PowerShell!

    powershell use the -json option for the SP data type you want info on, because the XML is a gods-damned mess. JSON is WAY easier.

    three steps:
    1) Get output of the system-profiler command with -json. Creates array of strings
    2) Convert Array to string with out-string
    3) Feed string to ConvertFrom-Json as -InputObject

    from there, it acts like an array of objects. Very nice!
    #PowershellMac
    #powershell

  15. So stupid PowerShell trick that ironically doesn’t work in PowerShell 5.1 windows, but does work well in 7.x: you can use test-connection to explicitly test for TCP port connectivity on IPv6:

    Test-Connection <servername> -IPv6 -TcpPort <port number>

    For IPv4, use -IPv4 instead. It’s nice when you’re troubleshooting IPv6 issues.

    #PowershellMac
    #powershell

  16. So stupid PowerShell trick that ironically doesn’t work in PowerShell 5.1 windows, but does work well in 7.x: you can use test-connection to explicitly test for TCP port connectivity on IPv6:

    Test-Connection <servername> -IPv6 -TcpPort <port number>

    For IPv4, use -IPv4 instead. It’s nice when you’re troubleshooting IPv6 issues.

    #PowershellMac
    #powershell

  17. Figured out how to sign PowerShell scripts the authenticode way on macOS, updated post here:

    bynkiidotcom.wordpress.com/202

    So yeah, you can do that correctly. Pretty nice

    #powershell #PowershellMac #macadmins

  18. Figured out how to sign PowerShell scripts the authenticode way on macOS, updated post here:

    bynkiidotcom.wordpress.com/202

    So yeah, you can do that correctly. Pretty nice

    #powershell #PowershellMac #macadmins