Share via

PowerShell Version

Handian Sudianto 7,201 Reputation points
2026-01-06T00:01:15.7933333+00:00

If we have old powershell version 5 and new version 7, then can we set version 7 as default

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

3 answers

Sort by: Most helpful
  1. Quinnie Quoc 10,730 Reputation points Independent Advisor
    2026-01-07T09:44:27.8733333+00:00

    Hi Handian Sudianto,

    Has your problem been solved? If it has, please hit Accept the answer to support me. If it has not, please tell me more about your issues, I will help you.

    Thank you so much!!

    QQ.

    Was this answer helpful?

    0 comments No comments

  2. Quinnie Quoc 10,730 Reputation points Independent Advisor
    2026-01-06T10:13:40.0933333+00:00

    Dear Handian Sudianto,

    Thank you for your question regarding PowerShell versions. Windows includes Windows PowerShell 5.1 by default, and it cannot be removed because it is part of the operating system. However, you can install PowerShell 7 side‑by‑side and configure it as the default shell for your environment. To do this, you may update shortcuts, change the default terminal profile in Windows Terminal, or adjust Group Policy/registry settings so that PowerShell 7 launches instead of 5.1. For scripts and automation, you can explicitly call pwsh.exe (PowerShell 7) rather than powershell.exe (PowerShell 5.1). This ensures that users and tasks run on PowerShell 7 by default while still keeping 5.1 available for compatibility.

    If this guidance helps you successfully set PowerShell 7 as your default, we kindly ask that you mark this response as “Accept the answer”, so that other administrators can quickly find the solution.

    Thank you so much!!!

    Kind regards,

    QQ.

    Was this answer helpful?

    0 comments No comments

  3. AI answer

    2026-01-06T00:01:26.5233333+00:00

    You can set PowerShell version 7 as the default by modifying your system's environment variables or by creating a shortcut that points to the PowerShell 7 executable. However, it's important to note that PowerShell 7 installs side-by-side with Windows PowerShell 5.1, meaning you can choose which version to run based on how you invoke PowerShell.

    For example, you can create a shortcut on your desktop that points to the PowerShell 7 executable (usually located in C:\Program Files\PowerShell\7\pwsh.exe). This way, when you use that shortcut, it will open PowerShell 7 by default.

    Additionally, if you are using scripts or automation tools, you may need to specify which version of PowerShell to use in those contexts, as some tools may default to the older version unless specified otherwise.

    For more detailed guidance on using PowerShell 7 alongside Windows PowerShell 5.1, you can refer to the migration documentation.

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.