I had accidentally removed Windows PowerShell while trying to upgrade to the latest PowerShell Core and following instructions to remove the AzureRM module with the new Az module. I looked into installing Windows PowerShell on Windows 10, but it appears to not be possible to do so individually.
So, I installed Windows Powershell Core 6.xx instead. Now, when I check the Installed App in the Control Panel, PowerShell 6.xx is there, but when I check the version of Windows PowerShell in the console, it is still 5.1.xx.
What am I doing wrong or what am I missing? I’m a bit confused, as I am unable to install WMF 5.1 on Windows 10.
I was trying to reinstall Windows PowerShell on Windows 10 after I accidentally removed it. I was trying to upgrade to latest PowerShell Core and in the instructions to remove AzureRM module with the new Az module, I removed the Windows PowerShell on Windows 10.
3 Answers
Introduction
Windows PowerShell is a task automation and configuration management framework from Microsoft. It is built on the .NET framework and is used to perform administrative tasks on Windows operating systems. PowerShell Core is the open-source version of PowerShell and is cross-platform. It can run on Windows, Linux, and macOS. In this blog post, we will discuss where to find Windows PowerShell on Windows 10 and what to do if it is accidentally removed.
Windows PowerShell on Windows 10
Windows PowerShell is included in Windows 10 by default. It can be accessed by searching for “PowerShell” in the Start Menu or by pressing the Windows key + X and selecting “Windows PowerShell” or “Windows PowerShell (Admin)” from the menu. The “Admin” option allows you to run PowerShell with administrative privileges.
If you cannot find Windows PowerShell on your Windows 10 computer, it may have been accidentally removed. In this case, you can reinstall it by following the steps below.
Reinstalling Windows PowerShell on Windows 10
1. Open the Start Menu and search for “Windows PowerShell”.
2. Right-click on “Windows PowerShell” and select “Run as Administrator”.
3. In the PowerShell console, type the following command and press Enter:
Get-AppxPackage Microsoft.PowerShell | Remove-AppxPackage
This command will remove the Windows PowerShell app from your computer.
4. Download the latest version of Windows PowerShell from the Microsoft website.
5. Double-click on the downloaded file to start the installation process.
6. Follow the on-screen instructions to complete the installation.
Once the installation is complete, you can access Windows PowerShell by searching for it in the Start Menu or by pressing the Windows key + X and selecting “Windows PowerShell” or “Windows PowerShell (Admin)” from the menu.
Installing Windows PowerShell Core on Windows 10
If you are unable to install Windows PowerShell on Windows 10, you can install Windows PowerShell Core instead. PowerShell Core is a cross-platform version of PowerShell that can run on Windows, Linux, and macOS.
To install PowerShell Core on Windows 10, follow the steps below.
1. Download the latest version of PowerShell Core from the Microsoft website.
2. Double-click on the downloaded file to start the installation process.
3. Follow the on-screen instructions to complete the installation.
Once the installation is complete, you can access PowerShell Core by searching for it in the Start Menu or by pressing the Windows key + X and selecting “PowerShell Core” or “PowerShell Core (Admin)” from the menu.
Checking the Version of Windows PowerShell
To check the version of Windows PowerShell installed on your computer, open PowerShell and type the following command:
$PSVersionTable.PSVersion
This will display the version of PowerShell installed on your computer. If you have both Windows PowerShell and PowerShell Core installed, you can use the following command to check the version of PowerShell Core:
$PSVersionTable.PSEdition
Conclusion
Windows PowerShell is a powerful tool for managing and automating tasks on Windows operating systems. It is included in Windows 10 by default and can be accessed by searching for “PowerShell” in the Start Menu or by pressing the Windows key + X. If you accidentally remove Windows PowerShell, you can reinstall it by following the steps outlined in this blog post. If you are unable to install Windows PowerShell on Windows 10, you can install PowerShell Core instead.
That‘s a great question! It sounds like you‘re doing everything right, but unfortunately it‘s not possible to install WMF 5.1 on Windows 10. Instead, what you can do is install PowerShell Core 6.xx and then use the Windows Compatibility Module to run your PowerShell 5.1 scripts in the PowerShell Core environment.
That should help you get up and running with the latest version of PowerShell Core while still being able to use your PowerShell 5.1 scripts.
To install PowerShell Core 6.xx on Windows 10, you can download the official Microsoft Installer from the Microsoft website.
Once it‘s installed, you‘ll be able to access the PowerShell Core environment from the Windows Start Menu.
Once you‘re in the PowerShell Core environment, you can then use the Windows Compatibility Module to run your PowerShell 5.1 scripts.
To do this, you‘ll need to install the Windows Compatibility Module for PowerShell Core 6.xx. This module is available on the Microsoft website, and you can find more information on how to install it here: https://docs.microsoft.com/en–us/powershell/scripting/setup/windows–powershell–compatibility–module?view=powershell–7.
Once the Windows Compatibility Module is installed, you‘ll be able to use the Windows PowerShell 5.1 cmdlets in the PowerShell Core environment.
With the Windows Compatibility Module, you‘ll be able to access all of your PowerShell 5.1 scripts, as well as any other scripts that rely on the PowerShell 5.1 cmdlets.
Hope this helps!
I was trying to reinstall Windows PowerShell on Windows 10 after I accidentally removed it.
Since Windows 10 does not allow the uninstallation of PowerShell 5.1.
I was trying to upgrade to latest PowerShell Core and in the instructions to remove AzureRM module with the new Az module, I removed the Windows PowerShell on Windows 10.
What I removed was PowerShell Core, which is a version of PowerShell 5.1 that is installed independently and alongside Windows PowerShell.
Now, I see PowerShell 6.XX in my installed apps instead of Windows PowerShell (which was there before I uninstalled it).
When PowerShell Core is installed, there will be two different PowerShell desktop applications, one for Windows PowerShell and the other for PowerShell Core.
Now, when I check the Installed App in the Control Panel, PowerShell 6.xx is there, but when I check the version of Windows PowerShell in the console, it is still 5.1.xx.
It appears that you are confused about the difference between PowerShell Core and Windows PowerShell. Windows PowerShell is built into Windows 10 and cannot be installed or removed. However, PowerShell Core can be installed and is the Desktop application, PowerShell 6
.
If you have installed PowerShell Core, you will see version 6.XX under the Installed Apps in the Control Panel. When you launch a Windows PowerShell command prompt, you will see version 5.1.XX.
It is important to note that uninstalling Windows PowerShell 2.0 on Windows 10 does not uninstall the default version of Windows PowerShell
that comes with the operating system. This version of Windows PowerShell, which has been included in Windows since Windows 8, cannot be uninstalled. Instead, you can only uninstall the version of Windows PowerShell that comes with the applicable version of the Windows Management Framework by uninstalling the Windows Management Framework itself.
For example, if you installed Windows Management Framework 5.1, it did not “reinstall” Windows PowerShell, as it was never actually uninstalled. Windows has long used PowerShell scripts to perform certain actions, which is why the default version of Windows PowerShell can’t be uninstalled.
For security reasons, you may want to uninstall the Windows PowerShell 2.0
Engine if you do not need it for legacy PowerShell scripts.
Here is an example of two PowerShell command prompts running simultaneously to demonstrate that Windows PowerShell and PowerShell Core are indeed distinct from one another.