PowerShell - Simply Explained


PowerShell is Microsoft's powerful command-line shell and scripting language that allows IT professionals, administrators, and developers to automate repetitive tasks, manage systems at scale, and control nearly every aspect of Windows, Azure, and Microsoft 365. While many people think of it as a tool only for programmers, PowerShell is really about saving time by replacing repetitive clicks with repeatable, reliable automation.
In this episode of Microsoft Knowledge Nuggets, Mirko Peters explains PowerShell in plain English and demonstrates why it remains one of the most valuable skills for anyone working with Microsoft technologies. You'll learn how PowerShell differs from the traditional Command Prompt, why it works with objects instead of plain text, and how simple commands can automate tasks that would otherwise take hours to complete manually. The episode introduces essential concepts such as cmdlets, pipelines, variables, modules, scripts, and remoting, making them easy to understand even for beginners.
The discussion explores practical Microsoft 365 and Azure scenarios, including user provisioning, license management, reporting, Exchange Online administration, Microsoft Entra ID, and infrastructure automation. You'll discover how PowerShell integrates with Microsoft Graph, Azure, Windows Server, and cloud services to improve consistency, reduce human error, and simplify large-scale administration. Rather than replacing graphical tools, PowerShell complements them by enabling repeatable, enterprise-grade automation.
Whether you're an IT administrator, cloud engineer, Microsoft 365 professional, or someone just beginning your automation journey, this episode provides a practical introduction to PowerShell, its core concepts, real-world use cases, and best practices. By the end, you'll understand why PowerShell continues to be one of the most essential technologies for managing modern Microsoft environments efficiently and at scale.
PowerShell is a powerful automation platform from Microsoft that helps you manage systems more efficiently. If you’re a system administrator or developer, you’ll find it invaluable for automating tasks and simplifying workflows. Plus, PowerShell isn’t just for experts; its user-friendly design makes it easy for beginners to dive in. Whether you’re looking to streamline your daily tasks or explore advanced automation techniques, PowerShell has something to offer everyone.
Tip: Start with simple tutorials to get comfortable with the basics. You’ll be amazed at how quickly you can leverage its capabilities!
Key Takeaways
- PowerShell is a powerful automation tool that simplifies system management for both beginners and experts.
- Start learning PowerShell with simple tutorials to build a strong foundation in its capabilities.
- Cmdlets are the core commands in PowerShell, following a verb-noun format for easy understanding and use.
- Pipelining allows you to chain cmdlets together, enabling complex operations in a single command line.
- PowerShell's cross-platform capabilities let you manage systems on Windows, macOS, and Linux seamlessly.
- Automate repetitive tasks with PowerShell scripts to save time and reduce manual errors.
- Use the
Get-Helpcmdlet to access detailed information about any command and enhance your learning. - Explore community resources and books to deepen your PowerShell knowledge and skills.
What Is PowerShell?

Overview of PowerShell
PowerShell is a cross-platform task automation solution that combines a command-line shell, a scripting language, and a configuration management framework. This powerful tool allows you to automate system management tasks effectively. With PowerShell, you can streamline your workflows and manage various services, including Microsoft 365 and Azure, all from a single interface. Its design focuses on making automation accessible, whether you're a seasoned IT professional or just starting out.
Key Features
PowerShell boasts several features that set it apart from other automation tools. Here are some of the most notable ones:
| Feature | Description |
|---|---|
| Cmdlets | Core components that perform specific tasks using a Verb-Noun naming convention. |
| Parameters | Modify the behavior of cmdlets, identified by a hyphen ( - ), and can accept values or act as switches. |
| Pipelines | Allow passing output from one cmdlet to another, enabling complex operations through chaining. |
These features empower you to create dynamic scripts that can adapt to various scenarios. For instance, you can use cmdlets to retrieve system information or manage services with ease.
PowerShell vs. Command-Line
When comparing PowerShell to traditional command-line interfaces, you'll notice significant differences in functionality. Here’s a quick breakdown:
| Feature/Functionality | PowerShell | Command Prompt |
|---|---|---|
| Type | Object-oriented shell and scripting language | Command-line interpreter |
| Automation | Advanced automation capabilities | Basic automation through batch files |
| Command Structure | Uses Cmdlets (command-lets) | Uses built-in commands |
| Data Handling | Works with objects and structured data | Primarily text-based command handling |
| Use Case | Configuration management and complex scripting | Routine administration tasks |
PowerShell's object-oriented approach allows you to handle rich, structured data, enhancing your automation capabilities. Unlike traditional command-line interfaces that focus on text, PowerShell enables seamless data manipulation and command chaining. This leads to increased efficiency in data processing and task automation.
Getting Started with PowerShell

Opening Windows PowerShell
Getting started with PowerShell is easy! Here’s how you can open it on different platforms:
- Windows: Open the Start menu, type 'Windows PowerShell', select it, and click 'Open'.
- macOS: First, install PowerShell. Then, launch it by typing
pwshin the terminal. - Linux: Install PowerShell using your package manager. After that, launch it by typing
pwshin the terminal.
Tip: For Debian/Ubuntu-based systems, you can follow these commands to install PowerShell:
sudo apt-get install -y wget apt-transport-https software-properties-common sudo apt update && \ sudo apt install -y wget gnupg && \ wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc && \ sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://packages.microsoft.com/ubuntu/22.04/prod jammy main" sudo apt update && sudo apt install -y powershellAfter installation, just type
pwshto start using PowerShell!
Navigating the Command-Line
Once you have PowerShell open, you’ll want to get familiar with navigating the command-line. This is where you can execute commands and manage files.
Basic Navigation Commands
Here are some essential commands to help you navigate:
- Get-ChildItem: This command displays items in the current directory. Think of it as the equivalent of listing files in a folder.
- Set-Location (also known as
slorcd): Use this command to change the current directory. It’s like moving from one folder to another.
PowerShell's navigation is similar to managing files and folders on your computer. You can think of it as a command-line interface that allows you to interact with your file system in a scriptable way.
Understanding File Structure
Understanding the file structure is crucial for effective navigation. Here’s a quick overview of how PowerShell handles files:
| Command | Description |
|---|---|
ls | Lists the contents of the current directory. |
cd | Changes the current directory. |
Unlike traditional file explorers that use a graphical interface, PowerShell provides a command-line interface for navigation. This means you can automate tasks and manage files more efficiently.
Note: PowerShell allows you to manipulate items just like you would in a graphical file explorer, but with the added benefit of scripting capabilities. This makes it a powerful tool for both beginners and advanced users.
Summary
Now that you know how to open PowerShell and navigate the command-line, you’re ready to start exploring its capabilities. Practice using these commands, and soon you’ll feel comfortable managing files and executing scripts in PowerShell!
File Management in PowerShell
Managing files in PowerShell is straightforward and efficient. You can create, copy, move, and read files using simple commands. Let’s dive into these essential tasks.
Creating and Managing Files
Creating and managing files is a fundamental part of using PowerShell. Here are some key commands you’ll find useful:
| Command | Description |
|---|---|
| Get-Content | Reads the content of a file. |
| Set-Content | Writes content to a file. |
| Get-Acl | Retrieves the NTFS Access Control Lists for a file. |
| Set-Acl | Changes the NTFS Access Control Lists for a file. |
| Set-Location | Changes the current directory. |
With these commands, you can automate various tasks. For example, you might want to automate file maintenance through scheduled scripts or compress files to save space. Here are some practical examples of what you can do:
- Automate file maintenance through scheduled scripts.
- Compress and archive files to optimize storage.
- Implement error handling in file transfers to ensure reliability.
- Dynamically rename files based on timestamps or attributes.
- Integrate version control systems for tracking changes in files.
- Conduct permission audits to maintain security compliance.
Copying and Moving Files
Copying and moving files is another essential function in PowerShell. You can easily transfer files between locations using commands. Here’s a quick look at some commands you can use:
| Command | Description |
|---|---|
| Copy-Item | Used to copy files from one location to another, specifying source and destination parameters. |
| Example Command | Copy-Item –Path C:\Folder1\file1.txt –Destination '\\SERVER1\c$' |
| Comparison to GUI | This command performs the same function as dragging and dropping files in a graphical interface. |
You can automate file copying and moving with scripts. Here’s a simple process you might follow:
- Create a PowerShell script to copy files.
- Define source and destination paths as parameters.
- Use Windows Task Scheduler to automate the execution of the script.
Here are some commands to help you get started:
| Command | Description |
|---|---|
Copy-Item C:\Scriptstest.txt C:\Test | Copies a single file to a new location. |
Copy-Item C:\Scripts C:\Test -Recurse | Copies all files and folders from the source to the destination. |
Move-Item C:\Scriptstest.zip C:\Test -Force | Moves a file and overwrites if it exists. |
Move-Item C:\Scriptstest.log C:\Testad.log | Moves and renames a file simultaneously. |
Reading Files with Scripting
Reading files is crucial for processing data. PowerShell makes this easy with commands like Get-Content. You can inspect file contents and search for specific data, such as error codes or configuration settings. Here are some benefits of using PowerShell for reading files:
- PowerShell can inspect file contents, enabling selective searches for specific data.
- The
Select-Stringcmdlet allows scanning large files for patterns, which can be integrated into automation workflows. - Scripts can automate file management tasks based on conditions, such as archiving files older than a specified date.
Using PowerShell for file reading tasks offers advantages over other scripting languages. For instance, it handles structured data better and provides robust error management. Here’s a comparison:
| Advantage | PowerShell | Other Scripting Languages |
|---|---|---|
| Data Handling | Structured data handling | Plain text handling |
| Error Management | Better error management | Limited error handling |
| Object-Oriented | Works with objects | Text-based processing |
| Scalability | Strong in enterprise settings | Often fragile in scaling |
| Standardization | Supports consistent naming and reuse | Less standardized |
With these tools at your disposal, you can manage files effectively and automate your workflows in PowerShell.
Automating Administrative Tasks
PowerShell shines when it comes to automating administrative tasks. You can streamline your workflows and save time by using cmdlets, which are the building blocks of PowerShell automation.
Introduction to Cmdlets
Cmdlets are lightweight commands in PowerShell that follow a verb-noun format. This structure makes them easy to understand and use. Here are some key points about cmdlets:
- They are implemented as .NET classes compiled into assemblies.
- Each cmdlet includes parameters for customization, allowing you to tailor commands to your needs.
- Unlike traditional commands, cmdlets are object-oriented and can be piped, enhancing their functionality.
To create a binary cmdlet, you would implement a class that derives from specialized cmdlet base classes. You'd declare an attribute to identify the class as a cmdlet and define public properties as cmdlet parameters with appropriate attributes. This structure allows you to override input processing methods to handle records effectively.
Common Cmdlets for Automation
You’ll find many cmdlets useful for automating tasks. Here are a few common ones:
- Get-Process: Retrieves a list of processes running on your system.
- Stop-Process: Stops a running process by its ID or name.
- Get-Service: Lists all services on your system, showing their status.
- Start-Service: Starts a service that is currently stopped.
These cmdlets help you manage system configurations efficiently. For example, you can automate bulk changes to user permissions or configurations. With PowerShell, you can run a single script to update thousands of users, significantly reducing manual work.
Pipelining in PowerShell
Pipelining is one of the most powerful features of PowerShell. It allows you to chain cmdlets together, enabling complex operations in a single line. Here’s how pipelining enhances automation:
- You can filter and sort data easily, which boosts data management efficiency.
- Complete objects pass through the pipeline, allowing for sophisticated processing compared to text-based systems.
For instance, you might assign site collection administration in SharePoint using PowerShell. This task can be automated to avoid manual entry through the SharePoint admin center. By leveraging pipelining, you can create scripts that perform multiple actions seamlessly.
Practical Applications of PowerShell
Scripting Basics
PowerShell scripting simplifies your daily tasks and boosts efficiency. By automating repetitive administrative tasks, you can focus on more strategic initiatives. Here’s how PowerShell scripts help:
- They automate workflows, enhancing speed and repeatability.
- You can shift your attention from manual operations to more critical tasks.
- Automation scripts transform complex IT operations into streamlined processes, significantly reducing time spent on repetitive tasks.
With these benefits, you can see why learning PowerShell scripting is a game-changer for IT professionals.
Managing Microsoft Services
PowerShell is a powerful tool for managing various Microsoft services. You can perform a wide range of tasks efficiently. Here’s a quick look at some common use cases:
| Microsoft Service | Common Use Cases |
|---|---|
| Exchange Online | Mailbox configuration and maintenance |
| Teams | User onboarding and offboarding |
| SharePoint Online | Service provisioning and management |
| Azure | Administration and access control changes |
| Active Directory | User and group administration |
| Entra ID | Licensing and compliance evidence collection |
Using PowerShell, you can handle user onboarding and offboarding across Entra ID and Active Directory. You can also manage Microsoft 365 licensing and service provisioning with ease. The ability to perform bulk operations means you can update hundreds or thousands of users quickly, saving you time compared to using the GUI. Plus, PowerShell provides unique configuration options that aren’t available in the Microsoft 365 admin center.
Cross-Platform Capabilities
One of the standout features of PowerShell is its cross-platform automation framework. You can run PowerShell Core on Windows, macOS, and Linux, making it a versatile tool for diverse environments. Here’s how you can get started:
| Platform | Download Link | Installation Instructions |
|---|---|---|
| Windows 10 | Download | How to Install |
| Ubuntu 16.04 | Download | How to Install |
| macOS | Download | How to Install |
PowerShell serves as a common automation language for setting up developer workstations across different operating systems. Built-in variables like $isLinux, $isMac, and $isWindows allow you to create dynamic scripts based on the detected OS. This adaptability showcases PowerShell's strength in cross-platform environments.
In this blog, you’ve discovered the power of PowerShell as a versatile automation platform. You learned how to navigate its command-line interface, manage files, and automate administrative tasks. By mastering key PowerShell commands, you can enhance your productivity and streamline your daily IT operations.
Now, it’s time to dive deeper! Explore various tutorials and practice using commands to solidify your skills. Here are some recommended resources to help you on your journey:
Books for Beginners:
Advanced Books:
Community Resources:
By leveraging these resources, you can continue to grow your PowerShell expertise and automate tasks more efficiently. Happy scripting! π
FAQ
What is PowerShell used for?
PowerShell is a versatile automation platform. You can use it for managing systems, automating tasks, and configuring services across various Microsoft products.
How can I learn PowerShell?
You can start with online tutorials and resources. Websites like Microsoft Learn offer structured paths to help you grasp PowerShell concepts quickly.
Is PowerShell available on Linux?
Yes! PowerShell is cross-platform. You can install it on Linux and macOS, allowing you to manage systems across different environments.
Can I run PowerShell scripts remotely?
Absolutely! PowerShell supports remote management. You can execute scripts on remote machines, making it easier to manage multiple systems.
What are cmdlets in PowerShell?
Cmdlets are specialized commands in PowerShell. They follow a verb-noun format, making them easy to understand and use for various tasks.
How do I get help with PowerShell commands?
You can use the Get-Help cmdlet. Just type Get-Help <cmdlet-name> in PowerShell to access detailed information about any command.
Can I automate tasks with PowerShell?
Yes! PowerShell excels at automation. You can create scripts to perform repetitive tasks, saving you time and reducing errors.
What is the best way to start scripting in PowerShell?
Begin with simple scripts. Focus on automating small tasks first, then gradually build more complex scripts as you gain confidence.
π Want to be part of m365.fm?
Then stop just listening… and start showing up.
π Connect with me on LinkedIn and let’s make something happen:
- ποΈ Be a podcast guest and share your story
- π§ Host your own episode (yes, seriously)
- π‘ Pitch topics the community actually wants to hear
- π Build your personal brand in the Microsoft 365 space
This isn’t just a podcast — it’s a platform for people who take action.
π₯ Most people wait. The best ones don’t.
π Connect with me on LinkedIn and send me a message:
"I want in"
Let’s build something awesome π
1
00:00:00,000 --> 00:00:03,800
Welcome to another episode of Microsoft Knowledge Nuggets on M365.
2
00:00:03,800 --> 00:00:05,320
FM, I'm your host, Mirko Peters.
3
00:00:05,320 --> 00:00:09,560
What if I told you there's a tool already sitting on your computer that can automate almost anything?
4
00:00:09,560 --> 00:00:11,080
Think about your typical workday.
5
00:00:11,080 --> 00:00:15,000
You log in and open a few applications, click through the same menus you clicked yesterday,
6
00:00:15,000 --> 00:00:17,080
run the same reports, check the same services.
7
00:00:17,080 --> 00:00:20,800
Maybe you spend an hour doing something that feels like it should take five minutes.
8
00:00:20,800 --> 00:00:22,680
That tool I'm talking about is PowerShell.
9
00:00:22,680 --> 00:00:26,600
By the end of this episode, you'll understand what PowerShell actually is,
10
00:00:26,800 --> 00:00:31,240
how its commands work and why it's the hidden superpower of the Microsoft ecosystem.
11
00:00:31,240 --> 00:00:34,920
We'll start with the basic idea, work through the building blocks, and by the end,
12
00:00:34,920 --> 00:00:37,040
you'll have real automation you can use today.
13
00:00:37,040 --> 00:00:39,880
The big picture, what PowerShell actually is.
14
00:00:39,880 --> 00:00:41,400
So what exactly is PowerShell?
15
00:00:41,400 --> 00:00:43,960
Most people hear the name and think it's just a fancy command prompt.
16
00:00:43,960 --> 00:00:46,560
It's not. PowerShell is a full automation platform.
17
00:00:46,560 --> 00:00:49,640
Think of it as a command line shell, a scripting language,
18
00:00:49,640 --> 00:00:51,600
and a remote management tool all in one.
19
00:00:51,600 --> 00:00:53,960
In the command line shell, you type commands and get results,
20
00:00:54,160 --> 00:00:57,280
but it's also a scripting language that lets you write programs that run on their own
21
00:00:57,280 --> 00:01:01,360
and a remote management tool that controls dozens or hundreds of machines from a single window.
22
00:01:01,360 --> 00:01:06,240
20 years ago, automating something on Windows meant using a mess of different tools.
23
00:01:06,240 --> 00:01:08,280
You used batch files for simple tasks,
24
00:01:08,280 --> 00:01:12,120
VB script for more complex ones and separate admin consoles for exchange,
25
00:01:12,120 --> 00:01:13,720
Active Directory and file servers.
26
00:01:13,720 --> 00:01:15,200
None of them talk to each other.
27
00:01:15,200 --> 00:01:19,120
You'd copy data from one tool, paste it into another, and hope nothing got lost.
28
00:01:19,120 --> 00:01:21,000
PowerShell changed all that.
29
00:01:21,000 --> 00:01:22,440
It's one tool that talks to everything.
30
00:01:22,440 --> 00:01:27,560
Windows itself, Azure, Microsoft 365, Exchange, Teams, SharePoint, Active Directory,
31
00:01:27,560 --> 00:01:29,120
and even Linux machines now.
32
00:01:29,120 --> 00:01:32,800
You use the same language, the same patterns, the same commands, no matter what you're targeting.
33
00:01:32,800 --> 00:01:34,040
And it's cross platform.
34
00:01:34,040 --> 00:01:36,920
PowerShell 7 runs on Windows, Linux and Mac OS.
35
00:01:36,920 --> 00:01:39,200
So in a mixed environment, you don't need to switch tools.
36
00:01:39,200 --> 00:01:40,040
Here's the thing.
37
00:01:40,040 --> 00:01:44,400
If you work in IT, PowerShell is the language of the Microsoft ecosystem.
38
00:01:44,400 --> 00:01:47,360
It's how you talk to your infrastructure and automate the boring stuff,
39
00:01:47,360 --> 00:01:49,240
so you can focus on the interesting problems.
40
00:01:49,240 --> 00:01:50,880
But before we get into what it can do,
41
00:01:51,080 --> 00:01:52,760
let's look at how it actually works.
42
00:01:52,760 --> 00:01:55,880
The verb noun pattern, how PowerShell commands work.
43
00:01:55,880 --> 00:01:59,160
Every PowerShell command follows a simple pattern called verb noun,
44
00:01:59,160 --> 00:02:00,680
and it's exactly what it sounds like.
45
00:02:00,680 --> 00:02:02,520
The verb tells you what you want to do.
46
00:02:02,520 --> 00:02:06,200
Get set, new, remove, start, stop.
47
00:02:06,200 --> 00:02:11,040
And the noun tells you what you're targeting like process, service, user, item, or mailbox.
48
00:02:11,040 --> 00:02:15,520
So get process gets you a list of running processes, get service shows you all the services on your machine.
49
00:02:15,520 --> 00:02:19,000
Set date changes the system time, stop service stops the service.
50
00:02:19,040 --> 00:02:23,720
The pattern is so consistent that once you learn it, you can guess commands you've never seen before.
51
00:02:23,720 --> 00:02:27,960
Want to start a service type start service need to remove a user type remove user.
52
00:02:27,960 --> 00:02:29,520
It's that straightforward.
53
00:02:29,520 --> 00:02:34,160
PowerShell was designed to be discoverable, so you don't need to memorize hundreds of commands.
54
00:02:34,160 --> 00:02:39,080
Your best friend here is the get command CMD let run get command noun service.
55
00:02:39,080 --> 00:02:44,440
And it shows you every command that works with services get service, start service, stop service,
56
00:02:44,440 --> 00:02:47,200
restart service, set service, new service, remove service.
57
00:02:47,400 --> 00:02:50,440
All of them right there just by asking, let me give you a concrete example.
58
00:02:50,440 --> 00:02:52,800
Say you want to know what commands can manage processes.
59
00:02:52,800 --> 00:02:54,560
You run get command noun process.
60
00:02:54,560 --> 00:02:58,760
You get back get process, start process, stop process, debug process, wait process.
61
00:02:58,760 --> 00:03:04,240
You don't need to guess the tool tells you that's what makes power shells so different from old school command line tools
62
00:03:04,240 --> 00:03:06,320
where you had to memorize every flag and switch.
63
00:03:06,320 --> 00:03:07,600
And here's why that matters.
64
00:03:07,600 --> 00:03:10,080
You don't learn power shell by memorizing a thousand commands.
65
00:03:10,080 --> 00:03:12,680
You learn the pattern and you can figure out the rest as you go.
66
00:03:12,680 --> 00:03:16,440
It's like learning that every verb in a language follows the same conjugation.
67
00:03:16,480 --> 00:03:21,960
Once you know the rule, you can apply it anywhere, but this is where power shell really breaks away from everything else.
68
00:03:21,960 --> 00:03:24,240
Objects not text, the game changer.
69
00:03:24,240 --> 00:03:28,880
So here's the thing that makes power shell fundamentally different from every command line tool that came before it.
70
00:03:28,880 --> 00:03:33,920
Traditional command lines output text, you run a command and get lines of characters on your screen.
71
00:03:33,920 --> 00:03:34,680
And that's it.
72
00:03:34,680 --> 00:03:41,520
If you want to do something with that output, you have to pass it, cut it up, extract the parts you need using string manipulation and it's fragile.
73
00:03:41,520 --> 00:03:44,520
One space out of place and your whole script breaks.
74
00:03:44,680 --> 00:03:46,160
Power shell doesn't work that way.
75
00:03:46,160 --> 00:03:49,240
It gives you objects structured data with properties and methods.
76
00:03:49,240 --> 00:03:51,520
When you run get process, you don't get a text table.
77
00:03:51,520 --> 00:03:52,800
You get process objects.
78
00:03:52,800 --> 00:03:57,240
Each one has properties like name, ID, CPU, memory, start time and methods like kill.
79
00:03:57,240 --> 00:04:00,440
You can pull those properties filter on them, sort them, export them.
80
00:04:00,440 --> 00:04:05,000
You can do things with the data that would take 20 lines of text passing in a single command.
81
00:04:05,000 --> 00:04:06,160
That's the game changer.
82
00:04:06,160 --> 00:04:09,840
Let me show you the old way using command prompts task list command.
83
00:04:09,840 --> 00:04:10,920
You get a text table.
84
00:04:10,920 --> 00:04:15,800
If you want to find processes using more than 50 CPU, you have to write passing logic.
85
00:04:15,800 --> 00:04:20,640
You have to account for column widths, spacing, headers, it's messy and it breaks constantly.
86
00:04:20,640 --> 00:04:22,200
The power shell way looks like this.
87
00:04:22,200 --> 00:04:25,880
Get process piped away object with a condition, piped to export CSV.
88
00:04:25,880 --> 00:04:30,880
That's one line filter only processes using more than 50 CPU, save to a CSV file done.
89
00:04:30,880 --> 00:04:34,840
What makes this all work is the get member Cmd let you pipe any command to get member
90
00:04:34,840 --> 00:04:37,120
and it shows you every property and method those objects have.
91
00:04:37,120 --> 00:04:38,640
It's like peaking under the hood.
92
00:04:38,640 --> 00:04:40,280
Run get process, get member.
93
00:04:40,280 --> 00:04:45,840
And suddenly you see everything name, id, handle, CPU, working set, start time.
94
00:04:45,840 --> 00:04:49,720
And methods like kill, refresh, wait for exit, you don't have to guess what data is available.
95
00:04:49,720 --> 00:04:51,760
The tool tells you here's a real world scenario.
96
00:04:51,760 --> 00:04:53,800
Say you're an admin managing 50 servers.
97
00:04:53,800 --> 00:04:56,560
You need to find all stop services across all of them.
98
00:04:56,560 --> 00:04:59,240
The old way you'd remote into each server open services.
99
00:04:59,240 --> 00:05:01,120
MSC check manually write it down.
100
00:05:01,120 --> 00:05:02,320
That takes hours.
101
00:05:02,320 --> 00:05:08,400
The power shell way you write one command, get servers on each machine, filter where status is stopped, export to a CSV.
102
00:05:08,400 --> 00:05:11,160
One command, 50 servers, same result every time.
103
00:05:11,160 --> 00:05:15,520
No clicking through GUIs, no manual note taking, no mistakes from copying data between windows.
104
00:05:15,520 --> 00:05:16,640
And here's why this matters.
105
00:05:16,640 --> 00:05:19,080
Object output means you can chain commands together.
106
00:05:19,080 --> 00:05:23,360
The output from one command feeds directly into the next as structured data.
107
00:05:23,360 --> 00:05:25,640
You're not passing text, you're manipulating objects.
108
00:05:25,640 --> 00:05:30,400
It's the difference between sorting through a pile of loose papers and working with a filing cabinet
109
00:05:30,400 --> 00:05:31,920
where everything has a label.
110
00:05:31,920 --> 00:05:33,640
So now you know the pattern and the pipeline.
111
00:05:33,640 --> 00:05:35,960
Let's talk about the commands you'll actually use.
112
00:05:35,960 --> 00:05:37,680
The five essential Cmdlet groups.
113
00:05:37,680 --> 00:05:40,800
You don't need to learn hundreds of Cmdlets to be productive with power shell.
114
00:05:40,800 --> 00:05:45,080
Start with five groups and you'll cover about 80% of what you'll do day to day.
115
00:05:45,080 --> 00:05:46,320
Group one is discovery.
116
00:05:46,320 --> 00:05:49,880
It's the most important because it teaches you power shell from within itself.
117
00:05:49,880 --> 00:05:51,800
Get help, get command, get member.
118
00:05:51,800 --> 00:05:53,160
These three are your learning tools.
119
00:05:53,160 --> 00:05:56,440
You don't need to memorize anything because you can always look it up.
120
00:05:56,440 --> 00:05:58,240
Get help shows you how to use any command.
121
00:05:58,240 --> 00:06:02,560
Get command shows you what commands exist and get member shows you what data those commands output.
122
00:06:02,560 --> 00:06:04,640
If you learn nothing else, learn these three.
123
00:06:04,640 --> 00:06:06,120
Group two is file system.
124
00:06:06,120 --> 00:06:09,040
Covering the everyday file tasks you do constantly.
125
00:06:09,040 --> 00:06:13,800
Get child item lists, files and folders, copy item copies them, remove item deletes them
126
00:06:13,800 --> 00:06:15,480
and get content reads file contents.
127
00:06:15,480 --> 00:06:19,080
You can do in one line what would take clicking through multiple folder windows.
128
00:06:19,080 --> 00:06:22,200
Group three is system, managing what's running on your machine.
129
00:06:22,200 --> 00:06:28,160
Get process shows running processes, get service shows services and start service and stop service control them.
130
00:06:28,160 --> 00:06:32,360
Restart computer reboots a machine if you've ever opened task manager or services.
131
00:06:32,360 --> 00:06:36,040
MSE these commands replace all of that and they work remotely.
132
00:06:36,040 --> 00:06:39,000
You can check services on 100 machines without leaving your desk.
133
00:06:39,000 --> 00:06:42,240
Group four is filtering and shaping where the pipeline really shines.
134
00:06:42,240 --> 00:06:47,000
Where object filters data based on conditions, select object picks which properties you want to see,
135
00:06:47,000 --> 00:06:50,520
sort object orders your results and group object aggregates them.
136
00:06:50,520 --> 00:06:53,240
These CMD let's turn raw data into useful information.
137
00:06:53,240 --> 00:06:55,880
Without them, you're just dumping data to the screen.
138
00:06:55,880 --> 00:06:58,920
With them you can ask specific questions and get specific answers.
139
00:06:58,920 --> 00:07:01,280
Group five is export how you save your work.
140
00:07:01,280 --> 00:07:06,000
Export CSV writes to a file you can open in Excel, outfile writes to a text file,
141
00:07:06,000 --> 00:07:08,560
and convert to JSON converts to JSON format.
142
00:07:08,560 --> 00:07:12,440
These CMD let's let you turn your commands into reports, logs or data files.
143
00:07:12,440 --> 00:07:14,680
You run a command filter the results and save them.
144
00:07:14,680 --> 00:07:16,520
That's a report, that's automation.
145
00:07:16,520 --> 00:07:18,160
Here's a quick example for each group.
146
00:07:18,160 --> 00:07:23,320
With discovery you'd run get command, noun service to see every service related command.
147
00:07:23,320 --> 00:07:31,520
With file system get child item C plus logs, recurs, where object length GT 10 made of me finds large log files.
148
00:07:31,520 --> 00:07:36,640
For system get service, frontware object status, ecu stopped lists stopped services.
149
00:07:36,640 --> 00:07:41,320
For filtering, get process, art, sort object CPU descending.
150
00:07:41,320 --> 00:07:44,640
Select object, first five shows the top five CPU hogs.
151
00:07:44,640 --> 00:07:47,480
And for export get service and export CSV services.
152
00:07:47,480 --> 00:07:48,840
CSV saves everything to a file.
153
00:07:48,840 --> 00:07:49,960
Here's why this matters.
154
00:07:49,960 --> 00:07:53,520
These five groups cover the vast majority of what you'll do.
155
00:07:53,520 --> 00:07:56,520
You don't need to be a power shell expert, just no way to start.
156
00:07:56,520 --> 00:07:59,440
And the best place to start is the group that teaches you everything else.
157
00:07:59,440 --> 00:08:01,160
Let's talk about discovery.
158
00:08:01,160 --> 00:08:04,440
Discovery first, get help, get command, get member.
159
00:08:04,440 --> 00:08:07,720
Let me tell you about the single most important cmd. you'll ever learn.
160
00:08:07,720 --> 00:08:10,400
Get help, it's power shells built in manual.
161
00:08:10,400 --> 00:08:13,040
Type get help, followed by any command name.
162
00:08:13,040 --> 00:08:16,920
And it shows you the syntax parameters and most importantly, working examples.
163
00:08:16,920 --> 00:08:19,400
You don't need to search the internet or memorize anything.
164
00:08:19,400 --> 00:08:21,800
The documentation is right there inside the tool.
165
00:08:21,800 --> 00:08:24,200
Say you want to understand how get process works.
166
00:08:24,200 --> 00:08:25,800
Type get help, get process.
167
00:08:25,800 --> 00:08:29,680
And it shows you the syntax, what parameters it accepts, and what each does.
168
00:08:29,680 --> 00:08:32,640
But the real goal is in the examples, get help, get process.
169
00:08:32,640 --> 00:08:35,600
Examples jump straight to working code you can copy and run.
170
00:08:35,600 --> 00:08:38,200
That's how you learn power shell from within power shell itself.
171
00:08:38,200 --> 00:08:39,720
Then there's get command.
172
00:08:39,720 --> 00:08:42,800
This cmd.let lists everything available in your session.
173
00:08:42,800 --> 00:08:45,160
Every cmd.let function and script.
174
00:08:45,160 --> 00:08:46,440
And you can filter it.
175
00:08:46,440 --> 00:08:48,480
Get command.verb.
176
00:08:48,480 --> 00:08:51,440
Get shows you every get command of which there are hundreds.
177
00:08:51,440 --> 00:08:56,600
Get process, get service, get date, get item, get child item, get content.
178
00:08:56,600 --> 00:08:58,600
All of them, just by asking, get command.
179
00:08:58,600 --> 00:09:01,720
And now service shows you every command that works with services.
180
00:09:01,720 --> 00:09:06,360
Get service, start service, stop service, restart service, set service, new service, remove service.
181
00:09:06,360 --> 00:09:08,000
You don't need to guess what's available.
182
00:09:08,000 --> 00:09:09,120
The tool tells you.
183
00:09:09,120 --> 00:09:10,560
And then there's get member.
184
00:09:10,560 --> 00:09:12,200
The one that unlocks everything.
185
00:09:12,200 --> 00:09:14,440
Pipe any command to get member.
186
00:09:14,440 --> 00:09:18,280
And it shows you what's inside the objects that command returns.
187
00:09:18,280 --> 00:09:20,560
Run get process, get member.
188
00:09:20,560 --> 00:09:23,640
And you see every property and method of process objects.
189
00:09:23,640 --> 00:09:28,320
Name, ID, CPU, working set, start time, and methods like kill.
190
00:09:28,320 --> 00:09:30,000
Refresh, wait for exit.
191
00:09:30,000 --> 00:09:31,920
You don't have to wonder what data is available.
192
00:09:31,920 --> 00:09:33,160
You can inspect it directly.
193
00:09:33,160 --> 00:09:34,560
Why this matters?
194
00:09:34,560 --> 00:09:36,400
You never need to memorize everything.
195
00:09:36,400 --> 00:09:38,160
You can learn as you go.
196
00:09:38,160 --> 00:09:39,920
Get help teaches you how to use commands.
197
00:09:39,920 --> 00:09:41,640
Get command shows you what commands exist.
198
00:09:41,640 --> 00:09:44,320
And get member shows you what data those commands return.
199
00:09:44,320 --> 00:09:46,440
These three cmd.lets are your learning tools.
200
00:09:46,440 --> 00:09:48,520
They make power shell self documenting.
201
00:09:48,520 --> 00:09:52,960
Once you know what's available, the next step is shaping that data into something useful.
202
00:09:52,960 --> 00:09:54,960
Filtering, shaping, and exporting.
203
00:09:54,960 --> 00:09:56,680
Turning commands into reports.
204
00:09:56,680 --> 00:09:58,120
Here's the thing about power shell.
205
00:09:58,120 --> 00:09:59,640
The power isn't in any single command.
206
00:09:59,640 --> 00:10:01,840
It's in how you combine them through the pipeline.
207
00:10:01,840 --> 00:10:04,960
You take the output from one cmd.let, pipe it into another,
208
00:10:04,960 --> 00:10:08,120
and build complex operations from simple building blocks.
209
00:10:08,120 --> 00:10:12,480
Where object is your filter that only passes through objects matching your condition.
210
00:10:12,480 --> 00:10:15,640
So get service, where object status EQ.
211
00:10:15,640 --> 00:10:17,760
Running gives you only running services.
212
00:10:17,760 --> 00:10:20,080
No scrolling through a list of 100 services.
213
00:10:20,080 --> 00:10:21,640
The command does the filtering for you.
214
00:10:21,640 --> 00:10:24,520
Select object picks, which properties you want to see.
215
00:10:24,520 --> 00:10:26,880
Get process, select object.
216
00:10:26,880 --> 00:10:28,040
Name, CPU,
217
00:10:28,040 --> 00:10:30,560
working set, returns just the data you care about.
218
00:10:30,560 --> 00:10:33,800
It strips away handles, page memory, and session IDs,
219
00:10:33,800 --> 00:10:35,800
leaving only the columns you asked for.
220
00:10:35,800 --> 00:10:39,400
That's how you turn a wall of data into a clean readable table.
221
00:10:39,400 --> 00:10:41,280
Sort object orders your results.
222
00:10:41,280 --> 00:10:43,960
Get process, hmm, sort object CPU.
223
00:10:43,960 --> 00:10:47,440
Descending shows you the most CPU intensive processes first.
224
00:10:47,440 --> 00:10:51,160
So you can find the problem immediately instead of scanning through an unsorted list.
225
00:10:51,160 --> 00:10:54,520
Export CSV saves everything to a file you can open in Excel.
226
00:10:54,520 --> 00:10:55,760
This is where the magic happens.
227
00:10:55,760 --> 00:10:58,640
You run a command, filter it, shape it, and save it.
228
00:10:58,640 --> 00:11:00,320
That's a report and that's automation.
229
00:11:00,320 --> 00:11:02,280
Here's the full pattern put together.
230
00:11:02,280 --> 00:11:05,000
Get service, most where object status EQ.
231
00:11:05,000 --> 00:11:08,080
Stopped, select object name, display name.
232
00:11:08,080 --> 00:11:09,920
Export CSV stop services.
233
00:11:09,920 --> 00:11:13,600
CSV, it's one command that gets all services, filters to only stop once,
234
00:11:13,600 --> 00:11:17,080
picks just the name and display name and saves the result to a CSV file.
235
00:11:17,080 --> 00:11:20,440
You can run this on one machine or 100 and you get the same result every time.
236
00:11:20,440 --> 00:11:24,240
This is what replaces hours of clicking through GUIs and manual copy pasting.
237
00:11:24,240 --> 00:11:28,240
Instead of opening services, MSC on every server scrolling through the list,
238
00:11:28,240 --> 00:11:31,040
writing down what stopped and typing it into a spreadsheet.
239
00:11:31,040 --> 00:11:32,000
You run one command.
240
00:11:32,000 --> 00:11:34,560
It takes seconds, it's accurate and it's repeatable.
241
00:11:34,560 --> 00:11:35,600
Why this matters?
242
00:11:35,600 --> 00:11:37,800
You go from reactive to proactive.
243
00:11:37,800 --> 00:11:39,720
You can run these reports on a schedule.
244
00:11:39,720 --> 00:11:44,080
Every morning a script checks your services, exports the results and emails them to you.
245
00:11:44,080 --> 00:11:46,960
You spot problems before they become emergencies because you know what's running,
246
00:11:46,960 --> 00:11:48,680
what stopped and what needs attention.
247
00:11:48,680 --> 00:11:51,840
Instead of waiting for something to break, you stay ahead of it.
248
00:11:51,840 --> 00:11:55,040
So now you have the pieces, the discovery tools to learn what's available,
249
00:11:55,040 --> 00:11:59,400
the filtering tools to find what matters and the export tools to save your results.
250
00:11:59,400 --> 00:12:02,920
Let's see how they all fit together into one system.
251
00:12:02,920 --> 00:12:04,200
How it all connects?
252
00:12:04,200 --> 00:12:05,600
The pipeline in action.
253
00:12:05,600 --> 00:12:08,440
The pipeline is the heart of PowerShell, not just a feature.
254
00:12:08,440 --> 00:12:13,120
Every CMD-LED outputs objects and the pipeline sends those objects directly into the next CMD-LED.
255
00:12:13,120 --> 00:12:16,320
That simple idea is what makes PowerShell so powerful.
256
00:12:16,320 --> 00:12:19,680
You build complex operations from simple building blocks, one pipe at a time.
257
00:12:19,680 --> 00:12:21,360
Let me give you a real scenario.
258
00:12:21,360 --> 00:12:23,800
Say a user calls because their account is locked out.
259
00:12:23,800 --> 00:12:25,080
This happens all the time.
260
00:12:25,080 --> 00:12:29,040
Someone types their password wrong too many times and suddenly they can't log in.
261
00:12:29,040 --> 00:12:31,040
The old way of handling this is a pain.
262
00:12:31,040 --> 00:12:33,360
You open Active Directory users and computers.
263
00:12:33,360 --> 00:12:38,160
Scroll through the list, find the user, right click, check the account, unlock it,
264
00:12:38,160 --> 00:12:43,200
then open Event Viewer to find the lockout event, then manually note the time and source.
265
00:12:43,200 --> 00:12:46,160
That whole process takes five to ten minutes per user.
266
00:12:46,160 --> 00:12:50,160
And if you have multiple users calling in, you spend your whole morning on this one thing.
267
00:12:50,160 --> 00:12:52,520
The PowerShell way is completely different.
268
00:12:52,520 --> 00:12:58,320
One command, get a user, filter, lockout, EQ true, finds every locked account in your domain.
269
00:12:58,320 --> 00:13:00,640
Then you pipe that into Unlock AID account and that's it.
270
00:13:00,640 --> 00:13:04,080
The script finds the locked accounts and unlocks them, then you pipe the result to a logging
271
00:13:04,080 --> 00:13:06,120
function or export it to a report.
272
00:13:06,120 --> 00:13:09,520
You have a record of what happened when it happened and which accounts were affected
273
00:13:09,520 --> 00:13:11,120
all from one line of code.
274
00:13:11,120 --> 00:13:14,000
And here's the thing, the same pattern works everywhere.
275
00:13:14,000 --> 00:13:19,080
Exchange mailboxes, Teams, channels, SharePoint sites, Azure resources, the CMD-Lets change,
276
00:13:19,080 --> 00:13:20,480
but the pipeline stays the same.
277
00:13:20,480 --> 00:13:23,120
You get something, filter it, do something to it and save the result.
278
00:13:23,120 --> 00:13:28,360
For example, get mailbox, filter by some condition, set a property export to CSV, or get
279
00:13:28,360 --> 00:13:31,600
team, filter by membership, add a member, log the change.
280
00:13:31,600 --> 00:13:33,080
The pattern is identical every time.
281
00:13:33,080 --> 00:13:34,320
Why this matters?
282
00:13:34,320 --> 00:13:37,320
Once you understand the pipeline, you can automate almost anything.
283
00:13:37,320 --> 00:13:41,800
The pattern is the same whether you're managing one user or a thousand, one server, or a hundred.
284
00:13:41,800 --> 00:13:44,280
You learn the pattern once and apply it everywhere.
285
00:13:44,280 --> 00:13:46,760
All right, you've seen what it is and how it works.
286
00:13:46,760 --> 00:13:49,480
Now let's talk about what you should actually do next.
287
00:13:49,480 --> 00:13:51,160
Your first steps to automation.
288
00:13:51,160 --> 00:13:52,440
So where do you start?
289
00:13:52,440 --> 00:13:55,440
Open PowerShell and Run Get Help to start exploring.
290
00:13:55,440 --> 00:13:58,280
Type Get Help, Get Process and see what it shows you.
291
00:13:58,280 --> 00:14:01,960
Then type Get Help, Get Service examples and look at the working examples.
292
00:14:01,960 --> 00:14:04,480
This is how you learn the tool from inside the tool.
293
00:14:04,480 --> 00:14:07,120
No searching the internet or watching tutorials needed.
294
00:14:07,120 --> 00:14:08,960
The documentation is right there.
295
00:14:08,960 --> 00:14:10,600
Next pick one task you do every week.
296
00:14:10,600 --> 00:14:14,720
You see it's checking which services are running on a server, listing files in a folder or exporting
297
00:14:14,720 --> 00:14:15,720
a report.
298
00:14:15,720 --> 00:14:17,840
Write a one-liner for it and start simple.
299
00:14:17,840 --> 00:14:21,120
Something like Get Service, where object status, EQ running.
300
00:14:21,120 --> 00:14:22,120
That's a one-liner.
301
00:14:22,120 --> 00:14:23,600
Run it, see the output and save it.
302
00:14:23,600 --> 00:14:26,040
You just automated something you used to do manually.
303
00:14:26,040 --> 00:14:28,840
Then use Get command and Get member to discover what's possible.
304
00:14:28,840 --> 00:14:32,600
You don't need to know everything upfront, just how to find what you need.
305
00:14:32,600 --> 00:14:37,480
Get command, noun service shows you every service related command, and Get Process.
306
00:14:37,480 --> 00:14:40,360
Get member shows you every property of process objects.
307
00:14:40,360 --> 00:14:42,680
The tool tells you what it can do and you just have to ask.
308
00:14:42,680 --> 00:14:44,440
The best first step is simple.
309
00:14:44,440 --> 00:14:46,480
Automate the task you do most often.
310
00:14:46,480 --> 00:14:48,520
Even a simple one-liner saves you time.
311
00:14:48,520 --> 00:14:52,160
If you check services every morning, write a one-liner that checks them for you.
312
00:14:52,160 --> 00:14:55,640
If you clean up temp files every week, write a one-liner that does it.
313
00:14:55,640 --> 00:14:57,080
Start small and build from there.
314
00:14:57,080 --> 00:14:58,840
Now where do you go from here?
315
00:14:58,840 --> 00:15:01,360
Microsoft learn has free PowerShell learning paths.
316
00:15:01,360 --> 00:15:04,320
They're structured, practical, and completely free.
317
00:15:04,320 --> 00:15:08,200
The PowerShell gallery has thousands of community modules, so someone has probably already
318
00:15:08,200 --> 00:15:10,280
written a module for whatever you're trying to do.
319
00:15:10,280 --> 00:15:11,720
You don't need to reinvent the wheel.
320
00:15:11,720 --> 00:15:13,440
PowerShell is a skill, not just a tool.
321
00:15:13,440 --> 00:15:15,520
The more you use it, the more it clicks.
322
00:15:15,520 --> 00:15:17,120
You don't need to be a developer.
323
00:15:17,120 --> 00:15:18,320
You just need to start.
324
00:15:18,320 --> 00:15:20,680
Ten minutes a day is enough to build real capability.
325
00:15:20,680 --> 00:15:24,120
Run one command today, run two tomorrow, and before you know it, you're automating things
326
00:15:24,120 --> 00:15:25,800
you never thought you could.
327
00:15:25,800 --> 00:15:27,040
So that's PowerShell.
328
00:15:27,040 --> 00:15:29,920
The language that connects the entire Microsoft ecosystem.
329
00:15:29,920 --> 00:15:32,720
Open it up and Run Get Process to see what it looks like.
330
00:15:32,720 --> 00:15:36,880
Then subscribe for more knowledge nuggets and drop a comment about what you want to automate.
331
00:15:36,880 --> 00:15:38,600
What's one task you wish you could automate?
332
00:15:38,600 --> 00:15:39,600
Let me know.
333
00:15:39,600 --> 00:15:43,420
in a future episode.

Founder of m365.fm, m365.show and m365con.net
Mirko Peters is a Microsoft 365 expert, content creator, and founder of m365.fm, a platform dedicated to sharing practical insights on modern workplace technologies. His work focuses on Microsoft 365 governance, security, collaboration, and real-world implementation strategies.
Through his podcast and written content, Mirko provides hands-on guidance for IT professionals, architects, and business leaders navigating the complexities of Microsoft 365. He is known for translating complex topics into clear, actionable advice, often highlighting common mistakes and overlooked risks in real-world environments.
With a strong emphasis on community contribution and knowledge sharing, Mirko is actively building a platform that connects experts, shares experiences, and helps organizations get the most out of their Microsoft 365 investments.















