Learn PowerShell in Less Than 2 Hours

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] foreign hello guys and welcome this is Jim Tyler from powershellengineer.com here today to try to teach you Powershell as quick as we can hopefully after an hour I think it's possible uh we'll see whatever the title says right uh yeah so we're hoping I'm hoping to be able to go through that really quickly with you guys uh just a quick background super super quick background on myself I'm a former Amazon engineer I've got a master of science Information Systems I'm currently a K-12 director of Technology uh for the public school district in Michigan and I am just a huge Powershell fanatic recently I gave a presentation a couple presentations at a Statewide conference on Powershell notably wearing a Powershell shirt um you can follow me on Twitter at powershellenge um and uh stay in touch and then also please subscribe to my newsletter jimtyler.substack.com entitled Powershell engineer if you want to see some tips and tricks that I'm sharing out to you guys that is a 100 free newsletter so let's jump right into it I love going over hey what is Powershell and I think Microsoft to the credit breaks it down really well what is Powershell it is both a command line shell and a scripting language so I love that it's broken down this way because it really is sort of hard to explain uh what Powershell is sometimes right it's that blue CMD right so to get to Powershell all you have to do is type Powershell when you're searching for it you'll see I've already got it down here and boom you're in Powershell now what I like to do is set the font size let's make it a little bit bigger so if we right click the the bar there go to properties go to font you'll see I've already got it at 24 I think that's actually pretty good probably for making other videos and now we are in there so if you want to check the version of Powershell invoke this environment variable which we'll get more of the variables and go to dot PS version boom so you'll see that this is just a mere Powershell five obviously seven is out we'll just be going through Powershell five because hey that's good enough for us to to start learning uh a couple different things with Powershell so I want to jump into comparing it Powershell with command prompt so Powershell can basically do anything uh that command prompt does and I brought this up in a video I had posted on my channel before and I believe somebody said something like you can't run bash files which is true or batch commands I can't remember exactly I have to go back and reference that but for the most part it's nearly true so if you're used to command prompt uh you'll notice that this works the same way you can just ping whatever you like that comes let's be bring spacex.com all right works just like it would in command prompt you know you could change directory just go up a directory that's actually fine so you'll notice actually let's go ahead and go to our scripts directory so we'll be in there later that's a folder I've already made let's see how it works the same um but of course the huge uh difference is that you can use Powershell commandlets and uh there's a lot of specialized functions available with Powershell that you can do so one thing I want to note too is the up arrow and Powershell you could go up and do some of the same commands you did before actually do a CD again just by going up all right and let's just go ahead and change back into Scripts and if you notice what I did right there which you probably can't notice because you can't see my keyboard but if something can be Auto completed you can just do a tab complete so I start typing scripts it knows that it matches that pattern to a point says hey there's nothing else but scripts there you hit a tab complete and boom you don't have to type as much so that's just a good Pro tip for uh when you're using Powershell to be aware of the tab tab complete and the up Arrow so also before we get into running our scripts I just want to note too sometimes the people have errors right away and that's because the execution policy is not set correctly so let's take a look at setting that so let's to get your current execution policy you would type get execution policy and it's remote signed so that is allowing me to run my own Powershell scripts that aren't sort of verified by Microsoft and uh that's the way I have it set right now but by default it's set to restricted I believe so if I go to set it actually I believe this won't work we'll just go ahead and do our tab complete already and we'll put it to restricted and I don't think this will work because I'm not running this as an admin maybe it will no don't have access to that registry key so what we can do you'll notice down here I've got this Powershell already ring I can right click that do a run as administrator see my kids there probably in the background all right set execution policy directed let's go yes all right so if we do our get execution policy see that it's restricted well the tab we'll do the up Arrow we'll go back and I actually want to put that back to remote oh you know it knows tab complete we want to do that to remote signed so we can run custom scripts pretty cool we'll leave that window open um but I want to make sure that you have that set because what we're going to do next is write our first script and sometimes that will not work unless you have that policy set so what we're going to do is go to your search bar we're going to open up the Powershell ISE that stands for integrated scripting environment and that's an editor that comes with Windows for free which is great and it's actually pretty decent for free um and it'll allow us to make Powershell scripts so that's exactly what we're going to do you see it's starting there might be cut off a little bit on my screen I've got a super wide monitor I don't want to make this video super wide and you'll notice that it's just sitting there Powershell ISC um you'll notice we'll have an editing area up here and we've got an actual console down here that we can see and we'll go ahead and write our first script um actually let's set the uh I want to make this a little bit bigger too let's just zoom in maybe that's just Control Plus make this a little maybe a lot bigger I don't really want this command thing over here I want you guys to actually be able to see how big can we make it 220 percent I think that works I don't know all right cool so what we're gonna do is write our very first script and we're going to write that using the right host commandlet so if you type write Dash host and you'll see it ISE is pretty cool and it will try to auto complete boom right host you can just actually even let it complete we're going to do a Hello World hey it's our script we can do whatever we want with it so let's do the hello world we'll go ahead and save that that's my uh Sports coding right there that's from code with sports uh we just want to go into the scripts and we'll do hello world go ahead and save that boom it's saved we can actually run it right here by pressing this play button so let's go ahead and do that and all it does real simple is print back hello world to us and you'll note too that it ran the script right here helloworld.ps1 now this file extension is what Powershell ISE will save these ads by default which is pretty cool so definitely good to know if you're seeing these files it's a Powershell file and if you try to pull one off the internet Google Chrome might complain to you about it um so that's pretty sweet so let's go ahead and do comments now if you're familiar with coding if you're not that's all right a comment is a line of code that is not going to get executed so we're going to just make my first comment yay all right we'll go ahead and click our floppy disk to save and if we execute this again let's see that that's not there because ISE is even green this out so you can tell that it can't be seen which is pretty sweet and this is going to be for once you start getting the really big scripts you might want to put a comment to be like hey we're printing this variable variable backup we're assessing this information or whatever you're doing with your script just so while you're reviewing it you're able to uh you know just see what the script actually does you know because you may not remember you know you code something you come back to it a year later because you've got to change it you may not remember so um let's see here we can also use this to disable code without deleting that so we can say we don't want this right host here anymore we could go ahead and put a hash sign in front of it or pound sign we press our play now it does nothing maybe we don't want to write that because we don't want that particular feedback so I'll undo that we'll go ahead and Save and uh let's go ahead and delve into what are commandlets so commandlets are predefined functions that perform a specific task and in fact you've already used one the right host and I actually used another one before too if you had to set your execution policy uh with the set and get execution policy so all commandlets follow a verb noun uh verb Dash noun format when you're naming them so they're pretty easy to identify when you're looking at Powershell code you can see them pretty quickly right there it's normally uh it's always a unless it's a custom function someone else made that maybe wasn't following the standard it's a verb and then a noun so write host when we work with active directory later you'll see that uh we'll work with one called get Dash 80 user that kind of thing so I think you get that and also just a note to when I say commandlet you'll see this around it's written like this CMD let so if you see that that's pronounced commandlet and uh just want to make sure that you're aware of that in case you start Googling stuff for commandlets and you're not typing command let although maybe Google would correct you on that um so so far we've only uh worked with commandlets that um well no that's not true to get the set execution policy uh had a remote signed we were working with parameters there but I want to just demonstrate to this right host for instance on your very first script does not have any parameters so what you could do what Ray host is actually doing is writing a new line automatically at the end so we could say hello again let's just go ahead and give it a shot I did the control s to automatically save and go ahead and press play so we see Hello World hello again there's automatically a new line being put in there so um yeah if you're doing that you may be maybe you don't want the new line so an example the right host commandlet has a parameter called no new line as soon as you hit the dash is pretty cool it'll start giving you all the different parameters available so available so you can actually just go ahead and do that do the no new line we'll do a save and you'll see that it just didn't do the new line anymore so just be aware when you're doing commandlets and we'll see this over and over again once we get really deep into this um we will be able to uh we'll be using these parameters over and over again so maybe asking how do you find commandlets and that's a really great question and there's actually a get command and uh what we can do let's go back here and just so you know too just a housekeeping thing you can press clear if you want to clear up the screen boom you don't want to see all that stuff that was there before I like doing that so if you want to find commandlets you can use the get command command which is funny so we'll do get command and we'll actually use a parameter command type and then we'll do command light and that may take a second to load and this will give you all of the commandlets that are available I've got a lot of stuff installed on here I've got a lot of azure uh things should see some AWS things geez yeah there are a lot of azure things wow um and we'll do a control C actually it looks like that maybe that was that was quite a bit what's going on here oh no I was just hitting down here all right uh so that what gives me all the different commandlets I have and I've worked with you know a couple different Cloud platforms all sorts of stuff so I got a couple extra modules installed yeah and if you actually notice uh sorry a little glitch there uh you'll see these custom functions here and you'll actually see what module they're from these custom commandlets so from the Azure one you'll see Azure stuff uh update Azure VM that kind of thing I've got the Google Cloud one installed where you uh you can write to write a GCF GCS object that would be like backing up a file for instance straight to the Google Cloud now there's some extra steps to get those things uh uh configured when you do install these kinds of custom modules but just to reiterate or to say uh the module is just a collection of specialized uh commandlets or functions that do specialized things so it's definitely uh pretty sweet and it's definitely worth looking at um but I want to shift gears and talk about the get help uh commandlet and if you do get help asterisk you will get all of the help articles that are literally every single help article that's available um that you can access right here in the command shell now that might take a second here we may want to cancel that because that's kind of a lot but all right I did a control C to cancel that but to use it to do an example of that uh we could do a get help for write host and it'll tell us hey this is right Host this is uh oh I don't have it up to date but it gives us the syntax and that kind of thing so if I had my help modules up to date uh it would show everything actually let's see if we do a dash detailed I think that would do it yeah so we'll have to get those up to date or maybe a full yeah so I just I just don't have them here but uh when you when you're up to date uh with these help uh the get help modules or get help articles uh you can definitely get all the different uh things available for them to do wait no I'll actually know that gave it to it yeah yeah okay yeah full yeah so here we can say see all the different parameters we have background color foreground color no new line like we already used object separator not a whole lot for right hosts but yeah so sorry to reiterate I thought that was the same output again because it gave this message but yeah it actually does have the uh all the different things you can do with it so if you're ever like hey is there a thing I'm trying to do with this commandlet and I can't quite figure out what's going on or what's you know it's just giving me errors you can use get help it's super helpful but to be honest too A lot of times I'm just Googling stuff right away and finding stuff off of stack overflow when you do do that be careful because you don't want to just copy and paste stuff off of random websites unless you know exactly what it's doing so one of the other major important things with Powershell that you can do that makes it so powerful is piping commands now piping a command is a way of saying combining commands into pipelines and Powershell so try to think of it actually more of as a chain so you all have command one and then you pipe it into command two and actually we can just show you what a little we'll just make a fake function here and uh we'll do the pipe and that is shift slash and that'll be right above the enter key and command two so this would be saying hey we want to pipe the result of command 1 into command two and uh let's let's just do a simple example of that we can just kind of call a string May the force be with you and we'll do a pipe and we'll pipe it into the out file command layout and we'll just say force with who dot txt all right so if I do a LS which works in Powershell by the way I know it's an alias uh we'll see our hello world what you already made and forcewith2.text um and if we do a cat which uh which just reads the file we'll see hey look inside of that file is force with two dot text which is pretty cool so that's that's a pretty straightforward piping example you will see that over and over again uh definitely we'll start working with complex Scripts um that uh piping is just the super a super powerful uh use of Powershell so let's start talking about Powershell variables power now a variable is just a container I don't know if you've worked with programming before or not but if not we're going to make one right now uh in Powershell you invoke variables by using the dollar sign our first variable right now and we'll set it to fave character and we'll say it's equal to SpongeBob boom so that's it you've now set a variable and now you can actually invoke that variable a couple different ways you could just say hey fave character and actually you can again tab complete oh whoops oh yeah there's uh the false the environment variable uh tab complete and you'll get your variable if you just press enter it'll give you the the value of your variable back which is pretty nice now you can also Fabia tab complete that and let's just say we can pipe this variable into a text file so we use our out file again do a fave character txt do an LS on our directory and now we see fade character there if we do a cat on fave character I just did that pretty quick but I literally just did cat and then space f and I tab completed that you'll see that it's Sponge Bob so that is how easy it is to invoke a variable now there's different uh Powershell data types and what our sponge our favorite character variable is right there is actually a string but there's also integers floating points which are just decimals and booleans so to determine the type of a variable you can actually use the get type method on it so if we do SpongeBob so keep doing that for our fave character we'll do get type partial lets us know that hey this is a string but now if I want to set this to something else say I just want to set it to 5 which doesn't make any sense and I'll just go up I want to call the get type again we'll see now that it's an inch 32 which is an integer we'll just go up set it again set it to a floating Point let's say 5.5 we'll see that it's a double which is a type of floating point we're not going to delve too much into the types for the sake of this because we're trying to learn this quickly and if we want to set it to a Boolean which is a true or false or zero or one but we'll set it to a true Powershell we'll do our git type again we'll see that it is a Boolean so we can definitely uh I'm gonna go back and just set it to SpongeBob again in case we decide we want to use that again as we're explaining the stuff um you can see here this is a great demonstration of the different types there are different types and you know you can't and we can work with these types differently so so you can do arithmetic with different uh variables and actually just do a quick demo of that x equals five y equals three you can literally just do arithmetic right here in Powershell add those together you could multiply them that kind of thing so but if you try to do x times fave character it's going to complain to you because hey it's cannot convert value SpongeBob to type integer right so uh that's where types are really important to know if you're working with you know numbers strings booleans decimals you have to really be cognizant of that as we as you go forward but as an intro I want to make you aware of it now another really critical thing with Powershell and I know I sound like a broken record because there's stuff I keep saying that but this is super super important everything in Powershell is an object now the best analogy of this and I I don't know who came up with it I know a shout out to Chris Thomas a desktop engineer for Ingham ISD here in Michigan he used the uh think of the object of a bike and it's got different properties and so say a wheel size is a property of the bike right or the type of brakes would be a property of the bike so a bike would be a class of an object but the wheel size for an adult bike is going to be different than a kid's bike so uh when we think about objects an object is of a particular class so if we were to make a bike object it would be of the class of a bike now I've that's just kind of more a little more detailed but and I won't get into that too much but the variables you've already worked with are also objects so if we talk about our fave character we could say the fave character object that has the value SpongeBob also has other properties like length and this is built into Powershell so if I type the length it'll give me the character length of this object so if you want to get all of the properties of our fave character what we could do is do fave character and we'll use a pipe right away and we'll pipe uh that object into the select object commandlet and we'll use a property parameter and we won't even specify the property we'll just do an asterisk which is like a wild card for all of the properties and because it's just a string all it has is linked property right so uh yeah that that's you know these are pretty straightforward objects now that set the best method to use is the get member uh commandlet so let's go ahead and try that let's do get member and we'll input the object I think that should auto complete yeah and then we'll do it on our fave character and actually sorry that's not for selecting the properties this is for getting the different methods that we can apply to this object so the methods uh the properties are so stacked the methods are sort of something like that you can uh to go back to the bike analogy a method of the bike would be to ride bikes so say you had a bike object uh you could uh you wanted to write it you would invoke the ride method right so we actually already did this if we scroll back up with the get type right it was actually see get type right here as a method that can be uh called on this object so we've actually already demoed this but uh you know I just wanted to point out if you do the get member uh command line and pipe it an object to it you can figure out what you can even do to it and actually this stuff this is pretty nice here because it tells you what you can do to it and there's a lot of different stuff you can do and the more complex different kinds of objects you have um you know you may have more or less methods that you can uh sort of call on those objects so that's it for the object so let's move on to talking about arrays so an array is actually a collection of uh variables that you invoke into one variable and let's just go ahead and make one so it's a little bit easier just when you see it than explaining it so I want to make one just called Jedi and we will make it we will uh the way to start adding values to is to do the at sign and then you're going to want to do parentheses now the variables inside of it are separated by comma so we'll add Obi-Wan Kenobi Luke Skywalker uh Yoda I don't know how long we need to keep going here we'll just add one more just for the sake of a Mace Windu all right oh so if we wanted to we've now just set an array uh into the Jedi variable which is also an object so if we want to just see what's in that let's just type Jedi dollar sign Jedi boom Powershell gives that all back to us prints them right back pretty cool and if we go if we went ahead and just did the get type method we'll see it's an object but it the base type is system.array right now if you want to do uh retrieve values from those those specific values so you all right I've got this sort of group of associated data of Jedis that I'm aware of and it's got all their different names in there but I just want to find the very first Jedi in the list well what you would do is Jedi and then you do a bracket and then zero we'll see that's Obi-Wan Kenobi and we can actually move up the list here and we'll go through all of them oops yeah no that's what I want to do all right so that's how you would access the specific values of uh the array and actually if you look at this you this functions just as a normal variable one in a different uh in any other context so we can just do a DOT length and it'll give us the length of each one of those if we go up go back to just do a longer one just so you can see it boom all right so you see there that uh these are just variables but they're just so they're all collected within the array which is pretty cool uh definitely a great way of organizing data um Powershell this is sort of a standard thing across programming languages but you know definitely worth noting in power show especially if you start making like active directory scripts or anything you might do uh pulling information from cloud platforms you know you'll be pulling this stuff back as a raise sometimes uh and uh if you wanted to add just one more um you know there's different ways to work with the array and of course we could use the uh um uh the get member input object to figure out what we could do to it but if we just want to add something to it we can actually use this operator the plus equals and let's just add Qui-Gon Jinn now if we just print our array back we'll see that he's listed there now and uh you know we could call on his specifically by going to Jedi 5 or actually four and that's a good uh point right here too to notice that the first element of an array I should have said that too that these are elements of the array that's the the nomenclature for working with the race uh starts with zero always starts with zero so when we start getting into Loops I want you to be aware of that so you're not trying to invoke a an array or you don't miss your first element of your array so we'll see then that gives us back Qui-Gon Jinn and that's pretty sweet so now let's move on to uh Powershell hash tables this is kind of the same concept uh but we want to this way we can kind of like specify keys right and we can specify different Keys um to sort of give us different ways to access the data and sort of give more context to the data so let's go ahead and make one let's just call it a fellowship all right and the way you invoke is sort of the same except you use a curlicue bracket and what you do is when you invoke it so do at curlicue uh and you what you would do is say key one SQL to item one and that might be a string that might be a variable whatever you want it to be what you don't want to do is uh close the bracket and only have one in there I mean you can't key two it's equal to item two actually I'll just call this Fellowship beta oh whoops and what you want to do is yeah see that's not anything it's okay what the heck are you trying to do there buddy all right I forgot my quotes so we'll do Fellowship beta and we'll see we've got our names and our values our keys and our value pairs right so that's pretty sweet so let's actually do a fellowship just a fellowship that's actually set our fellowship so we'll do um wizard we'll say that's equal to Gandalf and we'll do a Hobbit say that's equal to Frodo and let's just do one more we'll do an elf and that's equal to Legolas cool and if we see these key value pairs and we'll see the name we'll see it broken out right there so that's pretty sweet um again this is for storing more complex data sets just had to go over it hash tables are important you're going to run into hash tables you keep using Powershell so what if we wanted to add something to our hash table well of course there's a method for that um so let's do Fellowship and add and we want to add let's say a dwarf and his name is Gimli foreign Gimli is in our hash table it's pretty sweet now what if we want to edit that uh that um key value pair that we just added to our hash uh table there well again another method so what we would do is use the set item method so there's a Gimli I don't know what I'm gonna do our key first I actually see how we want to do this um uh let's set our dwarf equal to Bilbo now let's go ahead and look at our our table again oh we changed it to Bilbo and just something worth noting uh you can actually get at this data kind of similar to an array a couple different ways we can retrieve it from fellowship Dot and we would say dwarf that should work yep and kind of you could use the you can use the array notation too and you could find your dwarf on the table right yeah I kind of feel bad doing that to give me some picking on them here let's add it back to the table we'll just reset them all right good deal so that's about it for hash tables you just if you're following along just made a hash table changed it um actually let's just show a remove real quick sorry give me actually just go ahead and remove you say if I wanted to uh remove it just one more thing if we're going to be full circle I'm working with these I just want to remove the dwarf from The Fellowship uh hope you guys are Lord of the Rings fans all right we removed him no oh he's not in the fellowship hash table that's a bummer so yeah yeah that's that's about it now he is gone removed from the from the hash table kind of sad but that's about it for ash tables I want to switch gears let's go on to collecting user input all right let's go back to our Powershell ISE and what I'd like to do is introduce you guys to the read host whoops commandlet now the read host up too quick for you I see uh what it can do is set a variable uh you could set a variable to the read host and it will sit there and wait for user input so let's just go ahead and give it a shot um we'll set our favorite system to read host and the text uh you can use the prompt parameter and you can set the text that you want it to add it'll sort of add there while it's waiting for the input from the user so we'll ask what is your favorite Nintendo gaming system and let's go ahead and save it give it a run adjustable just a little bit and look it's down here we got our hello world we have our no new line let's get rid of that that's silly save that um I'll just say GameCube boom all right so if we look at the cool thing too I didn't go over with ISE is that these variables you can use this just like a normal command Pro it's not a variable set favorite system GameCube perfect so that's a great way if you have a script that you're deploying to somebody um people probably know I'm big on if you know my work I'm big on graphical user interfaces with Windows forms but uh this is totally fine too I definitely get from a you know system administrator point of view or any kind of program you're just screwing around trying to make uh this is a great way to collect input back from the user to be able to work with it in some kind of way so if we wanted to do that we could say if you want to give them options right we could do hello world obviously that actually we'll just change our hello world first script is growing more powerful we could say hey what is your favorite system and now we can give a different bunch of different options here NES D4 oops GameCube I know I know this is redundant I'm gonna keep going we whoops I want the program to be good Wii U switch well all right no new lines on all these so this should actually just turn around and print um I'll zoom out a little bit so we can see that a little bit better I went ahead and saved it already with control s let's do a run cool hey what's your favorite system uh one we're not actually doing anything with the input yet but you could evaluate stuff on that and we're going to get to that so very cool guys uh let's keep it rolling if we wanted to start evaluating data we would use what's called an if statement so let's go ahead I'm going to make a new script actually and let's say we wanted to evaluate how much how many Pokemon someone had caught to determine if they were right Pokemon Master so at the time of writing this I think the total number in a pokedex would be in all pokedexes I think it's 908 so we'll set that variable that'll just be a string and we will evaluate on it using the if then else statement but we'll keep it simple first we'll just do if then else or yeah if then else so we'll see if Pokemon caught tab complete that out there is equal EQ now as soon as we do that Dash this is giving me all the options I have for operators right here to do evaluations and we're not going to go into all of them because we want to show you the basics here in this quick video which is kind of getting long now I don't think we're going to make our hour mark um which is fine and uh we'll evaluate say hey if it's equal to 908 guess what now when you start it you say if you put your condition inside the parentheses and you put what you want it to do inside a curlicue bracket so we'll say hey if you have caught 900 108 Pokemon you're a poke and ALT zero two three three come on master cool cool let's go ahead and save that Pokemon that's Powershell script cool um so that's just a simple if statement so let's just let's just play with it for a second right and actually I'm going to use this little clear console pin it's a little squeegee I'll squeegee that out let's press play hey you're a Pokemon Master bam we did it we evaluated data what if I caught 907 to save oh nothing we've got nothing back for you so if the condition isn't melt met it melt isn't met what you can do is do an else statement and what to do that you do else and you do your curlicue bracket actually we can even break this down that you'll see this these written out sort of differently actually Boop uh we'll do if so how I like to do it a lot of other people do it only because I've seen it that way so many times well we do another right host say hey go catch or poke there's a grab over the answer special character oh catch more Pokemon cool let's do save we'll do a play go catch more Pokemon bump us back to 908 you get the idea cool so that's if then else but another thing we can use to tack onto this is else if so let's say if we wanted to assess uh we want to assess the Pokemon or Pokemon number right like in in the Pokedex or see for the sake of our example let's do a uh let's do another new script and we'll say the Pokemon what's that a variable called Pokemon number we'll say it's equal to 25. that's Pikachu's number foreign I'm not really sure on the new ones and we'll use another operator so we're going to get a little more complicated right let's use greater than or equal now I know it seems these seem kind of weird and if you use other Pro uh programming languages you probably used normal operators but I do look it is really kind of intuitive greater than or equal to less than or equal to LT is less than right it's really just abbreviated right so let's say greater than or equal to uh zero and less than or equal to 151. oh and it's complaining this because I need a dash on my and and I want to complain about oh oh because I don't have the Pokemon number there we go so we're evaluating it uh hey if your Pokemon number is greater than or equal to zero less than or equal to and actually if it's zero it's not really part I can't so I guess so we'll do greater than or equal to one of Pokemon zero let's see we'll use that to evaluate like a signal or something but anyway um so in Powershell here we're evaluating this variable say if it's greater than or equal to one and it's less than or equal to 151. you want to write host your Pokemon is from Kanto again this is super Pokemon nerdy stuff if you guys don't know about this doesn't matter the Powershell is still important I'm just using examples of random stuff I'm thinking of so uh very cool so yeah hey that's great we're assessing that boy what if you want to keep going right like there's there's more than one region in Pokemon if you don't know there's a ton of Regents I don't even actually know what they all are but you can do an else if and do another evaluation so I'm a big fan of copy and paste and code not just typing stuff out even though I've done that quite a bit here so the next range would be greater than or equal to 152 and less than or equal to 251. we've got another conditional that we've tacked on here and we put it in a curlicue bracket and that would be from the Johto region and we could literally just do this again for the next region which is Hoenn so we would say 252 all the way up to 386. that's about the limit of my knowledge so I honestly haven't played them in a while so you can see how you could really make complex evaluations off of these and it would give you the different feedback on your evaluator right here it's really pretty sweet and let's go ahead and save this and give it a run um do squeegee get that cleaned off your Pokemon's from Kanto I have no idea what Pokemon 200 is oh whoops yep if you don't save it I'll give you that little pop-up and Etc we get it right so that's it for else if pretty cool and let's go ahead and move on to switch statements and I want to make another new script we're just cranking out these Scripts so um a switch statement is a way of evaluating data without having to tack on different variables or different uh conditionals like that over and over again so let's say we want to evaluate we've got a variable for what house somebody is in in Game of Thrones and let's do a squeegee ahead of time so we'll say house equals Targaryen I don't know if this is right that's mayor it's a it's a string variable we're switching on that so what we can do is use in a switch is kind of the same way it's got conditional right so we say switch based on house gosh I love the autocorrect you know IC is really good for being for free Developers I have a lot of props for that deserve a lot of props for that so it's a switch based on that so hey if it's Targaryen if the case is that it's Targaryen Targaryen as well right I don't know say hey you're crazy and and we'll close out our string and for this uh conditional or no for this action on this condition we'll close that out with the semicolon another thing we want to do in our switch statements is say say hey once we've matched we don't want to keep evaluating right so we do what's called a break and we close it and basically you can take this and do a couple different houses they do Lannister these Stark and we could change the messages hey you always pay your debts Stark and nothing is bad it's going to happen at the wall right and now you're evaluating the value of this variable with the switch statement but you're doing different things you're not writing if then if then if then over and over again right so it's just a cleaner way and it's also really good for evaluating numbers maybe strings wasn't the best option for demoing this but it's just a great way to uh evaluate data that's nice and clean and concise like I said definitely numbers I mean if you were hunting for something specific like hey uh if the sales tax number meets this then it's you know I don't know actually I can't think of a great example right now that's why I keep doing science fiction fantasy stuff let me switch house uh we'll give it a little run there we'll see that and start yes save it for me thank you gives us our message back or evaluates data in whatever way we need to for that really cool pretty straightforward now let's go ahead and jump into four loops now for loops actually this will be our for Loop so far we've just done sort of conditional handling right like we're assessing data and doing something with it based on a condition or doing some action based on a condition but what if I want to Loop through different data right there's something I just want to write back write back a name over and over again or I don't know why you'd want to do that that's always just the example I go to when I'm demoing this stuff but you know you wanna add active directory users based off of an array right so what you can do is let's just come up with our own array here we'll call it Halo peeps and if we remember I'm gonna do an equal if we remember we do at for an array we do the parentheses it was the hash table we did the curly q just to recall so we got Master Chief we've got Cortana uh uh Captain keys I don't really think I've ever got the flood I think we'll just step there that's probably gonna all right so we got some peeps there in our halo peeps array and see we want to Loop through them so we do still have a conditional right so with a loop with a for Loop anyway what you do is you say four and you've got your conditions and then you've got your curlicue and what you're going to do for each iteration of this Loop now for Loop has three different parameters it's got a counter we'll start our counter at zero then we do a semicolon and then we've got our condition so we want our counter to be less than or equal to three and a Y3 because there are four elements of this array and this will be real obvious once we execute it but remember the first element is zero so we're going to count from zero up to three and then when it's done we don't want the loop to keep running right so counter plus plus now if you've never seen this notation what this is doing is taking the value of counter and adding 1 to it like one to itself right there so basically here I'll just go it's like writing this but gosh is that a lot less typing so we're gonna Loop through our array and what we'll do is just write host I know I keep using right house there's more interesting stuff to do but it's an easy thing to go back to holy smokes it's we've got our string now you can write more than you can write a string in a variable in with a right host so we can just now close out our string call on Halo peeps now we want to call a specific element but We're looping through the elements right so cool thing about that is we can just Loop whatever our counter is so we'll Loop through our counter and now we've got we'll just call this Halo for Loop it's pretty awesome let's give it a roll actually squeegee that all right let's give it a roll whoa boom We Loop through now we called on those valuables so are those values those elements the value of the element of the array in each iteration of the loop based on the counter so and this Bears out to what we know about arrays already right Halo peeps zero element zero is Master Chief element one is Cortana Etc so that's just a really straightforward Loop and let's see what happens actually I just want to play with it for demo we said five right what if we didn't know how many was in the array it just has nothing it keeps looping through but it doesn't find an element uh four or five so just to say hey that's these people whatever and the trick around this would be to count to have this condition will be the length to either know it but you can actually call the the length value of Halo peeps it and I would get the number of elements right that's right let's just see halopeeps.length yeah four so like yeah we can do that I'm not going to validate let's actually just make sure that works some understand that right and I do understand that that's how that would work hmm oh right so because uh the length is four that doesn't change the element value see this is where it gets tricky when I talk about stuff getting tricky with um uh working with those elements you always remember that zero so it would give us one extra element now we should be able to do arithmetic right in there yep so inside the parentheses what I did right here is took the length and did a minus one to account for the fact that the element uh the first element in this array is element zero right so this is a really good way to do it because now no matter what um say myself I cannot I cannot I don't know I picked Halo you know it doesn't matter what size the array is that you've piped to this that you call or Loop through with this Loop it just it knows right so that's pretty cool um we can take this even further let's get rid of the loop we can just save this in the same script and let's take a look at for each Loops so now with a for each Loop you can actually take an uh kind of like a new instance of the element as its own uh objective variable and I know that sounds weird so let's just go ahead and do it so each peep and Halo peeps so for each peep in Halo peeps we're just gonna do a right host I want you to say hey peep I don't need to call it as an array anymore right I don't need a counter this is a little little cooler right this is like a little more straightforward we'll just say hey Peep has arrived let's go ahead and save it let's do a squeegee we'll clear that out there that's silliness boom oh that is super clean and I don't have to screw with the length so four each is just super super cool all right now let's switch gears and talk about a different kind of loop love loops looping is good Loop called the while loop let's go ahead and do a squeegee and let's set up another yet another array to Loop through and let's do something different in this set because I don't know all the different characters from Halo gosh so let's just do X-Men Professor X I'm just thinking as many as I can think of it doesn't again I don't know how much we actually need to do this demo but let's make it cool right all right all right we're gonna set a counter two so we're going back to a loop that needs a counter that's all right but I can't in good conscience show you this without showing you a wild loot because you know this is stuff when you're writing your scripts this is your toolbox uh these kinds of Loops all the different options be like oh hey I just used a for Loops forever found out about while Loops 10 years later that one guy so we're going to set a counter in a while loop is set up like this say while and just like our other loops and conditionals we've got a counter or we've got a condition I mean and we're going to use our counter and we're going to say while the counter is not equal to six again could just use the length of the array let's keep it um and actually I don't want a dollar sign six I just want six because that is just an integer so we're just going to write out the X-Men's name and we're going to do the same things uh we kind of the same thing we did in the for Loop so where you invoke the elements of the array with the counter and we just do counter plus plus down here at the end and that's it so we'll just say X-Men while all right let's give that a run and we shoot them all back ironically you could uh just Echo that variable back the array back so we'll say is a mute or you do something even uh just go X-Men counter that length we could throw the length back that should work too top of it there you go I mean you just throw whatever you want in there too I mean we're using these real simple examples these are typically more complex or sometimes they are really just as simple so while loop great option uh you know you can get the problem is you can get in an infinite while loop you know you could set it equal to some some condition that's never going to be met if you never had a counter plus plus you can say well counter is not equal to negative one go ahead and save that squeegee and it'll just keep going until I stop it um kind of funny I mean that's that's a gag that's probably a bunch of a t-shirt you can find on Amazon uh you know um hey you know something about our infinite while loop but we'll go ahead and put that back we'll do it there and the thing I don't like about while loops and honestly out in the wild it doesn't seem like you see him a lot you see for Loops maybe I don't know or four each is kind of a go-to just because of the object uh is that you know you're doing the counter plus plus down here for loop it's just a little more buttoned up to have it here um it's sort of like a predefined constraint you know that infinite Loop thing is kind of something that people get hung up on so that's about it for the while Loops but there is yet another loop of course we'll just stick with our X-Men here we'll stick with our same counter too in in Powershell and other languages there is something called a do while loop it's another sort of weird thing uh to do and actually I could have just left that and just reworked it but I'll retype it that's not a problem so we'll say do this is where you define what you want to do before you define what the conditions are we'll say X-Men counter is a mutant I'll close that out but now you put your conditions down here conditions is not equal to six I know hey if anyone's still not asleep I forgot to put that right there that would have been an infinite while loop and to tie this up we'll just backspace this here and we'll do a squeegee and go through it works the same way Loops are loops so it's just so straightforward and uh you'll be happy to know that's the last Loop I'm going to show you uh so let's go ahead and move into defining functions so now we're going to kind of get out of the programming stuff and we're going to go into defining a function that does something and it's going to be something super simple and we're going to name it uh well let's just go ahead squeegee and how do we Define a function now we can Define a function by just typing function what we want the name of our function to be and we're just going to make a function that tests um whether or not SpaceX is responding to pings so we'll just ping SpaceX we'll call it test SpaceX and this is what the function is that we close that out and inside of here is what we want it to do so we just want it to Ping spacex.com and we'll go ahead and just name that function test SpaceX foreign we will call the function and you'll see what's really cool I always love this that it ISE will just pick that up it's like yep I made that that's me I want to call it let's go ahead and give it a run pinging SpaceX cool and actually if I just went to test SpaceX down here I can now execute it it's in the environment it's defined within the environment I can do that right there I don't you need to type it anymore so that's pretty sweet um but what we can do even further is make a little bit more of an advanced function right so we can say say I want to just notice on the pings it's got this many uh pings it's sending out what if I want to be able to Define that and you can so we're going to call it param or Define our own custom param inside the function and that's going to be ping count but you can't just do that with ping at least well maybe you can I don't know I'm not going to there's another uh commandlet that does what Ping does but you know returns objects called test connection popped right up love that love that power show I'm always Gonna Be A Nerd about that and we're gonna say we want to call the count parameter all right and we want that to be whatever we set ping count to so we can change the pin count when we call it now we can call it and it already picked it up I love that think how about 10. let's see what I'm paying it 10 times I don't know why we'll punish ourselves here let's clear it out give it a run and you'll notice this looks a little different because this is test connection not ping that's not really a rendering of two right here because it's I got a super zoomed in but we've got all 10 of our pinks here alternative our test connections and that is uh is pretty sweet but now as an advanced function we may want to say Hey look if I don't have a pin count here I don't think this is going to work actually yeah because it needs that count function well we can make something a little bit more advanced with commandlet bindings so what we would do is set a commandlet binding and I'll just do this here turns into advanced function it's like wait where what the heck is this thing why are we calling this so we still have our parameter bindings but now what we can do is make that parameter mandatory and we can further Define this is well we can Define it as a string I think we should be able to finance and into 32 actually I think string would work I'm trying to think now let's try in 32 maybe it needs to be a string I don't know let's give it a shot we're out here doing Powershell stuff what happens when I do it now hey it knows that it's mandatory and it asks me for it I love that I mean that is just like super cool thing all right we'll do seven pings to SpaceX I want to be a black from spacex's website probably all right cool so that's a way to make a slightly better function uh when you're making custom functions and let me just back up I should have said before we're jumping into this this is the problem with doing this in roughly one cut um you know why do we want to do functions because we have a task that we want to do over and over again right so if we need to Ping SpaceX over and over again and I don't need to you know I don't need to know why I don't want to type spacex.com and all this this is too long this is shorter I mean if nothing else it's shorter right but it'd be way more complex reasons to be able to do this you could have tons of different parameters just like the commandlets that are built into Powershell and uh making custom functions is really just a huge a huge piece of Powershell scripting that we can't uh Can't Ignore so now this is this is a something that's also real interesting I want to jump into make a new script to error handling and exceptions so think of an exception it's like an event that is created what a normal error handling can't deal with the issue right it's like hey I don't like it's one thing to have error handling but there's other times there's like exceptions like hey what is this what's going on here Powershell doesn't know what to do so like trying to divide a number by zero right or uh if you were like had an infinite while loop and you ran out of memory because it just dumped just totally hose The Machine's memory um those are kinds of things that would create exceptions um and you know if you're copying other people's code my code included and I do it you know sometimes we're just trying to slap as a system engineer uh we're just trying to slap stuff together to make it work thank you thank you to our security people that catch our stuff that's not good uh but you know oftentimes if we don't have time to make something super resilient we're not um so there might be exceptions uh all over there so one exception you can uh one way to throw an exception is just use the throw command and we'll just throw out it's a trap and we'll save that exception ah it's a trap exception without an exception all right that's cool so let's go ahead and do a right use the right error commandlet thank you I see and we'll do the message it's a trap and it's got a parameter called error action and with that we want to stop so let's go ahead do a play on that same thing it's a trap actually we don't want to actually squeegee that out it's a trap it's a trap twice before all right so what we can you do to handle these errors is using what's known as a try catch and actually no hang on a second um we really need to do this as part of our SpaceX function over here foreign this what we're doing right now we're just demoing error handling and I can't ignore error handling because it's such an important piece so now we have our error action so we'll try and actually hang on a second I do a curly cue let's complain it test SpaceX it will do an error action stop and we'll catch the if that happens we'll catch it we'll write output just do right host but maybe you can't with an interaction we'll just say hey there's a launch problem because we're nerds and then we'll per the syntax we'll write whatever the output is so this will grab the output of the error action close that with a curly q what do we get we're forcibly throwing the error we'll just do two uh launch problem again probably didn't need to go through this but I don't know I actually do want to show try catch and I do want to show um really what you'd want to do this for is if uh you'd want to evaluate this test connection right and this is always going to work so this is sort of a bad example um unless spacex.com went down right now but uh and say hey look if this fails I want to throw an error action and this would uh throw the air action and you'd have other handling this way you have a handling mechanism for that error that's not just an if statement or writing to a log or whatever so that is that is it for the error handling let's switch gears I know that's a lot of stuff if you're sticking with me I appreciate you we're well over an hour but this is a lot of different Powershell stuff that we're going over here right now and it's pretty good stuff I mean you the fundamentals have gone over were able to do you'd be able to do quite a bit um you know you should be able to jump into a Powershell script and kind of see what what it's doing uh figure out what commandlets are doing uh see what modules are there are and uh figure out what's going on so let's go let's switch gears back to our Powershell console window and I want to do a little bit of without the pipe let's create uh a file it's just straightforward stuff it's not terribly exciting but it is a hundred percent exciting because it's Powershell let's use the new item commandlet and this will create a new item into our namespace and what I want to do is create an ewok uh text file in our scripts folder even though it's not really a script so I'll do Scripts Ewok let you work text type file we specify that in the parameter and we can create the value and we'll just say praise C3PO boom and it gives us that output back hey what's the right time what what was the length of that what just happened LS look at all the different stuff we made now we just made an ewok.text you've now used the new item commandlet which is pretty cool but another system thing you may want to do is create a new folder so let's go ahead and do that and you can use new item for this as well this is why I like new item because it's just more versatile right so we'll say c Scripts and then we'll give it a name I'll just call it the Death Star why not let's stick with Star Wars and the type directory are we doing LS we see our death star directory right there boom pretty straightforward now what if we want to copy something right so let's go back let's make a now let's copy our Ewok actually let's copy our Ewok uh text file into the Death Star ewoks in the Death Star so what we would do is we'll say hey let's find our tap complete this Ewok so copy the copy item commandlet uh real straightforward um even Linux would just be a CP source and destination uh except that you do specify the parameter so see Scripts Death Star boom so let's change directory into the Death Star do an LS and we see our Ewok text is there if we move up Ewok text is still there because we didn't move it all we did was copy it now if you did want to move it let's say we want to move our what we have there force with who we could do the move item and again we do the path parameter we find it and actually I'm not even doing this but um forces through text I don't need to keep specifying the whole path but I do need to specify the destination and actually I don't think I need to specify that Death Star Force of two and look in the Death Star and we see it there hey we're moving files around we're having a good time this is pretty awesome all right now if I wanted to delete a file we don't really need that Ewok text here anymore right so what we could do is the remove whoa whoa whoa don't want to tap complete when you have a million other modules and stuff remove item um and we'll just do Ewok text and for some reason that we didn't want to we thought this wasn't going to go through we could do a force oh no no I think it would be Dash Force actually which I'm not sure but I don't think actually we need to do that let me just remove it oh I'm in the Death Star so I just removed it from the Death Star so sorry pay attention to what director you're in that could be dangerous production environment cool cool so what if I wanted to just confirm if a file is there well powershell's got a great commandlet for that called test path and no parameters needed see Scripts Death Star I don't even need Death Star see if you're tab completing it's probably not there you can almost test the path so yeah that's kind of ironic we'll just test it test path and what does that return to us a Boolean very cool so that would be something you could run into your if conditional and say hey if test path uh and you wouldn't even need to put anything else because an if statement would evaluate it off of the true right so that is about it for some of the file stuff I wanted to go over um actually let's do a rename so let's rename our force with who so we would say path of course with who and then we have to use the new name parameter and we don't specify the path here I don't think force with me a text between LSA of course with me we we did it again why go over this stuff in scripting you're going to be using files sometimes this is just good basic kind of file handling to know um so I wanted to go over it with you guys now time to switch gears yet again I want to show you is the last little bit of this Powershell to programming tutorial how to work with active directory if I didn't I would feel kind of weird is a lot of people are learning this to work with active directory so I have a test environment right here that I used recently at a conference um it's a school we got some users in there so let's go ahead let anything like that like that now I'm gonna run this as administrator I'm a wonky size right now so let's go ahead and do an import module I've already got this installed active directory Boop all right that is how you import a module now we have all of the commandlets available to us from the active directory module and the first one I want to use is get ad user yeah we're going to look up Mr F Baggins and boom we found our user just like that get 80 user now this again like I said I already made this hole this is a totally test environment that I have that I use for training stuff and presentations Etc and I've already got a username Frodo Baggins with the user F Baggins we just found him and now you can now that he is a and we can see just the basic information about him right there um but what we can actually do is we can set him to a variable um so let's say let's call it oh geez we got so much stuff sort of tab complete can get you can I get 80 user all right cool F Baggins now we see user actually do a click clear there and let's uh so sorry about that guys new user all right so what we can do is with the user variable if you do a DOT I can start tabbing through I can get at the variables or the values for that user so there's this distinguished name let me go back to the DOT check yeah that was a good one if it's enabled to give a name let's see why isn't the oh give name given name off the differences there yeah there we go we've got Mr Frodo right there um pretty sweet um now you could uh actually so this is great right you can uh pull information out get out what you needed to say you say you wanted to Loop through a bunch of users you can get a collection of users uh or you only want to display different information right like I wanna take his user Dot given name pipe it to out file users.txt let's do a cat yeah we can see the value of that right so we could start adding more and more information I mean this is a great way you can start pulling data out of ad uh you know in a script that you have in ic right that you're putting together I don't know what the use case is I'm just kind of again the purpose of this video is to show you guys different stuff powershells capable of um so uh I think that's great and actually you can now let's let's do a different commandlet with a active directory let's do a set 80 user let's say we want to change photos name let's change a surname set 80 user so what we have to do when we do that is add them to a different or specify the identity which would be a Baggins say we want to set the surname whose last name to my name Tyler that's right I wanted to name my son Frodo all right so let's go back to the get 80 user F Baggins oh and see it doesn't have certain oh yep dad does right there yeah I didn't change his name up here but I did change his surname right here so obviously you would have if you were changing someone's name you would want to do that over and over you and all the appropriate spots but if you were making like a syncing script that synced uh off of like a CSV or something somewhere out in the wild uh you know this would be a great option uh yeah you can start setting these you would use set 80 user to change them to reflect whatever your data source is so uh that might be depending on your environment that could be a payroll system that could be uh you know some other identity management system like a school information system you know that's where we set a lot of our data in the school environments right so um yeah there's just a lot of different applications there so I want to go over adding a user to a group this is really straightforward hopefully I do it right I've said that about a handful of things and we've just kept moving so I appreciate you guys not being too harsh on me um this is the last stuff to go over so I want to add a group member a set yeah add 80 Group Well number number and with this you're actually specifying the group first right because you're you're kind of doing something to the group you're not really doing something to the user kind of both but you're adding the user to the group so I already have a group named Fellowship and I'm gonna go ahead and add uh Baggins Bang so if we just scroll down here guys to bear with me so if I go to the groups here and check out my numbers there he is hey I did that with Powershell it's pretty sweet yeah Frodo Baggins is part of my fake Schools administration too by the way um yeah so that would be how you would do that and then let's say if I wanted to remove him do the same thing it's actually just a different commandlet are you sure yes and I don't know if I need to refresh I'm going to check the fellowship members oh my gosh she's out of the fellowship so pretty straightforward um I want to show you guys too like on that set 80 user I don't know how many people are doing this you really want to have these Advanced features here because when you drill into a user you can now see um right there the attribute you know there's a ton of different things to be set um a lot of different properties and I just want to make sure if your content for something you need to know the name of it because some of the names are weird like would you know that surname is last name right um why is that out here oh no no this is yeah this is like related to the the sitter I believe actually so yeah never mind about that other than I will say just leave that open right um just because you get it leave that checked in the view you get all this extra stuff that you you can see here so Let's uh let's actually add a new user too uh while we're doing it no we'll use the new 80 user and there's a bunch of different stuff you gotta specify when you're doing this so I'm just gonna add geez I don't know I've added so many characters to this um I don't think I've had any Star Wars to the CD environment uh so let's add Luke Skywalker so I'm going to specify the name I want to specify the given name which would just be his first name I'll do this surname all right Walker and then we'll do the Sam account name and that would just be like his username uh we'll just do a little Skywalker wants her to do oh yeah the user principal name geez I got one just sitting right there user [Music] principle that's pal name um BL Skywalker and is that org that's the domain we're in and uh the path oh yeah so we'll put him in administration um I decided distinguished name on this I don't know so that would be OU actually that attribute editor I just showed you guys that that's a good spot to get this if you need to figure out what this is exactly will you equals staff not Dash o u equals mates to C equals minutes so obnoxious DC equals org should be good if I spelled everything right and what if we want to set a default password um so to do this it's got to be a secure string so there's a commandlet called convert to convert to Dash secure string oops say Uncle o n y or exclamation so we gotta um put that in the string oh yeah that's right uh and we'll see that's as plain text right so we're not using encryption this is a really good great security practice but it's a way to do this we're going to force that because we might complain about that and let's just specify that Luke is enabled and we'll set that to the true variable blue and boom wow one command uh yeah great see if it actually dumped him there and we have to refresh ah there he is scrub there Luke Skywalker uh to get all the information I wanted I see that this is actually the email field so if you look in the user principal name where that is yeah it's right there oh that's what that would be derived off of um yeah I mean you know you could do that same thing you can set the enabled to false and you'd have a disabled user to start so yeah that's uh yeah pretty pretty straightforward way to make a user not bad if you had an automated script that you wanted to do this this would be the command you would want to use it right now and again if you need to know how to do anything in Powershell just Google how do I do this in Powershell you can find it so let's say hell I screwed up and I wanted to um change that let's go back up to our finer set 80 user wait hey Uncle Owen one is not what our default password's supposed to be are you crazy I believe the same uh we should be able to do this just like this I believe I know I've done this a bunch of times uh uh yeah so we would yeah you wouldn't do it like you would as a parameter there oh no or do you do it like that let's see convert to secure string hold up oh he doesn't know Auto I'm gonna talk about uh uh Ben Kenobi it has plain text and we'll force that get there oh no apparently I can't be found that matches the parameter name account password all right yeah now that's not how you do that just want to ignore all that actually the way you would do it is uh I totally forgot set 80 account password identity L Skywalker reset new password oh I was trying to do that that way threw me off when I saw it being done that other way you know but hey there you go and we do the same thing convert to secure string as plain text open and they don't go back right of course boom boom ah and then you have music video requirements um that's right when you so when you make a new user you can give us a crappy password but oh yeah no no I take it back in this environment it's not it's just not long enough oh Ben one two three there you go here's to this password that's how you reset a password um ignore that other stuff uh still a good idea good troubleshooting when you're doing commands uh just just yeah it doesn't matter how much you know if you're not doing it all day with Powershell you're not gonna remember I'll have to type your head right away guys but uh yes that's good stuff I think um I think that's all I had that I wanted to go over with in this uh this video I really appreciate you guys um definitely check out more videos just anything else you want to learn about Powershell uh just Google it no definitely uh I mean that's true um check out my classes on udemy I'll have links to those in the in the description and uh check out some of my other videos for sure uh subscribe to my newsletter jimtaylor.substep.com and check out my website powershellengineer.com give me a follow on Twitter at powershellenge I'd love to follow you a file back uh I really appreciate you guys I hope you learned something about Powershell Powershell is an amazing tool and that's why I sit down and sat down and made this video because I just love working with it a lot of fun I hope you guys continue your Powershell Journey Keep learning stuff make your organizations Better automate stuff and uh don't be afraid to make mistakes I made mistakes in this video and I'm leaving them in because you know what we're now perfect we're not experts but we do have something to offer so thanks so much guys like the video subscribe comment with questions Corrections appreciate that and I will see you guys all around goodbye [Music]
Info
Channel: PowerShell Engineer
Views: 204,049
Rating: undefined out of 5
Keywords: PowerShell, Learn How to Code, Learn to Code, Systems Administration, Active Directory
Id: ZOoCaWyifmI
Channel Id: undefined
Length: 108min 21sec (6501 seconds)
Published: Thu Nov 10 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.