- Windows Command Prompt now defaults to PowerShell, a more powerful tool for IT pros.
- PowerShell is an open-source CLI and scripting language for task automation and configuration.
- PowerShell is not limited to Windows, running on macOS and Linux, making it a versatile tool.
If you’re a frequent user of the Windows Command Prompt, you might have noticed that it now opens up PowerShell by default in Windows 11. This feature has been around for many versions of Windows, and it’s part souped-up command line, part automation tool, and part scripting language. While you can use it to run the same sort of tasks you used to use Command Prompt for, it’s actually much more powerful and is an important tool in many IT professionals’ daily lives.
Microsoft Powershell is best known for running on Windows, but did you know it also can be installed on a Chromebook for development?
What is Microsoft PowerShell?
Microsoft PowerShell, or PowerShell as it’s now known, is an open-source command-line interface (CLI) based tool that can also function as an object-orientated scripting language. This duality makes it great for automating tasks and configurations using code, especially if those tasks need to be repeated with a high degree of accuracy. While the CLI is powerful, the real power is in configuration management, scripting, and task automation.
What is the difference between classic Windows PowerShell and PowerShell?
Windows PowerShell is “stuck” at version 5.1 and will never be updated. It also only runs on Windows. Microsoft built it on top of the .NET 4.5 framework, which is limited to only Windows installations. It is also installed by default on Windows, whereas the newer PowerShell requires a separate installation. PowerShell is now in version 7, is open-source, runs on Windows, Linux, and macOS, has been rewritten on top of the .NET Core framework, and is now using .NET 9.0. While earlier versions of PowerShell had limited compatibility with the full .NET framework, PowerShell 7.x has a new Windows PowerShell Compatibility feature that allows you to use scripts written for Windows PowerShell without problems.
Why would you use it?
The first and most obvious reason is that PowerShell is a CLI replacement for the operating system you’re using. In some ways, it is better than the built in shell, as it can accept and return .NET objects as well as text. Because of this, it’s a powerful tool for task automation in DevOps, and automation is a big part of every major feature in PowerShell.
The second reason is that it can help manage infrastructure as code, which is invaluable for enterprise IT departments. Imagine an IT admin needing to set up multiple laptops with the company’s programs and preferred Windows settings. With a PowerShell script, they can simply run it all on every device instead of wasting hours of manual installation. It can also give the IT admin easy access to data on the network, whether that’s file folders or registries.
The user doesn’t even have to be on the same network in some cases, as PowerShell is often used for remote operations on computers used by hybrid or remote workers. This gives IT admins the ability to set up and install security settings and programs without having to physically touch the laptop or PC.
Do all Windows versions support PowerShell?
While PowerShell is the default command line interface for Windows nowadays, that change occurred only partway through Windows 10’s life cycle. PowerShell has been around for much longer, though, as a second option for CLI on Windows, starting with Windows 7, which preinstalled PowerShell 2.0. The first version of PowerShell was an optional installation for Windows Server 2008. Also, the latest version, PowerShell core, works on macOS and Linux, so it’s not strictly a Windows-only tool anymore.
PowerShell is a powerful way to automate your computer
PowerShell is another powerful tool in any IT professional’s toolbox, but that doesn’t mean you can’t use it at home. It’s just as easy as the Command Prompt for running CLI-only tools, and it can do many more powerful things like removing preinstalled Windows components. It’s not that hard to learn, and there are a wide variety of places you can learn more, from Microsoft’s own developer blogs to third-party course providers. You might not even need to learn anything, as many common tasks are well documented online, so all you should need to do is copy the code and run it.