C# with PowerShell

This topic contains 6 replies, has 4 voices, and was last updated by  Graham Beer 2 years ago.

  • Author
  • #38427

    Graham Beer

    I'm looking to have a play with C# with PowerShell . I have no experience with C#, wondering of anyone could recommend a book that might be helpful.thanks !

  • #38428

    Richard Diphoorn

    Hi Graham, maybe Doug's book could be helpful to you:


    And if you have a Pluralsight account, you can check out this course (it's on my to-do list 🙂 ):


  • #38429

    Graham Beer

    Thanks Richard, funny you should mention that book, I purchased it from Amazon this morning !

  • #38430

    Warren Frame

    Hi Graham!

    There are a few ways you could go about this. Richard mentioned the first: You could use C# to write PowerShell Cmdlets. You would certainly learn a bit about both PowerShell and C#, but that might be quite a steep task for your first dabble in C#.

    Another option would be to just learn the basics of C#. You could compile and use C# on the fly in PowerShell, use csc.exe to compile your C# code, or play around with VS Code or Visual Studio itself – the community edition is a great free resource to learn with, but I'm personally starting to lean towards VS Code.

    As for resources, I'll let someone more knowledgeable answer – personally, I looked for free resources and experimented.

    Good luck!

  • #38437

    Graham Beer

    Thanks Warren that's a good post and a couple of useful links. How do you say C#, is it 'C plus'? Is there a huge differance between C# and F#? Seems like C# had similar syntax to powershell.

  • #38440

    Richard Siddaway

    You can create classes using inline C# and compile them through Add-Type to give you a really quick way to get started

  • #38443

    Graham Beer

    Excellent, thanks Richard.

You must be logged in to reply to this topic.