Powershell Script - Learn Powershell Weekly - 1 | Joy Banerjee | Skillshare

Playback Speed

  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Powershell Script - Learn Powershell Weekly - 1

teacher avatar Joy Banerjee, IT Consultant and Certified Astrologer

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

4 Lessons (23m)
    • 1. Powershell Intro Course 1

    • 2. Running Powershell Command Restart Your Computer

    • 3. Powershell Get the Hostfix Information

    • 4. Powershell Wrap Up

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class

Hey Friends Today we will Learn About something new with Powershell Script - Learn Powershell Weekly - 1 Powershell Script Patching Validation on Windows Servers and I would try to Guide you Through Quickly and Easy Way how to setup your own scripts Today.

1) Powershell Script 1 - Restart Multiple Computer

2) Powershell Script 2 - Pull Hotfix Information from Multiple Computers after you are done with your Patch Deployment 

Lets see you Inside 

Meet Your Teacher

Teacher Profile Image

Joy Banerjee

IT Consultant and Certified Astrologer


Joy Banerjee an IT Consultant and Corporate Trainer has more than 14 Years of Experience in IT Industry.

I am also a Certified Vedic Astrologer as I am an Aacharya Degree Holder and Do Provide Consultancy - Vedic-Astro.in

Expert in Windows Technology, Virtualization (VMware / Hyper-V) Symantec Products Like Netbackup, Veritas Cluster Server (Infoscale Storage or HA)

Development - Wordpress & Drupal

Windows PowerShell (Scripting) and many other technologies as well in the Bag which is presented as a Course for You

See full profile

Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.


1. Powershell Intro Course 1: Welcome to my class on this is Joy Banerjee from a caddy support dot So today in this class we will learn about something new in power shell. I know if you are windows and Mr you should know partial, but my classes are going to help you write of a hands on technique how to learn power shell Because we will pick up a few examples you never classes on. You will, right of it can use those examples and build us. Okay, so let's don't run it to a rush and let's go jump into this particular class so that you can also learn how to do partial in as I do straighter day to day life. Okay, let's jump into the coast. 2. Running Powershell Command Restart Your Computer: Okay. Thanks for joining to this class. And in this let's is driving to the right. So the topic okay, the first thing which we're going to learn is we need to learn about how to restart our systems with help off partial. And then I will let you know how to restart our system with the help of partial, Not only with the normal command a partial. We will use a script as well to utilize and reboot multiple systems at the same time. Okay, there will be a position where probably you will require to rebuild multiple systems in a sequence. So I will tell you how to create a script right of in front of you. Okay. With the help of power. So first we need to know that how we can learn a man. So how you can what you can do is you can over a partial and check which publisher version you aren't. So you can write the year's version then table and then hated it will let you know which partial version you are right now. I am in five. Ok? No, really, to look for a command. This is a learning phase where we don't know. We assume that we don't know how to reboot the system. So we look for command. So what I can do is I don't use get Cameron. Okay on I will use, like, restart. Okay. And then I get put it in a strict I will hit it Now we can see there are some command with a restart. It says restarted. Apthe, we start B s A P C V s device restart. Bring job, Mr. Computer List. So we need a restart computer. Okay, let's say you don't know this. Come on, let's get Come on. You're not aware. Freakin time. Health. I will put this ass strict. I will put the star okay, and I will put that streak again. So what did you do? Izabal again? Hit the help command and show you these other reset functions. But here you can see it is not able to list the other command. So in some cases, help is going to help you. In some cases, get command is going to help you. Okay, so we need to use vice versa. So here. We know commanders, uh, we could get command again and type re stunt. Don't we start? But start it says the recent embarrassing. OK, now we know the government Beloved Waas, Clear screen on now you can use restart, hyphen computer on. Then once you hit this, it will restart your system. Okay, so we need to know what the perimeters, which we can use. So I will hit the hyphen and do a tap that will give you certain actions like his job. Okay. Become a vindication impression. The bluesman. So there are so many things. But here you can see there is one of the time which we are looking forward to, which is computer name. So here I can put a field with a computer name, Let's say unless 01 Okay, then what else I can do? I will do like I will do have lower dealer off 60 seconds. Okay. So whatever you do is that I do reboot the system with a delay of 60 seconds. What else I can do? I can use a full step. Okay. It will try to force if there is. Any user is already loved them, so they will try to force and restart. Okay, So forces going to push the system to restart the things. But these are few things which we can use now. We know this is the command is going to restart the system now. I need to put it in a script, So I will tell you how to create a script. Now. Okay for that what you need is you need to open on Isaac and Soul. Okay, so right now you can go to the search button, you will type like powershell. Okay on. There will be option called partial. I you see? Okay, You need to open this partial. I see you will right click and run. Is that Mr So now I can see the icy console is open, so I will hit this. The strip part is open. So best way to write the script is to write a function again. So we're writing this script. This is this script is for rebooting my people systems. Okay. So whenever you're writing something in a hashtag, it is not going to executor. There's only for information. So right now this is in formation which were put Now I will create a square. The first thing is what we will do is we will create a very able Okay. Why? The variable is required. Biggest way will put a Lord pad and they're really not bad. We'll put the multiple system names, which we want to leave. Okay, now. And I will put it from that particular area. So let's see. I will put a variable for that. We need to use dollars saying servers Okay, on. He could too. Oh, get hi from content. Okay, so I will give a location. Gold seedling. I will see. Is that a nickname folder? So what I will do is I will create a full the whole time. Okay, so I will go to see the slash mgt. Yeah, then the MP. Okay, so it will create a temp folder. So if I do ls Now you can see there is a temple. Okay, so the temp folder, I will do a part called Temp. Okay, now, in the temple will create a fight. Okay, So what I will do is I will go to that location. I'm created text document with silver. Okay. Servers on. I will put the 17 like No, we host. Let's a fab. That one. Okay on, then Jack to and then looking post. Okay, I will say this. Minimize this. So now I will point, though, that folder that that file. Okay, now it is Get content 7 30 extra. So what I'll do is I'll clear the screen with this weigh button. I will select this, uh, this one and run this selection. Okay, so it is going to list whatever the contender is. The trap trap. One trap to locals. So this is ready now, the next step would be so we will run this command in blue. OK, so we know what is. Overcome it. So I will use forage. Okay, so we need to put later. Necker lived record. So you use like dollar server. You know, dollar. There was They're in this. We'll raid a writer who's two very close. All right, who's and we will write a commander that's missing Server President. Server? Yes. Don't necessarily. Okay, so what it will do is whenever this group is going to run, it will write up the entry, which is speaking up from this list. Okay, so let's see how it was how it is. Okay. So what I will do is I will write this and run this commit. So now I can see types postings ever trapped President of a trap one presidents ever trapped to processing several locals. Okay, now it did not know. We're able to understand that which so very disperses ing on this. Commit now in the next lane will rate of a commit Okay, What is over command. So we'll write a command called restored computer then the computer name. So we want this computer named we picked from the content off the real friends. Right? So what I will do is I will hit a dollar and I will put several. And I will also use it. The Mankell force. Okay, What did we do? Is it will pro and run there. Come in. So what I will do is I will remove this local who's otherwise it will going to reboot my sister at this woman. There is no trap One There's no trapped toe. There is no okay. Just for example I'm just doing this so whatever lose I would go to this location. Andi, Now every move is local. Horse on. Let I will add this local host to show you this is working, so I would minimize this. I wiped this on. Now I will set a dealy. Okay, what I will do is unsettle dealing. Delay off 20 seconds. Okay, It is fine. So do you have 20 seconds? We're putting you. Okay, so whenever we do, you always try to save this. So I'm saving the script into a location. It's up to you where you want to say I'm saving it in our seat. Them so good to see drain. We'll goto 10 on. This is a restart in the resturant computer script. Okay, so I will say this like this. Okay, so this is a simple cord. So what we're doing, we're restarting the computer. Picking up the entry from the text file on putting a delay of 20 seconds. Okay, I will run this. No. Okay, let's open this quickly. Now you can see we We know that it is. It is giving her time out. We know that it is not present here. Okay, so now it says strap one plateau on trap is not present. It is not able to comic it. Okay, So believes not valued for this specific. So now what ever lose quickly. Modify that text file Now it is going to list the local host says one. That means this system is when During Okay, I could do a quick wipe up on Let's add local host on. I just want to mention there. How much delivery have it is? You would know, right? 20 seconds. So what? I would lose all Wipe this. I will run this. Okay. Okay. Um Summer disparity. Filbert delays. Not really for the government for a week. Um but I'm gonna wait this business right? Okay. No. Okay. Local host is not configured. That trade is really so Let me driver whose name? Onda I will a little for this horse name there. That really much better in three with you, so I will wipe this out. I'll goto the hair and I will enter this the grand close this and save when you make this okay. And now I will run it again. Okay, let's remove the delay. Okay? I'm just removing Bill. Really? Because I'm used the force as well. It is may causing this so I will remove the dealer on. I will save this file on. I will run it now every relays causing it. But the thing is, the crop is not present. I know that on the telephone is not present practices nor prison. Billy, maybe work on us in the computer. But I'm not tested. I will have a quickly do. We're test after this. But I know that which is present, which is not now. You can see in this there is no area and now our system is rebooting. So now you know that your command is working and now you can rebuild multiple systems with the help of option script. So hope this video is informative. Let's move on to the next section on Let's do and try another script and learn something new. 3. Powershell Get the Hostfix Information: Okay, welcome to this class. And now we will see something new. Andi, In this video, we will learn about getting hot Fix So hot fix like there Some patches which we installed as I would know the administrator on after installing the patch is I would like to see that What are the patches? Are we apply it so let pull information from our differences. So this is what we need. Okay, So we know these are hot fixes which get installed. So how we can check them. So I will look for a command first. So the first thing which will tries get select this I'll get someone you know on will use a strict on their or fixed. We know this is our next on. I've done the people. So here's what I do is I will remove the s from here It is hot fix and I will attend. So now it didn't say There is a command called get hot fix so I can use the help Remind Israel. So I will do our fix here and I will do so. It also gives a simple example is well so what you can do ism works quick CLS So now we can see like you will use heart fix on then hyphen Example on I will hit Enter So it will give you certain examples. Get out Phrase description, security A brutal name blah blah And then it also give information again. So now get condemned. Get servers for each If the heart fix giving them But the brutal there's I condemn but missing in the text. So like this you can create some demands Will on now we know this is a heart fixed between it To do so. I will use the same set off. Loop on, I will confess then. Fromage! So let's see what type off the man and how we will build the script. So our our target is to Lansing Learn learning, creating scripts. And this time, in this command we will also try toe creator output. Okay, We also require output so that we will get some information. Okay, so the first step would be Yes. We need toe use the same sort of layout. I will open the on last script which we have created. I will open this. I will I will Copycats fuel the past okay. Don't copy this whole thing on. I will paste it here. What I do is I will remove this line because I'm going to use a different term. Understand? But other than that, I will use the same Leo the Commander will uses. Get hot. Fix. Yeah, hyphen or six. Okay, on, then. This time, use computer name. And we know this time again, we will use this settler. No, let's ever Which is the first entry. Okay, on what? So we need to pull some information. But before that I am. What I need to do is I need a copy of this, and I need to see that. What are the parameters we have here? So what I would do is I will select this on. I get member. Okay. So I will do this on a build on this. No, I will open this. Now. You can see what are the things we can use? Like we can pull the computer name, we can pull the caption. Okay. We can pull the description. Okay on. We're gonna tow straight us. Here's compute installed on. So this is one of the perimeter which we need that when these vortexes are installed. So I will run a quick command, like get hot fix. And I was written, so I can see there is some ah, sources. This description is what type of this are tricks I d installed by ending. Stolen. So these are a few things between May require. So what I'll do is I'll copy that. Okay. A copy of the stings of happiness that make appeared in the north part which will be easy first and once a dis pop it. Then I will tell you how to use that. Okay, I will call be this description in space. I will use this hot, strict hard tricks i d This is in coma than space usually installed by. Then again, I will use a comma. Then I will do, uh, installation on Yeah, this is the information I need for example, so But I think this up and I will use a by pierce our type Select object. Okay, this time I will use this service. Roma and I will copy the east and let's ah, undiscovered and see how it looks. I can see the same way it is running in the trap. One first. Okay, then it will try to run a trap way. We know the trap is not present, so it will take some time. So it was this video, and then we want toe the next one. So now you can see this is giving information like this is a servant name these days. Okay, so now we're toe make it more easier with toe. See, What I can do is I will use another switch here. I will do a quick cleanup on. The first thing is, I will go to that location. Um and I will modify this fight on that. This woman, I'm just removing other things. We know the loop is doing the work and pull them formation over the service. So I'm just clearing this out. So they're the only ones. And for seven have a okay, Handan or to say's This will give the output much better way. Or do a quick this American See, it gives a better output. Okay, That shows like this, but isn't of us other name this of these are fixed with him. Start envisaged and it will give you informs. Okay, let me to work with cleaner and Now we need this report to be pulled into a fight. So what I can do is I'm a creativity of it and put this holds command into a variable. What I can do is lure dollar risen equals. Okay, now every do preserves outfront final part. They wanted to give the same parts than on this time. The final name should be, um, heart fix in full. That Beastie. Okay, Mr Villa. Finally. So we'll do a quick this first time I received the script. This is ah, our fix in full. I felt script. Okay, I see this on now. If I run this, what will happen is this result Whatever this going to happen, this result resident dirt variable is going to store the information and output. It will push through that next fight. Okay, I will run this. What will happen? It is processing the first sever. And now it is clear that if I so how you can check that I will goto this location. See on now. In this we can see what fix they're in for. If I click this night and see it has that information so hope this video is a vomited on. Now you will be able to create a script for pulling the information. Something which you have learned something new. Right? So on you. What you need to do is in a gruesome practice on your toe. Try to do the same thing with Hampton Onda. We will move on. Read something new in the next class, okay? 4. Powershell Wrap Up: Okay, This is a conclusion. Video. In the next week, we will come with a few more commands. More scripts. But whichever we have copied, what I want is you guys can do a practice on Show me the output file on attach it in the project section. Okay, So that I would know you have done it. And if you have any questions you can put in the comment section, I'm happy to answer on help you out with your journey for learning Martian scripting. Okay, So see you on Meet you. And next week with a new class.