# What is PowerShell made from?

**URL:** <https://forums.powershell.org/t/what-is-powershell-made-from/5078>\
**Category:** PowerShell Help\
**Created:** [October 22, 2015, 2:10am UTC](https://forums.powershell.org/t/what-is-powershell-made-from/5078 "2015-10-22T02:10:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![steven-ayers](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@steven-ayers](https://forums.powershell.org/u/steven-ayers)\
**Post date:** [October 22, 2015, 2:10am UTC](https://forums.powershell.org/t/what-is-powershell-made-from/5078/1 "2015-10-22T02:10:37Z")

</div>

I decided to begin learning C# - I’m not a developer by trade, but I enjoy “coding” in PowerShell and making apps with it (I can imagine how hilarious our software development department would find that statement) so I wanted to explore programming and in turn, making powershell. I have made PowerShell modules with PowerShell, and I want to try making some Powershell Modules in C#.

I wanted to have a nosey around the PowerShell folder, and see how Jeffrey Snover and the team have done it, but obviously everything is compiled. So, I wanted to know if the PowerShell source code is available anyway?

I had another question.

I have made GUI’s in PowerShell, one of my packages is about 5,000 lines… which in PowerShell is a lot in my opinion! Tab controls, Progress bars etc, however, it’s hard to develop it into much more, as Powershell is a single thread process. A Powershell studio trial helped me get a few of the basics in place, but I wanted to find out if there’s a way I could incorporate a C# front end, so I could have an interactive application while processes run, while still using my PowerShell code?

I can imagine that if I was to try rewriting all the functional code in the background in C#, it wouldn’t be done until 2020!

Really long post, and waffled a bit, but I’d love to see people’s thoughts and knowledge on this 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [October 22, 2015, 2:14am UTC](https://forums.powershell.org/t/what-is-powershell-made-from/5078/2 "2015-10-22T02:14:04Z")

</div>

PowerShell itself is not open-source, but you can easily decompile .NET DLLs into fairly readable C# code using ILSpy, dotPeek, or Reflector. (The first two are free.)

There’s also an SDK for PowerShell with some sample cmdlets and such. I don’t think it’s been updated in quite a while, but compiled cmdlets haven’t changed all that much anyway. A lot of it will look very familiar if you’ve been writing Advanced Functions in PowerShell. (Same Parameter attributes on class properties, something very similar to CmdletBinding(), etc.)

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [October 22, 2015, 2:55am UTC](https://forums.powershell.org/t/what-is-powershell-made-from/5078/3 "2015-10-22T02:55:40Z")

</div>

I’d say if your goal is to build a robust GUI, then C# is a better approach than PowerShell. You can still use PowerShell code from within C# - PowerShell is just a class that you instantiate and ask to run commands. That’s exactly how the Exchange Management Console is built, and how the Active Directory Administration Center is written.

---

<div class="post-metadata">

**Author:** ![steve-ayers](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@steve-ayers](https://forums.powershell.org/u/steve-ayers)\
**Post date:** [October 22, 2015, 5:18am UTC](https://forums.powershell.org/t/what-is-powershell-made-from/5078/4 "2015-10-22T05:18:09Z")

</div>

Thanks for that Dave, I’ll check it out.

Don, do you know if you can use Powershell, like for like in C#? I use variables for storing all kinds of stuff in PowerShell, including scriptblocks. Am I right in thinking I’m going to have to follow C# syntax? In which case I think I’ll need more practise first, but thanks for letting me know.

---

<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:44pm UTC](https://forums.powershell.org/t/what-is-powershell-made-from/5078/5 "2024-05-16T20:44:38Z")

</div>


