10

Is there a way to bundle PowerShell such that I don't have to install it on the OS? Ideally I'd like to use it in my build process, but I want something that's self-contained; I don't want to rely on each client computer installing PowerShell. I'm thinking I'd build a console app that hosts a PowerShell environment, but bundles the PowerShell assemblies locally.

Assuming it's possible, are there any royalty/licensing issues with such a setup?

1
  • 2
    Today PowerShell is on by default in Windows 7 and Windows Server 2008 R2. If you can limit yourself to those platforms, the problem goes away. Commented Jan 14, 2010 at 20:57

2 Answers 2

7

I'm not sure how much time I'll have to be able to see if the libraries can be somewhat independently copied. You are expecting the .NET Framework 2.0 to be on the machine?

There is some information here: http://karlprosser.com/coder/2008/06/19/portable-powershell-part-2-roll-your-own-plus-a-challenge/

But this isn't officially supported by Microsoft. Microsoft's stance will likely be that you must install PowerShell with the msi/msu or add the feature.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the link, "Portable PowerShell" is exactly what I'm looking for, AND I'm looking to redistribute it, broadly. So, after reading his post, it looks like a) none of the app virtualization tools are free, and b) I wouldn't likely be able to redistribute PowerShell anyway for legal reasons.
Oh, I let me also mention this company/product: specopssoft.com/powershell Something to read up about, especially if you do decide to distribute PowerShell everywheres and don't have a solution like System Center Configuration Manager or SMS.
5

You can host a powershell runtime inside a .net application using the System.Management.Automation dll, but I believe to run this you still need to have access to the powershell runtime on the machine. Unless there is a way to contain the whole runtime inside the applicaiton, which form my research does not seem possible, you will need to install powershell on each machine. If its any consolation, at the minute windows 7 comes with powershell installed by default.

2 Comments

I'm holding off for a while hoping someone else answers with "YES IT'S POSSIBLE! HERE'S HOW!" Otherwise you get the checkmark.
System.Management.Automation.dll IS the PowerShell runtime. PowerShell.exe is just a console interface to that. Hosting the PowerShell runtime in something else was one of the main design goals as stated by the PowerShell team.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.