Description #
PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and a scripting language. It is built on .NET and is especially powerful for system administration, automation, and managing Windows, Azure, and Active Directory environments.
History #
PowerShell was first released in 2006 as part of Windows PowerShell 1.0. It was designed to replace legacy tools like Command Prompt and VBScript by offering more modern scripting capabilities.
Major milestones:
- PowerShell 2.0 (2009) – introduced remoting and modules
- PowerShell 5.1 (2016) – final version bundled with Windows
- PowerShell Core 6+ – cross-platform and open-source
- PowerShell 7+ – unifies legacy Windows PowerShell and cross-platform .NET Core version
Today, PowerShell is cross-platform (Windows, macOS, Linux), open source, and a staple in DevOps and enterprise environments.
Hello World Code #
Write-Output "Hello, World!"
Or, alternatively:
"Hello, World!"
How to Run #
On Windows: #
- Open PowerShell (Start → type
powershell
) - Run:
Write-Output "Hello, World!"
Using a script file: #
- Save as
hello.ps1
- Run with:
.\hello.ps1
📝 You may need to enable script execution:
Set-ExecutionPolicy RemoteSigned
Key Concepts #
[⚠️ Suspicious Content] Write-Output — prints output to the console
Cmdlets — built-in functions like Get-Process or Get-Help
Verb-Noun syntax — standard command naming style
Pipelines — output from one command passed into another using |
Objects over text — unlike Bash, PowerShell passes structured objects
Aliases — shorthand like ls, dir, cp for cross-compatibility
.ps1 files — script files for execution
Cross-platform — runs on Windows, macOS, Linux
Module system — reusable libraries for specific tasks
Secure by default — execution policies to prevent malicious scripts
Try It Online #
🔗 PowerShell Online Editor – TutorialsPoint
🔗 Playground – Azure Cloud Shell
🔗 Replit – PowerShell
Fun Facts #
PowerShell is now open-source and developed on GitHub
It’s used to manage Windows servers, Azure cloud, Office 365, and more
PowerShell can access the full .NET framework
You can build GUIs, scripts, or even web servers with PowerShell
The name “PowerShell” was chosen to reflect its command-line strength