Will PowerShell ever support multi-threading out of the box?

This topic contains 4 replies, has 3 voices, and was last updated by Profile photo of Tim Pringle Tim Pringle 10 months, 3 weeks ago.

  • Author
    Posts
  • #33762
    Profile photo of Steven Ayers
    Steven Ayers
    Participant

    In recent months I've seen classes released, and as more and more features are added, PowerShell's audience and capability is expanding. Some of the audience won't be the people writing the tools, but those using it, and to make GUIs effective, I imagine we'll need similar WPF & WinForm support for PowerShell as we do for C#.

    A workaround for multi-threading is using PSJobs, sapien forums have some great functions built to help with this, and it does work quite well, but it's limited. So, do you think PowerShell will have multi-threading introduced, similarly to background workers?

    Speaking of GUI, do you think we'll see Visual Studio tools released for PowerShell WPF?

    I'm interested to hear if anyone else thinks this is necessary, or if it'll happen.

  • #33766
    Profile photo of Tim Pringle
    Tim Pringle
    Participant

    Hi Stephen,

    Regards GUIs and other functionality, it's important to bear in mind that PowerShell sits on top of the .NET framework, so you have a wealth of classes already available to you.

    Regards winforms, system.windows.forms (if i recall right) has everything you need to create a GUI. PowerShell Studio is one option that provides you with a graphical design environment. If you've used it at all, use the export option and you can view the powershell code it generates.

    For WPF, there's already plug in's available for Visual Studio code and PowerShell. You can also export your WPF form design (XAML), and include it in your PowerShell code. Stephen Owen's written a couple of blogs on how to do this :

    Regards multithreading, Boe Prox has written a couple of great articles on the use of background Runspaces, which are worth a read :

    I think Dave Wyatt's also got a good bit of knowledge about multithreading as well, so he may be able to provide more in depth about multithreading and powershell.

  • #33769
    Profile photo of Steven Ayers
    Steven Ayers
    Participant

    Thanks for the reply Tim.

    I do use PowerShell studio, but what I mean by support is the same level of rich tools for PowerShell as we have for C# in Visual Studio, your link for working with WPF looks useful though, so thank you.

    The link to multi-threading looks useful, seems like a different approach to the one im currently using, so thanks for that!

  • #33770
    Profile photo of Dan Potter
    Dan Potter
    Participant

    delete

  • #33775
    Profile photo of Tim Pringle
    Tim Pringle
    Participant

    Toolwise, (although in truth i've not looked at it yet), the impression i get from the community is that we can expect more and more from Visual Studio Code and developments taking place for it for PowerShell.

    Over the next few years my personal opinion is i think we'll see Visual Studio Code as becoming the defacto development environment for PowerShell.

You must be logged in to reply to this topic.