From the course: PowerShell 5 Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Creating your first script - PowerShell Tutorial
From the course: PowerShell 5 Essential Training
Creating your first script
- Using all of the information and knowledge that we've accomplished together in this course, it's time to build our first script together. And this is one of the interesting things, is why we always start in the console. This is where I solve my problem and then I start to turn it into a script. So let's do something really straightforward. I want to get some event log information, so I'll use Get-eventlog and LogName, I want to get it from the system and I want just the Newest 5, and an EntryType of error, believe there'll be some of those and I like to check as I'm going along to see what kind of information I'm getting. You know, this is great, I like this, but I really only want a certain amount of information. I want the Index, Source, and the Message. Now, if I'm not sure of the exact property names and I need to warn you, these column names may not be the exact property names. Always pipe to Get-Member to take a look. In this case I believe they are, so let's go ahead. And…
Contents
-
-
-
-
-
-
-
-
(Locked)
Exploring PowerShell automation security7m 1s
-
(Locked)
Creating your first script6m 41s
-
Using variables for storage6m 11s
-
(Locked)
Using the Integrated Scripting Environment (ISE)6m 12s
-
(Locked)
Creating a parameterized script7m 6s
-
(Locked)
Using parameter attributes6m 36s
-
(Locked)
Using comment-based help5m 33s
-
(Locked)
-
-