Subhash
Subhash

Reputation: 762

Run Standalone Windows Powershell

My Application is dependent on PowerShell version 5. But some old windows system have not installed the same version where our application is running. So is there any way to run standalone PowerShell which I put in my application folder. So my application is not dependent on system PowerShell.

Upvotes: 5

Views: 8738

Answers (2)

Kirill Pashkov
Kirill Pashkov

Reputation: 3236

No. You cannot have a portable version of Windows PowerShell for your application.

You also may not be able to install a newer version on an older operating system; e.g., you can't install PowerShell version 5 on Windows XP.

Windows Powershell versions depend on many things, such as OS Version, Microsoft .NET Framework, Windows Management Framework, WS-Management, Windows Management Instrumentation, Common Language Runtime, Graphical User Interface Requirements.

Here is a link with information about Windows PowerShell versions and their requirements.

I'd say it is best if you create your application so that it is compatible with the oldest possible version of PowerShell it will run with. It could be hard and tricky, but it's the only to way to ensure proper backward compatibility.

Upvotes: 0

Clijsters
Clijsters

Reputation: 4256

Disclaimer: We don't know your application and we don't know, why exactly it depends on PowerShell. Further we don't know if it depends on Windows PowerShell or on PowerShell in general. We also don't know if it requires specifically version 5 or would run in newer versions too.


To answer the core of your question:

So is there any way to run standalone PowerShell which I put in my application folder.

Yes, there is!

Microsoft introduced PowerShell Core, which started as a fork and is a cross-platform edition that runs on Windows, macOS, and major Linux distros. You can download PowerShell binary archives from GitHub, extract them and just run pwsh.exe.

Please beware:

While it provides a huge amount of well-known PowerShell-cmdlets and some (most) of the Windows PowerShell behaviour, it is important to know the difference between PowerShell Core and Windows PowerShell. Refer to the repository's README for further resources.

Upvotes: 7

Related Questions