Command-Line Interface (CLI):
PowerShell provides a command-line interface where users can run commands interactively.
Scripting Language:
It is also a powerful scripting language that allows for the automation of administrative tasks and configuration management.
Cmdlets:
PowerShell commands, known as cmdlets, follow a Verb-Noun naming convention (e.g., Get-Process, Set-Location). Cmdlets perform specific operations and can be combined in scripts for more complex tasks.
Pipelining:
PowerShell supports pipelining, allowing the output of one cmdlet to be passed as input to another cmdlet. This enables efficient data processing and task automation.
Object-Oriented:
Unlike traditional text-based shells, PowerShell works with objects. This allows for more powerful manipulation of data, as cmdlets can pass .NET objects between each other.
Access to .NET Framework:
Since PowerShell is built on the .NET framework, it can leverage .NET classes and methods, enabling complex operations and integration with other .NET applications.
Cross-Platform:
PowerShell Core, the open-source version of PowerShell, is cross-platform and runs on Windows, macOS, and Linux.
- To check the installed version of PowerShell:
$PSVersionTable.PSVersion
- To get help for a specific cmdlet:
Get-Help Get-Process
- To list all running processes:
Get-Process
- To stop a process by its name:
Stop-Process -Name notepad
- To list all files in a specific directory:
Get-ChildItem -Path C:\Example\Directory
Feel free to explore and practice different PowerShell's commands. Happy coding!