🔴 Our five favorite PowerShell modules

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everybody Welcome to PDQ live uh today we are going to be talking top five pow modules which is very subjective that's an opinion piece but before it's uh it's package Wednesday it is package Wednesday which happens the Wednesday after what Patch Tuesday and as you can see there's all our nice little packages oh it is the time of year okay uh Jordan what what are the new packages what do we have this is actually pretty cool and it's been requested for a very long time deploy an inventory there you go bam nailed it uh like we said it has been requested for a long time and this is kind of our our Christmas present our gift to all y all uh it's now available which is for as much as I love automation manually installing deploy in inventory every time was just a delight for me I bet it was I bet it was so there you go uh and just uh just know that we'll update you on what the new packages are uh the Wednesday after patch Tuesday which is the second Tuesday of the month if that's confusing enough MH all right take it away okay so top five modules which is very subjective every week on the podcast we ask this for top three and we get a lot of variation and it's the most difficult question I think you can ask is the best power module because there's a lot of really good ones at first it was top 10 and you were like I can't do it well we couldn't do top 10 in the time allowed so what we did did is we found I think top five that add quick functionality for any level beginner to end and we're going to highlight those I love how you still can't even commit to the top five you can't you're just like there's too many well there because there was multiple inputs mhm the top five for me would be different for Andrew MH so I think except for PS read line I think PS read line everyone agrees awesome is the best mod top it's a top yeah okay yeah all right so we're going to cover PS then I zoomed in so everyone can see I'm going to share the screen there all right can everyone see there uh looks like really small oh oh you were joking there we go all right we actually we went to terminal so we can zoom in just for Marcel okay you got me good Jordan good you got me good probably I hoping You' Panic oh is there something wrong with the screen share or yeah that's exactly what I was doing all right so if we do just get command for PS read line and PS read line is a weird one because I think 2.0 by default is comes with the product uh what what am I doing module PS read line man typing is difficult all right so there there's your commands for this one so at this core B PS read line is a bunch of functionality to make dealing with the console and finding the command y for easier so the first like if you have a history so if I do get command you can see you get the little highlight there of ones I've done look at that I've spoiled the future Andrew without console grid view so gives you those commands yeah you did but if we do the lot of customization so if we go back to the get Dash Comm or get we'll do get module if I do like specific module and I'm not sure what is looking for install module not get module Andre man you were messing up a lot you should be embarrassed you're talking to Andrew right now or me I mean no Andrew he over here it's my fault over here watching me type poorly obviously boy I can't still can't get mul to Tab out there You tab as your friend tab as your friend I would but I think it locked on me there we go oh there we go I like Powershell I'm control space huh did I did I do it wrong name all right I guess you trying to install the new version no I just show and so here at name I'm not sure what it's looking for if I hit F1 it'll open up the help documentation to the name String where we were in a magic window magic window so you don't have to break context you're all done here hit Q you go back right back where you're looking so if ever you're in a command you're not used to okay being able to hit F1 just to open that so if you just go with the main command and hit it it's going to go to the start of it yeah and you can find out when you know so install module takes X so you don't leave the your working space yeah so it just it really helps with uh it just helps be able to find some more information about the command without having to break Focus yeah cuz anytime you're in there program and if you have to break like you leave the window you just lose momentum you just do so that's a kind of a nice one nice yeah and in Powershell we always tell beginners one of the top tips is use the help system and I think honestly a lot of times people forget to actually use it and this is just one more helpful way to get information about whatever command or parameter you're working on quickly and then getting back to working on the command all right so I did uh command this is get PS function read Handler these basically the shortcut keys built into PS read line I'm bringing this one up because I'm in Windows terminal which all of works great out of the box uh if you're using VSS code F1 has another function already I think it opens up the command pallet mhm so the F1 for the in context help's not going to work so either you can set up a different key than F1 here by by changing the hotkey here or you can modify the Json file with vs code but there is some customization vs code to get the the help context all right what else you're supposed to be help me out here Andrew yeah I got you man use the best words here go use the best the best the best feature within PS readline is some additional functionality that it adds which is a history file across all your sessions and we kind of saw a preview there when Jordan was typing you saw the white text that popped up where he could it kind of filled in previous commands and if he pressed the right arrow he could fill it well that's looking through his PS3 line history file um which is a super helpful way and we'll show a way to customize the feedback provider style which is what that is right as you're typing it's giving you feedback on what you should type or could type based on your history um Jordan do we want to show them the different way that it'll kind of search through all your history and show a bunch of different results yes but real quick in the chat someone asked does it work with PS5 and IC yes it does but I don't think it comes in by default you have to install it or really you should be updating to the latest version anyway because 2.0 is missing some stuff yeah definitely want to get the latest version Microsoft has invested pretty heavily in this like their Powershell efforts they're really trying to make it a good experience in the console to make it a first class language that everyone should use all right so what I'm doing is I just uh did PS3 options I hit control space after the dash just so you can see everything that you can customize with that one but I believe prediction view style is the one that you were talking about so the default the default is just the little Gray Line that you see there if you go list View and then you do get command it gives you a whole list of everything you have in there so this is where you pull from your history mostly it removes duplicates by default but also if you have a feedback provider which is basically a so there's one for Azure there an AI for Azure you type in an Azure command it'll give you your history up top and below that it'll give you everything that the AI thinks you might be doing so it helps the functionality in case you haven't typed it before it gives you helpful suggestions yes oh and and James point I should have said yes the arrow key does autofill the predicted text if you want to oo uh and definitely worth reiterating this searches previous history some of these commands we ran yesterday on the test show thing um so if you're running Powershell commands and you run something where you're like connecting three commands and it's kind of confusing and you run it once it's successful and you want to bring it back up maybe the next day if you start typing in part of the command you'll get right back to it less time typing more time automating away your problems so question is there a history is there a limit to the history will it save it forever you can set your how much it keeps or how far back it goes okay yeah it's pretty big though by default yeah it's it's yeah it's you don't have to it's probably going to keep a longer history than you would like as a beginner this seems pretty important yes and if you are looking to use both a feedback provider as well as your history it's just uh prediction source to history and plugin set that there and that should help we don't have any feedback providers installed but those are really useful especially for Azure there's so many different Azure modules there's so much that goes into those having some sort of AI like you're probably looking to do this is not bad can you describe those really quickly feedback providers it's it's a just a AI for the command or module you're looking into so like a plugin kind of yeah pretty much yeah it's a extra install you can do okay yep and to reiterate on PS read line uh if you don't have the latest version which probably most people don't install module PS readline Dash force and if you want you can include pre-release Dash include pre-release I believe it's the switch for that and you get the latest features it's okay people can't read that fast don't read the words but there's a lot of customization you can do and build on top of PS3 line which we'll show a little bit of that later maybe um but just out of the box you get that prediction history thing where you can just press the right arrow and it searches through your history which is a huge win it saves me a ton of time so definitely get it installed and if you're not really at the point where you want to dive in deeper to fully understanding PS read line you can still get value out of it and just kind of tuck it away in the back of your head that there's this thing called PS read line that does a bunch of cool stuff I see pretty colors please tell me you're customizing yes so in here if you want to do set PS readline option and you have comment color you can modify the color to be whatever you want so yes if you want to move to non defaults and make me cry a little bit I want hot pink you absolutely can't do that I'm not changing the dang thing that's shocking I'm all about the defaults mhm you are all right uh are we do we have other stuff to cover on this one we want to go the next module I think that's that's pretty good all right what is the next module Jordan I'm so glad you ask because I actually have a fantastic module in fact it's one of the top five modules in some ways um the next module I'd like to introduce you to Jordan you might not have heard of it it's called PS resource get so I just mentioned install module and that uses the Powershell get module which we've all been using whether we know it or not for a while to run install module install script get uh find module things like that and that didn't really cover everyone's use case so the Powershell team has again invested a lot of resources in rewriting it um to support new things so instead of using install module uh you can install microsoft. powell. PS resource get which is the latest version and you can install things using install DPS resource and this provides a few benefits um one of them is that you can install scripts modules uh new packages the same way using the same install Das resource command and I know that for go ahead Jordan so it's basically it's a lot of what install module does just different on the back end right there's not future proofed exactly it's where their current and future development efforts will go so it's good to be aware of and if you're writing new scripts um that take advantage of install module or things like this you should consider using install PS resource um if you're a beginner and managing packages is already kind of a little bit of a daunting task you can just go ahead and continue using install module but I think as time goes on we'll hear more and more about PS resource git you'll start seeing the install PS resource command in different places and uh wanted to share this with everyone so they could be aware of some new stuff happening all right I like it I know I had some modules I'm supposed to cover I didn't bring you we got a lot of good good modules to cover but you know it's a Hot Topic these days Jordan what's that AI have you heard of it I have heard of it let's get some pictures you know it's funny that the two that I'm covering as my main focus are both written and created by Doug Fink which to me spend some time in his repo he does some great stuff but he did one with the AI mhm M uh which if you've ever tried to go out to chat GPT and it's like oh we're too busy if you do an API call instead of going to the website you don't get that it just works MH uh that doesn't require some setup you have to go to like chat gbt my account SL API I'm in I'm in the ballpark yeah and you have to you have to generate a new API and you have to put that in a specific uh system variable okay and you can have it as a secure string and with that it will use that to be able to make a call so if I do let's do AI let see what I asked yesterday do I have the correct API key I like to ask that one because if it comes back with an answer then is yes yeah see I do but this is Handy just because it's a quick way to find useful information without having we talked about with the help not breaking your focus and going somewhere else being able to just quickly say AI how do I do blank or you never have to leave power shell again yeah what's the other one what's the code help one I'm forgetting the name it's called the co-pilot is command yeah so if I do co-pilot and then yeah we go how do I get the PO shell gallery to be trusted Terra hey that wasn't me that was Andrew remember this was a valid question this was a valid question yeah and that one if you use co-pilot and not doesn't just come back and say here here's a command for it it says this is the command that will do that do you want to run the code that's pretty handy uh but I think we're missing the most important part and and that's Dolly image yes let's draw some images first of all I'm not going to make the Powershell G Gallery only an idiot would do that hey on your uh system up in your office would you say that repo is currently been added as trusted yes I would okay I would say that well I'm not going to shame you anymore uh so what is it get do image except for it's going to be you know what I'm going to go back to vs code because I don't want to do all the typing no we'll try it so we'll do dollar sign a equals get Dolly image and then what what am I what am I looking for hippos hippos that's it just hippos I'd say Jordan on the PDQ webcast but yeah okay let's see it let's see what you look like the PDQ I hope it's just breathtaking it's going to be breathtaking let's find out all right that's going to go out and it's going to have the computer draw me a pretty picture well no it has my name in it it's going to draw a picture hippo in bathtub I think I think in the the dry run we did hippo doing a bench press and he didn't look comfortable no not at all no all right so when I I just did I set it to a variable so I wouldn't have to go find where it saved it can I just click on that vs code would let me click on that and dollar sign invoke now invoke Dash item which is basically it emulates a double click sort of thing it'll open up the default program and yeah who's that oh my gosh Jordan you look good my man wow what did they just add some wait to Matt Stafford and call it me is that an AI pick yes what in the heck all right well actually just a Rand Facebook photo of some guy I thought we were friends I trust AI so much now let's try hippos in a bathtub I am not going to try that one yeah the bathtub things so I I recall we had one time hey can when usei to come up with a useful image for I think it was like a thumbnail for a YouTube channel and the answer was no no we could not no okay but the the more important part is now I'm going to go to VSS code okay you really want to go back vs code's your friend it's where I'm at so this one I added a different module this isn't one of my favorite modules but I do like it it's basically it takes an image mhm and what do we want to do this one hippos you said you seem stuck on hippos I like hippos they're cute and dangerous my favorite hippo ballerina mhm okay so now it's going to go out and it's going to create the image and it's going to convert that to asky Art he said without having tested it boy I hope it works what could go wrong what's the worst that could happen all right see and this is why it's important you can get some real real value there cannot find IM all right so yeah it didn't work it didn't well I mean we tried this is actually a known bug within the module mhm uh I believe it has been reported to Adam bacon but he's all like oh I have a job in a life whatever Adam all right so yeah it's not it's going to fa on me on that one because it's it's going to make the image but it's not going to convert to text but if you go through and fix this eror and I believe it's documented on his git how to fix it then we'll go through and do that one but uh that wasn't the Showcase I was hoping we're not going to end on a hilarious joke as I had hoped I really wanted to see the hippo that's upsetting life is difficult okay all right Jordan just to reiterate though we showed some simple examples obviously this could be tailored to some complex stuff to ask more advanced things um after a bit of setup in the beginning where you set up your API key you will be able to have another tool in your tool belt where you don't have to leave Powershell and I think that honestly that's a bit of our theme for some of these modules is how can we make Powershell easier to use reduce the barrier of entry for getting automation done um and this definitely helps because if you're working on some code you can prompt AI just write there and ask some questions about it yeah I guess if we want a real world example I just I asked it what's a 4 each Loop and it came down with a looks like a pretty solid answer for it so if you're looking for some quick information you don't want to go hit the Google don't want to leave your your context that's really useful to have it does a lot it adds a lot of value all right it's back to you Andrew module up back to me you know good friend of mine Timothy McCabe I believe in the chat was talking about out grid view I might be wrong about whoever said that yes Timothy McCabe out grid View and that is a fantastic option to display some data Jordan could we show that command well let's run a get process and we'll use the pipe to connect it to out grid View and what we'll see is that it actually pops up an external window that's like a grid view of whatever data we give it so this is going to be processes one second I got make sure I'm not running any bad processes okay we're good oh yeah scroll yeah kind of a simple way often times we look at csvs we might be looking at ad whatever the case may be we get a bunch of data we want to look through it for some reason inv visualize it this is a cool option bad sign and it goes against the principle of what we've been talking today it pops up a new window can be kind of annoying we don't dig that what we do dig is terminal user interfaces so it's basically like a goey but it's right there in the terminal on top of what we're looking at so Jordan if you don't mind could you um run install PS resource microsoft. powell. console goey tools I can't because I did it through install module already oh well you could force it no you want me to do it that way do it live it might fail or risking it for the biscuit yeah at this point not only has it already been done but it's being actually used right like I couldn't uninstall because it was running you know I'm not going to question it I'm not going to question you're in charge here I'm just along for the ride yeah you shouldn't have listened to me I try not to oh look at that it's going I'm going to trust it works hey that's so fantastic right there it went awful quick almost like it was already installed yeah it was pretty good I mean wow this new module's Fast let's go ahead and run get process and then pipe that to out console grid view again console's the thing where we're running Powers shell it's displaying it for us we're interacting with it yeah boom now that looks fancy that was a whole lot of fanciness for just a simple command how how is this different than the just the outg grid view that we just showed can I interact differently with it or something it's in the same window were you listening it's in the same window single pain in that is a huge there's that Tera you get it you get it yes yes um honestly it's not super better than out grid view it is just another option I've found more success whenever I'm building tools for myself or for other people if there's less Hoops to go through less Windows to click through um and this is one way where you can quickly present data now presenting data is not that fancy but we can make a tool out of this can you believe that I can and I'll introduce you to the parameter for it Jordan so let's push the up Arrow key to get our previous result in our oh wow that was fast yes and now so there is a parameter called output mode I didn't know we're going there you didn't did you I like to mix things up there's output mode and output mode has a couple options you can do single or multiple so you can what it it's going to be doing is outputting whatever you select in the pipeline which means yeah let's just run it just like this multiple is cool multiple let's run this all right ex click on two things click on yeah all right so we have multiple check box exactly see the little check boxes and then when you're done you're going to press enter there we go bada boom and it passes those uh processes that you selected that's not that helpful to be honest with you until we connect that with another command pretty cool you see we're going someplace here pipe that with uh stop process D what if look it's almost like it's in our history yeah it's like we prepared for this yeah all right so I'm going to choose I'm going to kill these process which one is the one that runs the webcast I'm going to find that hey now all right so so if I hit enter it should technically except for since we put what if it's going to say important so you can select multiple processes there enter and you could kill apparently those randomly selected processes I killed code in ch obviously not the most um helpful tool right here but this can be adapted to anything you're dealing with anytime you want to spot check data or filter it yourself or whatever you can start using out console grid view to do that and then once you have a tool that sort of works that's all you need it's just that one liner um where you connect the commands and bada boom maybe for some people that'll be the first function that they write the first tool that they create and are able to distribute yeah so that one's more of a you showcase just how quickly you can get some sort of results but the value comes in if you build something where you're pulling back any amount of data and you want to pick and choose what to interact with having that there just makes it easier exactly just a nice way to make a tool and add some filtering on your end um I don't think we should show it right now because I think we're running a little low on time but there's also a command called show- object tree that's a part of the console goey tools module which is worth checking out you know what we can show it he's showing it Andrew he's a rebel okay I didn't so it's going to show an object tree of nothing so what we're going to need to do is give it an object and Powershell most things return objects like get process returns process objects and yeah if we connect it with a pipe bada boom we have a graphical representation of a object with nested properties and and all kinds of fancy stuff so it's a nice way to visualize data cuz objects can be confusing in Powershell especially in the beginning to understand like what am I looking at here what are the process names this is a quick way to get a grasp of the data that you're dealing with all right so we're on the last one import Excel yes sir all right so with this one what I'm going to do is I'm going to take uh the output from connect reporting because I'm a heck of a Salesman and I'm going to use Port XL to convert it into a a little bit more readable than just a CSV so I guess first things first we're going to go to reports and we're going to run all apps which you you look at it here it's there you go list of all the applications you have in there but we're not going to run it we're going to export that and it puts in the download file I don't know if you can change that I totally didn't run that yesterday all right we're going to just copy that and go back and put it somewhere where it's easier to to reach the temp folder and extract all all right so all it did is it took the report that we saw run and connect it made it a CSV file the data is in there but CSV is not great if you want to send it up to management you want to move on them to and a MH o and a and all that jazz all right so import Excel is a command that lets you take a CSV or an X or an Excel document and do a lot of customization okay so in this one I'm going to take those apps and I did all apps because we don't have a lot in our lab and there's not a lot of license software but in this example we say we selected a whole bunch of apps where we have limited licenses too and I'm going to convert this into a pivot table will give me a list of the software how many used licenses there are and what machines they're on and we're going to audit it make sure we're in compliance absolutely okay this is Top Line so this first line here is I'm taking the CSV and I'm putting it into a variable MH maybe did I did I notame it right all apps CSV oh it's all apps one I didn't name it right nice Jordan This is why you're an amateur can't even find a rename come on man here we are there it is and there I think it probably better do it for the file too NOP oh nice the file is right the folder wrong okay all right now now it's going to work now I'm going to load that CSV into a variable all right so the next one is uh I'm taking the CSV that I have we're going to export into Excel document uh if you have Excel on your computer you don't need to give it a file name you just hit show and it will print out it will show you in Excel what it would be and then after that I'm just basically saying make it a table and we're going to build a pivot table off of the software name and everything else uh I I to show this is nice already exist with data in that range anyway let's hope it worked let's find out all of the all of my stuff all of my stuff's not working we're going to go in here and what do we name it new file okay R oh it's because I had it open within Excel already and I couldn't delete it properly it's almost like we practiced yeah it's going to go back we're going to try that again let's do it again I'm going to do do a dash Force just so it overwrites what's ever in there is there even a dash Force for that one I don't think there is so we don't have a desktop version of Excel and that's why it's opening in sheets in pivot web not a so what I did there is I opened up a pivot table beforehand I believe and I would have to know what I named it to close it did I close all of my office 360 oh my goodness maybe Amateur hour I blame office I'm going to get fired it's always offices oh you don't have to worry about it we'll go back in book four see if we can't open it or maybe the problem is I didn't delete the the old one is sees that same name well looks like we made made progress all right so this is the default there's all the CSV yep the pivot table on two is where you see this is list of all the files you have this is the total number these are the computers that have one so if you're only worried about the total you can collapse those but just a quick way to take the CSV is just a bunch of data and make it into something you could save this send it off to your manager he can o and a he can be thrilled it's so pretty he he can golf clap that he has the image that he wants MH exactly I like that uh another example we have in that one which we we can it's up to you if we want to spend the time how much how much time it's I'm basically loading a different report and doing yeah let's do it all right so this we're going to go on hard drive space which back to reports webcast example free space I'm going to try that one just just to see let's see all right once again is the export into the downloads folder cuz it's where it goes are you going to put it in temp folder I'm going to put it in temp folder okay good good yeah unfortunately until we get the API I don't know if there's a way to automate where you can say go grab this one and put it in a different location so there's still a bit of a manual component but the API is coming and we're going to extract it this is the exciting part y all right so this one's just all the free space and on this one by default it throws the percent in there which with Excel changes a whole bunch of the function it still tries to by default put in his text so I did change the Powershell a bit and I said the same thing we're importing the one that I just built uh and then this next part is I'm going through each value and everywhere that it has the percent free I'm just removing the percent sign and then we're going to come in here and say if the result is less than 30 make it red that way that way it just gives you a nice chart of these are the machines that probably need more free space okay I like it well we'll go back to Exel again this time look at that no airs it's going to be so pretty I nailed it I feel it I like my extreme confidence I do too it's red and there you go yeah so that's just two quick wins like import Excel does so much more and if you go to the GitHub they have an entire list of complex examples of converting data but if you're dealing with large sets of data and you don't want to spend time you want to automate the part where you put it in Excel and make it beautiful or useful import Excel is must have it it makes all of that stuff and you don't even have to have Excel to run it you can I built these Excel objects on a machine that doesn't have Excel installed yeah it just it's it's awesome to have agree yep I will say that when it comes to sharing data with people who are not you presentation actually does go a surprisingly long way one of my big wins I had at a previous job was automating some reporting on license usage and just literally looping through it all and creating a work page for each one and adding some simple um formatting to it to kind of make it look nice and add a little header at the top and we were able to share that with people in accounting and different um places and have them be able to uh interpret it without any fancy or needing to read a crappy CSV basically yeah the main takeaway is if Doug says he guys a new module you should probably look at it CU he puts out some awesome stuff we do have one question if you'd like to uh all right let's do it that when you install the latest Powershell version or generally what do you throw out which module SL components sincerely Marcel so for me I don't I stick with defaults I almost always have I do update PS3 line to the latest version because a lot of the functionality we covered is a new edition so I update PS3 line other than that I keep it pretty much as close to default as I can I'd be curious to and I run update help oh that's a big one yeah update help is pretty much it I don't know of anyone who removes some of the things that come with Powershell in the um beginning yes it's more of a add thing yeah I know a lot of people profiles where no matter where they log into a system it builds their profile out to the way they had it but that's a personal customization I I couldn't even begin to especially where I keep defaults I don't have a lot of on that one but yeah I don't don't I I don't know if I remove anything all right well thanks for tuning in uh I love talking Powershell I can't imagine a better better power shell for me to handle this one I had a lot of fun with this one thank you for letting me talk you ears off uh for PDQ I'm Jordan I'm Tera that's Andrew way over there in Florida basking in the sunshine thanks for joining us today if you have additional questions feel free to reach out to our support forums or you know what leave us some YouTube comments and like And subscribe we love that thanks again we'll see you back here next week
Info
Channel: PDQ
Views: 1,055
Rating: undefined out of 5
Keywords: PDQ Deploy, PDQ Inventory, SmartDeploy, pdq connect, simplemdm
Id: Qoxl9L0494E
Channel Id: undefined
Length: 34min 28sec (2068 seconds)
Published: Fri Dec 15 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.