# C# with PowerShell

**URL:** <https://forums.powershell.org/t/c-with-powershell/6332>\
**Category:** PowerShell Help\
**Created:** [April 29, 2016, 5:29pm UTC](https://forums.powershell.org/t/c-with-powershell/6332 "2016-04-29T17:29:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![graham-beer](https://avatars.discourse-cdn.com/v4/letter/g/49beb7/32.png) [@graham-beer](https://forums.powershell.org/u/graham-beer)\
**Post date:** [April 29, 2016, 5:29pm UTC](https://forums.powershell.org/t/c-with-powershell/6332/1 "2016-04-29T17:29:48Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![rdtechie](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/rdtechie/32/273_2.png) [@rdtechie](https://forums.powershell.org/u/rdtechie)\
**Post date:** [April 29, 2016, 8:32pm UTC](https://forums.powershell.org/t/c-with-powershell/6332/2 "2016-04-29T20:32:21Z")

</div>

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

> **[Windows PowerShell for Developers: Enhance Your Productivity and Enable Rapid...](https://www.amazon.com/Windows-PowerShell-Developers-Productivity-Application/dp/1449322700)**
>
> Windows PowerShell for Developers: Enhance Your Productivity and Enable Rapid Application Development \[Finke, Douglas\] on Amazon.com. \*FREE\* shipping on qualifying offers. Windows PowerShell for Developers: Enhance Your Productivity and Enable Rapid...

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

> **[PowerShell Cmdlet Development in C# - The Ins and Outs](https://www.pluralsight.com/courses/powershell-cmdlet-development-csharp)**
>
> This focused course goes beyond just the basics and will walk you through the ways to create PowerShell cmdlets using C# and show you what you can do with that knowledge.

---

<div class="post-metadata">

**Author:** ![graham-beer](https://avatars.discourse-cdn.com/v4/letter/g/49beb7/32.png) [@graham-beer](https://forums.powershell.org/u/graham-beer)\
**Post date:** [April 29, 2016, 8:58pm UTC](https://forums.powershell.org/t/c-with-powershell/6332/3 "2016-04-29T20:58:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pscookiemonster](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/pscookiemonster/32/634_2.png) [@pscookiemonster](https://forums.powershell.org/u/pscookiemonster)\
**Post date:** [April 30, 2016, 12:11am UTC](https://forums.powershell.org/t/c-with-powershell/6332/4 "2016-04-30T00:11:20Z")

</div>

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](http://www.old.dougfinke.com/blog/index.php/2010/08/29/how-to-load-net-assemblies-in-a-powershell-session/), use [csc.exe to compile your C# code](http://stackoverflow.com/questions/18286855/how-can-i-compile-and-run-c-sharp-program-without-using-visual-studio), 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!

---

<div class="post-metadata">

**Author:** ![graham-beer](https://avatars.discourse-cdn.com/v4/letter/g/49beb7/32.png) [@graham-beer](https://forums.powershell.org/u/graham-beer)\
**Post date:** [April 30, 2016, 6:51pm UTC](https://forums.powershell.org/t/c-with-powershell/6332/5 "2016-04-30T18:51:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![richard-siddaway](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@richard-siddaway](https://forums.powershell.org/u/richard-siddaway)\
**Post date:** [April 30, 2016, 9:30pm UTC](https://forums.powershell.org/t/c-with-powershell/6332/6 "2016-04-30T21:30:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![graham-beer](https://avatars.discourse-cdn.com/v4/letter/g/49beb7/32.png) [@graham-beer](https://forums.powershell.org/u/graham-beer)\
**Post date:** [April 30, 2016, 9:59pm UTC](https://forums.powershell.org/t/c-with-powershell/6332/7 "2016-04-30T21:59:03Z")

</div>

Excellent, thanks Richard.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:42pm UTC](https://forums.powershell.org/t/c-with-powershell/6332/8 "2024-05-16T20:42:36Z")

</div>

Closed on May 16, 2024, 8:42pm UTC


