home.social

#powershellhelp — Public Fediverse posts

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

fetched live
  1. Fun with variable scopes in PowerShell

    So variable scopes. This can be fun, or really, quite maddening. My latest project is bridging PowerShell to AppleScript’s Choose File. Most of it has been easy, but the hard part has been the “of type” parameter, because it’s big. Like my current list uses around 1300 file extensions and file types to generate a list of Type Identifiers that can be use with “of type” because Type Identifiers are literally the only reliable thing to use there. Fun times.

    Anyway, there’s a 7000-line Switch-Case statement that builds a massive arraylist of Type Identifiers in the main body of the script. Now, I need to use that in a function, but obvs I don’t want to pass THAT. So at first I tried a trick that was documented and seemed to work, namely pointing a function variable at the arraylist via:

    $myList = $Global:myArrayList

    Where $myList is the function variable and myArrayList is the main script var. This seemed to work well, at least inside of VSCode.

    Then I went to test it in a straight PowerShell terminal. Two hours later, I realized that in a “normal” PowerShell terminal, $myList was not getting any kind of value. I don’t know if that’s a bug or intended, but once I realized it, the fix was easy, just declare the initial arraylist as global:

    $Global:myArrayList = New-Object System.Collections.ArrayList

    and you’re set. Ye. Gods. that sucked.

    #PowerShell #powershellFun #PowerShellHelp

  2. PowerShell HelpWriter 3.0.68 released with redesigned Start page, notification settings changes, and various other updates and fixes. 👍

    Build details:
    👉 bit.ly/4b2Zlqa

    #SAPIENTech #PowerShellHelpWriter #PowerShellHelp #PowerShell #pwsh #scripting #NewRelease

  3. PowerShell HelpWriter 3.0.68 released with redesigned Start page, notification settings changes, and various other updates and fixes. 👍

    Build details:
    👉 bit.ly/4b2Zlqa

    #SAPIENTech #PowerShellHelpWriter #PowerShellHelp #PowerShell #pwsh #scripting #NewRelease

  4. PowerShell HelpWriter 3.0.68 released with redesigned Start page, notification settings changes, and various other updates and fixes. 👍

    Build details:
    👉 bit.ly/4b2Zlqa

  5. build 5.8.238 has been released with new Script Packager features, a new import tool, and more! 👍 🙌

    Build details:
    👉 bit.ly/3Sp4NMV

  6. build 8.1.200 was released earlier this week with some new features. 👍

    Stay tuned for info about the new Help features! 🙌

    Build details:
    👉 bit.ly/4b3ELWY