Powershell Basics
Overview:
The following goes over Powershell and the basics
What is PowerShell?
PowerShell is a powerful task automation and configuration management framework from Microsoft. It includes a command-line shell and scripting language, designed to help professionals control and automate the administration of Windows and applications.
Key Features:
Cmdlets: Lightweight commands within PowerShell.
Pipelines: Pass outputs from one cmdlet as inputs to another.
Scripting Language: Create scripts to automate tasks.
Automation: Simplify complex and repetitive tasks.
Object-Oriented: Operates with objects, not just text.
Basic Command Syntax and Structure
PowerShell commands, or cmdlets, use a Verb-Noun naming convention:
Examples:
Common Verbs:
Get
: Retrieve dataSet
: Change dataNew
: Create a new resourceRemove
: Delete a resourceStart
: Begin an operation
Practical Examples to Get Started
Exercise 1: Open PowerShell
Windows: Search for "PowerShell" in the Start menu and open it.
macOS/Linux: Open your terminal and type
pwsh
to start PowerShell Core.
Exercise 2: Run Basic Commands
List all running processes:
Get help for a cmdlet
Retrieve the current date and time:
Exercise 3: Explore PowerShell Help
Update the help system:
Get detailed help for a cmdlet
Exercise 4: Check Parameters of a Given Command
Last updated