Improving the Shell Experience using PowerShell POSH with James Brundage

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
good evening ladies and gentlemen welcome to another meeting of the Research Triangle Powershell User Group my name is Mike nakis and tonight we are going to be talking about a new module called Posh from a gentleman named James Brundage who will introduce in one second but before we do that my co-host for the evening is Mr Steve and Judd Hey Stephen how are you oh Mike I'm doing really good and I'm very excited all right so I know that you know our guests very well uh Our Guest James is uh a good friend of the of the group an esteemed Community member um I am very curious to see what James is going to be sharing with us tonight um James welcome to the group how are you uh thanks for having me on I'm relatively all right you know I'm the category of people that you know says when they're going through a bit of stuff so when my dog's going through some health issues that's a little bit of light stress hopefully we don't got anything short because of that yes and so for the people at home James is not a dog uh he just has a picture up of a dog in replacement of his wonderful face and that's quite all right whatever makes the speakers feel comfortable I mean I'm only sometimes metaphorically a dog and I'm gonna have to give a light plug here uh I'm using obs's virtual camera OBS is a great little uh streaming software and I built this module called OBS Powershell for it to uh you know do fun cool stuff so you might see a meme or two if I can you know stream effectively today I'm not sure the thing I'm liking here James is how you've got two different waveform displays going on your screen that's pretty slick thank you uh one of them's me uh and the other one's uh basically what's playing through my headset I noticed that it's super cool thank you uh it is actually in the I will be releasing the cool script that can do this in a one-liner and the next build I promise sort of category but obviously prototyped um and so this what you just talked about James is maybe the perfect segue for us to get to you because um James has spoken for our group in the past he's spoken in many different community events one thing that holds true with James is James is very enamored by Powershell creates lots of interesting tools and loves to share what he does with others um and so the idea that you built your own OBS module does not surprise me yeah yeah yeah and and so I'm you know we talked prior to this I you know my interest in pipe script so maybe we'll even do another one on pipescript in the future but yeah you know there's a go ahead I was just gonna say there's a lot of people that watch our meetings on YouTube and don't have a context for the community and may not know exactly who you are what you do so why don't you give us a little idea of you know who you are and like what your day job is because I think a lot of people would be interested to know that well let's see if uh PowerPoint is my friend and uh how this all looks yeah you know the first slide I got for you very very easy presentation I'm working on is who who the hell am I I'm James from start automating I'm x Microsoft ex-powershell team member and a Powershell consultant trainer that is to say uh if you need a Powershell project done call me please and if you want some Powershell training we can also set that up in fact uh just because the easy thing to do you can go ahead and sponsor on GitHub and actually get a Powershell training session set up uh or get recurrent sessions one-on-one on one on money on whatever topic you choose at whatever time so think of it as user groups on demand uh here's some social media contacts on on various ones to various levels but not that much on any of them I'm at jamesbrew on Twitter or X or whatever it's now called also what a dumb marketing move uh why would you name something the literal slang for something you break up with I don't understand anyway not my problem not my pay grade I'm at Mr Powershell on Mastodon various mastodons twitch and Tick Tock although I haven't started really tick-tocking in Earnest yet I've been programming in Powershell since 2006 I joined the team uh the month Powershell V1 came out and was pretty involved in B1 and B2 and B3 and ever since then I've been basically helping people with their Powershell and you know Finding joy in life by building lots of community tools and toys and today we're going to talk about a fun one so hold on so hold on you hold on you just unpacked a whole bunch there and I don't want to spend a bunch of time talking about this but I do want to give some people some context uh and then I want to get out of the way and let you do things but so start automating is your own business correct that's correct yes and so you are a full-time Powershell developer not for a single company like employed as a W-2 employee you do uh custom code like for projects and Contracting for various companies that is the preference uh I also am bookable on W2 just it's often kind of under that Banner anyway I don't you know Pro tip for everybody here if you have a consulting firm then you never have a gap in your resume because when you're not working for somebody else you're working for yourself yes so uh yeah I uh have worked for a pretty astounding large variety of companies at this point I stopped counting some time ago uh I think uh in terms of some guesstimates that I've worked for about 10 of the Fortune 100 over the years uh but I also love just kind of getting on calls and helping out people with their random Powershell questions and stuff in fact that's where I'm trying to find both more joy and more stable income throughout life and and so to just the bring this together um the reason I brought this up is because you have what I think I have heard in my career probably eight or ten times from fellow co-workers what many would consider a dream job full-time Powershell developer working for himself and so at some point if you have the opportunity maybe towards the end of the talk or the middle whatever if you can talk about how that Journey occurred I think that would be interesting to a lot of people I think that would be a fine one we might need a whole uh long conversation just I'm happy to go and do it in public honestly at this point it's part of my own life's journey on it um the the quick long story made short though is that it's been an incredibly personally rewarding because I love working with Powershell and continuing to kind of grow the language over time and seeing what people do with it and helping them out and I've had the opportunity to do that at this point now for well 16 17 years I've done Powershell every day of my professional and most of my personal life for those years and it's brought me a lot of great joy and it's done a lot of great things on behalf of a lot of clients um that all stated uh there is a neatness to expertise and there is a uh feast or famine effect attached to that so um in years that I've done well I probably made more than most people on this call and years that I've done poorly I might have made less than your Paperboy so um it is not all sunshine and Roses uh but also do they even still have paper boys um but uh it has been really really fun and when it's good it's been very good uh it's just also uh sometimes a little bit of a Stars need to align in order to get the really cool and interesting Powershell project that is really desperately needed now and there's less very lucrative versus you know the the company that doesn't really need that much but means it you know over the next few months and didn't expect somebody that could do it in a month and since by so you know there's uh a little bit of diminishing returns on on extraordinary expertise that also stated for everybody else this is very much a unique problem uh there are so many line jobs in Powershell now and it makes me such a proud papa of the language that I can't even begin to express I was talking to Bruce Payette a couple weeks ago and was like hey man this thing that we built created a half million jobs that's crazy right hmm we're on a whole user group conversation full of people that make a living off of Powershell like you might think it's the dream job but you've got the easy version of it where you don't have to like you know Chase everybody's dreams but you can find all that joy and Powershell and a nice steady living and that's something that didn't exist for tons of people 15 20 years ago and a lot of the people in Powershell came up from you know non-technical backgrounds or non-expert spaces and got massive improvements in their life so it's been really really really rewarding and I'm not going to you know stop enjoying that sort of reward uh it's just also not always you know Sun's Shrine and roses but Powershell that Sun's shining roses every day for some of us you know we feel like we're doing we're getting to explore the benefits of the work that all the people did before us and sometimes it feels like we're standing on the shoulders of giants and so we you know we're all very grateful for the amount of time that that you and Bruce and the entire team put in and you know not to Discount what's still going on because the team is still rolling you know Steve is very involved steeply that is with making sure that Powershell stays on track and gets new features and doesn't break everything behind that came before so you know that that team is is still doing yeoman's work and love it so thanks James for all you did thank you and I again that's part of the Great reward I don't know I'm not gonna you know call myself any form of giant but if you're building Frameworks and you're building capability for others to use the most rewarding thing that can possibly happen to you is seeing that utility and I went from basically fighting a very Fierce internal battle within Microsoft hey this is Powershell this is gonna be cool you guys need to pay attention and you know doing some of the same thing externally by you know showing off hey here's these cool things Powershell can do and basically feeling like it was you know a small team kind of against the the world to I can walk into a Data Center and see row after row after row of computers running Powershell Powershell is you know not just a lot of people's jobs it's a whole sector of the industry and yep every additional thing that I build that you guys get to use just makes my heart you know swell with joy and pride uh not necessarily at myself but like what you guys can do the the really rewarding ethos of Powershell has been making things easier and you know making it so that you don't have to be any form of giant to do gigantic things to move mountains and anything that I can do to continue to make that happen makes me a happy you know camper so well let me use that to segue to what we're going to talk about tonight which is the reason that I sort of brought this up and I didn't mean to kind of get a little bit off topic here and so that's okay there's a reason for this and that is um we have a certain caliber of people that come on and present and very much so the things that people present are very much corporate work oriented right this is this problem I had to solve at work or something like that I mean we have a fair share of presenters that come on and do fun stuff as well but one thing that you're going to learn very quickly hanging out with James here is that and if you breeze on over to his repo and I hope you have a link you could share with us if you haven't yeah James has quite a wide array of tools that he's built with Powershell to do things that you might not even think about doing a Powershell and so the dream job of being a Powershell developer I feel like James is really representative of someone who kind of lives the life I keep seeing stuff that you build and it's for things that I would have never have considered to try to address with Powershell and so if you really if you're watching the home and you want to find out more about James visit the repo he's got a a a very large bag of tools that you could use for not just how do I get data from active directory or how do I get you know data from here to there for some corporate thing but like how do you control your lights at home and how do you control OBS and how do you colorize your code and how do you do all these things and oh by the way I built my own set of utilities to write all my code faster there's a lot to unpack with James and so um I guess what I wanted to ask you is what uh is what brought you to the Posh module what was the idea here and then maybe you could take it from there all right well I'm just going to go back into the slide deck because I got some quick answers to that and your slide deck just so you know and Steve maybe you can answer it's not send it on the screen so half your text is cut off oh no I don't know if that's a team's thing or just the way you sounded the slide it's because he's sending it through the video so if we turn off our videos then he goes full screen I believe well let me try doing this for a second I think I can also share content from camera let's see if this works uh uh share does that work there we go there we go yay yeah that's good I'm gonna turn my camera off anyway all right all right so we covered the who uh today we're talking about this new toy posh and Posh is this new Powershell module makes the shell a little bit more Sleek it enhances formatting makes the shell easier to customize it hopefully will help you learn Powershell and when and where uh we'll get in the Y and a half second that's the one you asked it just dropped to Tech member 2023 which was a great conference and a lot of fun that was a couple weeks ago I had done a talk entitled fantastic formatting with the easy out easy out is actually the oldest Powershell module it is used to write formatting and types which are part of Powershell that's been there since the beginning and our basically there to help you format how objects are displayed and extend existing types they're also unfortunately horrible XML and nobody likes them hence easy out and uh I perpetually get asked to talk about easy out and people had kind of complained a little bit about easy out containing formatters I guess we're kind of bleeding into why so where can you get it it's available on the Powershell Gallery uh you can also get it on GitHub and here's where we get to the stupidly Brave part of the conversation here I actually have a new versions pull request queued up um and I love the smell of cicd in the early evening so I'm just going to go ahead and merge that now and delete my branch and go to watch my actions run this is built with another module called PS devops and this lets me basically get this outdoor so in a few seconds we should see the new version come out and it go out on gallery so uh just a quick thing for you James just keep in mind that your Cool Wave formatting thing there is going to go uh yeah I'm getting rid of yours and I'm gonna try to adjust the opacity of this one here yeah there we go also I didn't know we were doing a GitHub push to repo lightning summary [Laughter] uh uh you know there's lots of fun here I'm just kind of a little annoyed that it took a little bit longer than I'd like to publish uh but to be fair it's actually been running the other parts of the action for a second so okay we got release 0.12 I'm gonna actually drop that second waveform entirely sorry hopefully the other stuff will be cool enough okay all right uh and we should be able to go to Powershell gallery now on the bright side I am pleased as Peach that I was actually able to get the module name Posh on the bad side there are a lot of other modules that have some variation of Posh so it's on the second page here now and yep we have a new set of bits out so go get the ones fresh off the press okay so you can get it on GitHub github.com start automating slash Posh please start and show your support uh I am actually legitimately trying to make GitHub sponsorship in something of a business model so you know if you like modules please star them and consider you know giving sponsorship so why build this I make little sayings to remember things and one of them is never do anything for just one reason so here's my quick short set of reasoning to make Posh one I needed some fantastic formatting like at its core this is started off as uh not exactly demoware um I wanted to show something that would be well various leak formatting and I had a presentation coming up number two people really like colors and spicy shells like this is just you know proven by downloads I think like if you looked at oh my Pasha something like 2 million downloads and presumably that's not a CI CD heavy pot module that is roughly two million people were like I want to download this um so you know maybe it'll be popular uh number three is that people did not like easy out including too much formatting a bunch of the formatting that is in Posh had been an easy out for a very long time as kind of an example and this actually got a pretty negative reaction because easy out was primarily is primarily about creating these types and format files for you and it disrupted what they expected in terms of shell experience so people had basically said hey you should put all that into a separate module for a while and I finally got around to it um the other one is a little bit tsunami uh you talked about you know not being too business focused but uh modules are Brands and this helps make modules more marketable including itself that is it helps you see screenshots and videos and demos and all the other things that help make a module really pop and the other bit is that gateways are good uh this provides like a nice little you know siren Call into order to show people all sorts of other fun stuff they can do in Powershell that they might not have expected and also creating something cool is always good for business uh same general principle um I don't mean to be again too schmarmy or businessy but oh look at me I'm doing cool Power shell stuff please hire me you know that that is at least part of the name of the game to the dream job job you talked about it's continually building out stuff that says look this is cool Powershell so that's why I hope it's not too crass of a why uh should we get into the how or jump right into the exploring what do you guys want to do well um so you built this because it was fun and cool you had it in need right and so what's the general sense of what people are going to see with this module tonight like just this is a this is a mod like for people who don't know and maybe just stumbled into this this is a formatting module to colorize your console in more than a few ways right yeah that it's a module to help improve the Shelf experience okay and so the how is how you built it how is how I built it yeah we would love to see that but so my suggestion would be um let people see your colorizing and then I would say let's talk about the how after you do that just so we don't get too far down the rabbit hole and people don't understand what the heck you're talking about but that's just all right yeah okay so I'm gonna do one quick thing here I'm gonna you know switch back over to my main branch oh I need to get rid of some files here sorry I can type I swear this is actually why I have show demo so I don't have to type in most of these cases but the show demo being another one of your fabulous Creations yes which we'll be using in a second I promise so right now we have our normal Powershell directory output or file output in this case these are the files and Posh Posh is not yet installed or imported and we're just going to go ahead and import module Posh or dot slash because this is the way I love to import local modules let me just stop you and so for if someone is sort of a little newer to Powershell what they're seeing on the screen right now is just simple Powershell seven formatting just the basics that comes out of the box I don't want people to think that the assets build demos is part of the stuff that you did you're basically saying it's going to get we're going to go bigger from here this is what you get by default with Powershell that is correct right okay so actually I'm gonna say pass through when I'm going to import this module because one of the things that formats is itself well that's cool thank you um I actually do a similar thing for the OBS Powershell module as well uh but basically you can add a formatter to anything and you can there's a thing called duct typing where you basically say essentially you're a duck and in Powershell you can very easily modify something called PS type names on any given object and add whatever type name you'd like so one of the first easy tricks at play is that Posh decorates itself basically it says hey I'm not just any module I'm Posh and then I write a formatter for that and therefore you see this instead of the normal module output now when I still do get module I still see basically the normal output but let's go back to a file view now we got these icons we still have our colorization we've got our length in kilobytes or megabytes four gigabytes for that matter everybody with me so far oh so you know I didn't even pick that up because I was looking at your module ahead of time so it's not just color this is really a formatter for common items so uh this particular one is a formatter for you know files and directories but yeah it tries to make length better too and last right time is the First Column instead of having a mode or access which isn't useful to everybody under every circumstance very cool uh in fact like slight pet peeve here but uh inside of a GitHub action uh the formatting for files is so kind of annoyingly bad that it'll always truncate the file name because it's busy displaying the user which is always docker so it's like okay thank you for that useless information in exchange for the useful information that I really needed so one of the things that I'm trying to do here is basically take things that kind of suck in Powershell formatting and make them better there is also the module terminal icons and I'm not going to demonstrate this because it gets a little bit funky but you can use terminal icons in lieu of this and still get basically their you know presentation the thing with terminal icons that kind of sucks is that you have to have nerd fonts installed and nerd ponts is a really large package of well fonts for nerds if it's that important to you to have an extra special Powershell icon go ahead but I personally think this one looks quite fine and there are a lot of emoji that work on any given you know font that you'd like so at this point I'm I'm pretty happy with just trying to find appropriate emoji so you're basically saying um nerd fonts has its place and and uh and terminal icons and all that but what people may not realize is to bring that down and have that running on your system requires a lot of baggage and yeah and you're saying I could basically do the same thing a lot less with a lot less baggage but hey you want your terminal icons you know what fine I will show it important module terminal icons so you can still have your terminal icon so I'm not saying that this is going to be the prettiest part of this particular thing I don't have to care I mean it's not the only trick in this book or bag so let's see if uh my child I come yeah I just have to remove both modules for it to be happy again okay let's do that again and see if I've made this demo a demo terminal icons nope I'm good back to normal okay so James uh you're probably going to cover this but I'm curious how did you determine which columns in which format oh I don't know um years of experience got well what I mean by that I probably asked that question poorly is uh pouring over lots of emoji and saying did this seem right and picking ones that sort of lined up with each other uh so if anybody has had the unfortunate uh experience of trying to build their own formatter in the built-in Powershell you go into XML uh your area that's kind of what I was getting at is how did you do that sure let's bring over the project we're into the house let's go into the how all right so which one did you want to see the file system okay so we actually have a two views of files one of them supports the icons at this point and the other one does not uh mainly because I haven't made the icons as customizable as I would like Okay so let's start with the easy part instead of writing uh well here let me test my luck with F5 that's the large XML that's required to make this work this is what this file does it produces that XML for me right format view that's easy out okay so we're saying we're writing a format view or the type name file system types this takes a bit of annoying explaining and file system types is basically the only one but you can either say that your decorate or you're displaying a type name or one or more type names or what's called a selection set which is basically a group of type names with a name so you can also include the XML directly if you feel like that masochistic or you just want to get around what it can do naturally and this is what a selection set is so file system types would format directory info and file info okay then I'm saying I want three properties last right time length and name everybody with me so far yeah but I am I'm going to let you finish a thought then I'm going to slow you down for a second because I have that's okay yeah all right so then we're going to cover this part next and that's just property alignment you can actually align any column left right or Center in this case I'm just doing two rights in the left okay um just to enhance dependability that's better than two wrongs make a right a bear and you know I do set up the dad jokes every once in a while uh the next part I was a little tedious uh as you can kind of see but basically it's like hey do you have a length okay are you bigger than a gigabyte cool display is Big gigabytes are you bigger than a megabyte cool display use megabytes are you bigger than kilobyte cool displays kilobytes if you're not a directory info otherwise display how what your length is so if you're less than a kilobyte it'll just be a number if you're more than a kilobyte it'll be you know number rounded to the number of kilobytes or with two decimal places and so on and so forth okay so a lot of little Annoying code but not really that frustrating um and virtual properties are basically just the the term and easy out for what you're doing in formatting which is you're basically saying I'm going to display this property and it's going to have a script block as its value instead okay and it took me a while to realize it but you can drive a big truck through that hole like you can basically add colorization and formatting there too so that was our length okay then for our name we do a couple things first thing we do is we figure out is there format terminal icons this is where that particular magic works and this is a little bit more complicated than many but basically uh I'm letting it fall back explicitly on this if you have it so if I found this great I'm going to use that actually now that I'm seeing this I understand why it requires me to unload Posh before it stops or starts working again anyway um next thing is a little bit more hard-coded than I would like at this point uh but basically if you're a directory I'm gonna go use this thing in PS style now PS style is a pretty new thing in Powershell and I'm kind of mixed on it but I have integrated it with easy out NPS style gives you all these different basically ways you can style something in ANSI uh the thing that's kind of nice about this is that well it's built right in and the other thing that's kind of nice is that if you're using this form of style it will adapt to whatever color scheme you have in the terminal or inside of vs code make sense yes cool so they also have a few kind of special options here one of them is file info and file info basically give you a color that you can set for the directory or for an executable and I actually add a little bit more information to this as well but you then have this extension format that you can use that basically says hey these extensions will be rendered by that color and that's what this code does here is checks a do I have something for that extension great do that and this is something that I added uh just basically because you can add member to PS style so I added a dictionary for patterns and now I gotta have other naming based or colorization based off of the pattern I'm not doing this yet but the reason I would want to do something like this is you know well PS1 XML file isn't just any XML file and say a Docker file doesn't have an extension but I might want to colorize it does this make sense yeah okay well I'm looking for a a graceful break here okay well we're basically at the graceful break because the rest of the code after this is basically here is my I'm going to make this extensible you know part of the app but I haven't done it yet and then here is my hard-coded if you've got this extension these are the icons we're using and it's just a big switch and then at the end of this oh yeah real bonus points that I should show you here so if I do a directory here see how these are underlined if I can control click and boom I can open the file wow that's cool thank you um and this is basically let me close that out and close that out one second so this is just if pipe PS style has a format hyperlink and I'm not in a GitHub workflow where it's going to basically just show this as a blank anyway then I'm going to use format hyperlink and I'm going to link you to the file and this will work in vs code and in terminal in vs code the files that are going to open that it will open are restricted to the workspace uh so anything underneath the workspace it'll open in vs code anything else it'll just basically say no um in terminal it just basically invokes item so I can like you know go direct do a directory of my videos here you know Home Videos and in terminal I could click any one of these and just play so so I guess okay now we're we're at our stopping point for a second okay Mike I got a quick one before you jump in sure oh just a quick one yeah quick one I am not I'm James would you go back to what we were just looking at where the had the GitHub I'm not familiar with um which which is what that environment variable yeah environment variable with GitHub on it oh sure I'm not familiar with GitHub workspace could you explain that um most of the CI CD systems that you have like Azure devops or GitHub workflow they set a bunch of environment variables so all that I'm doing here is I'm and this is a thing you can do in formatting as I'm checking to see if I'm in a GitHub workflow because if I am in a GitHub workflow that environment variable will exist so if I can format hyperlinks and I'm not in a GitHub workflow and honestly I could probably add a couple more lines of documentation here to make it a little bit easier slight touche but yeah I would probably add a couple more for Azure devops and other CI CDs as I use them and get to them I would be a little I don't know surprised if it works in other ones if it's not working GitHub workflows uh partially because of the way they're built um I'm also kind of a little annoyed because it wouldn't hurt that much to be able to have a click of a link in your logs but this is a thing if I did this in GitHub workflow and I was displaying this you know output of a directory it would not link the files correctly and it would just display a blank there and that would suck okay all right that makes sense thanks Mike okay so I'm kind of glad that we went off the rails a little bit when we did intros because it sort of set the tone for what we're doing here and and that's great but we went from the beginning of the your demo which was fine and was still fine and somehow when we got to the how I James I should have expected we went like right down into the plumbing and 300 level stuff and and that is completely fine one of the reasons I love having James you've been asked present no that's fine the one of the reasons I like having James present is because you get to see how someone like James thinks and works and James can work very fast there's a bunch of stuff that you brought up that I am sure audience members did not catch so I want to go back a little bit but before I do that I wanna help out people at home that may be confused you went into the plumbing of the module uh I went into how the module was built yes right someone who's interested in my ideas module does not need to be concerned with what we're looking at you answer the question that Stephen asked about hey how did you build those columns and and it was fun to go off on the Deep weeds of the plumbing yeah module Posh and have clickable links and vs code and not give two shits about anything else right so I'm just saying if you're interested in this module and you want to play around with color you don't need to go into these files and learn how to configure this stuff essentially you've done this work for them that is just happened to talk about how I did it so if so if you're interested in this module and you're like whoa I can't do the stuff you're saying you wouldn't be doing this you he's showing you don't have to right okay so with that being said for the people that were following along and watching you what some people may not understand James and I know this from talking with James at Summits and from other demos James builds a lot of tools and James has figured out along the way that James wants to build tools that help him build tools as fast as possible so there was a point there James where you showed the long XML file you even made the comment oh this is the long XML file that gets produced yep James has his own tools to write those files for him and that may not have been understood by people that right format view comes from another module that James owns that James created that I know from history James uses these as utility modules to do all the heavy lifting of his module building and code writing so that he doesn't have to sit there and write thousands of lines of code he's figured out ways to automate as much of his workflow as possible and so I mentioned that because when you talked about this for someone trying to follow along they may not have picked up on those little like where the hell did that come from kind of stuff so yeah there's a lot going on in your modules very cool but if people don't understand sort of the guts um they may get lost yeah well on that level let's let's talk a little bit about I I I'm I'm not been ever a big user or something like plaster but I have kind of been coming more and more to a fairly standardized structure of how I lay out a lot of my modules so you got an assets directory and that's going to have well any images or anything that goes along with it okay got a build directory and that's going to have any files that are used to help build the module in this case we got a few we got our easy out file which basically goes and builds our types and formats we got our GitHub workflow file which builds our GitHub workflow we got our help out file and this actually basically loads Posh and gives us markdown help for every script method in it we got a little pssvg file which helps build us a logo and this one's a little bit of a light cheat Posh doesn't actually include any commands directly but it does basically have this functionality of a module called splatter kind of as part of it so these five files basically help automatically build the whole thing now you got demos directory and that's you know showing off how it works docs directory is where all those markdown files go and also it's going to be your root of your GitHub page formatting directory that's going to contain your formatting okay and it's generally PS1 and xmls or sorry format.ps ones but it can be format or format xmls or view.ps ones as well okay the technical difference here is that views uh will basically assume that there are a custom formatter by default but they can be exactly the same thing um so you got different formatting directories for different stuff because it makes it easier to kind of see so I've got all the file system stuff grouped I'm gonna get to this one but this one's empty at current I'm going to make get help and work in color two I promise uh but I am not there yet I've got all these formatters for Posh itself I've got some formatters for reflection I got some formatters for some regex I got some formatters for some XML and I'm going to just show a demo of this in a second because that's going to be a lot easier than you know walking through each one but the structure is fairly logical you should be able to go to the repo and explore going further down you've got you know the definition of its GitHub job which is basically you know run this check out the repository go use pssvg splatter pipe script easy out and log my changes to this thing I build called git logger which gives you basically insight and what you're checking in for a bucket repo a month and underneath here you got uh I haven't finished it yet the kind of concept of presets so we're going to come back to that maybe in a future talk and then you've got a types directory and this basically has all of the extended types that you want to do so I've got you know some stuff for Posh here and I've got how commands are displayed and now errors are displayed and little extensions to the host and the stuff that I haven't finished on presets yet and profile manipulation and stackable functions including input and prompt and then a bunch of stuff that makes PS module infos easier like being able to recommend other modules having a logo having a demo file having screenshots being able to get tests and getting videos so lots of expansion to Powershell no commands if I get Command Module posh there will be nothing because this is built entirely with types and formats which is in my opinion kind of cool um let's go show off an actual demo and save me some typos so show demo I'm going to demo this okay here we go I'm just going to make sure I've got this re-imported and show demo is one of your modules that you've built and if people are curious about using that visit the repo visit the repo it's nice it prevents typos and gives you this nice little you know auto typing format for displaying your demos this is also like a very old thing in Powershell made new again show demo uh is like a newer version of a thing that Jeffrey Snover wrote a long time ago called start demo but okay it's really it's really good and I like it I think the last time I did one of my janky demonstrations where I was showing how to type into the console automatically James kind of caught me afterwards and said have you seen show demo yeah it's it's it's been handy and one of the things that I'm happy about with Posh is that I can basically now say if any module just puts a demo PS1 in there well I can get module for each object demos and then I could pipe that into show demo do I want to see how a module Works boom good done okay show us show us Posh we could cue we could cue James up with uh anything yep you can so uh the only thing that Posh exports is itself as a variable dollar posh uh and one of the critiques that I got as far as the name already was basically hey if you're gonna name it you know Posh and you gotta be able to do more General Powershell stuff than formatting and so I'm trying to make that possible too um hence the formatter for it and the nice way you can pipe it to get member and see what else it can do but let's take a quick tour of how it'll make the Powershell shell cooler I'm actually going to start recording for a second because I want this one too so show files and color with clickable links this is step one and we can get module Posh split path which basically gets the directory of the modules in get child item there we go same formatter you already saw no typing required Posh icons do not require nerd fonts and will be ignored in favor of terminal icons if that's what you prefer or if I'm going to make an old political-ish Riff on it you know you want your terminal icons you can keep your terminal icons Posh up so updates the formatter for get command um this one's a pretty new one uh although Posh itself was only a few weeks old so pretty new is kind of variable but this one was created specifically for Posh so I'm basically going through the list of what commands do we use all the time in Powershell that don't have good formatting and get commands formatting is and I've got four columns I mean we just added to the point where we can have colorized files why shouldn't I be able to colorize commands also I don't generally need to see the module version of the command every time so you know just the name in the module is fine and I'm going to colorize the name based off the verb ready oh that's pretty cool thank you look at that so you're covering I also do some metallicization yep and basically it's the same sort of code as you saw on the other one at least right now where it's got a little switch statement and doing some regex for what verb is what color and I've tried to make sure that verbs that are right next to each other are not the same color and verbs that are similar are similarly cover color and there are a few ones that are so generic that I said okay you can still remain in white estimating and I also did try to make certain verbs that could be quasi-dangerous uh basically warmer colors uh well I mean it's totally color scheme on this uh here I mean after this we'll we'll go show like uh changing color schemes around I just don't know which one I have loaded right now so another one that I had in Easy out for a long time but uh wanted to move into Posh was formatting for get member does everybody know get member sure ah yeah I I call get member get command and get help the Trinity of discoverability like because they're just the way that I find my way around Powershell all the time like I don't okay I don't know what you you output what property what name was it again pipe it to get member find out right so Posh that's that work in color too so you're coloring based on the property type I'm coloring based off of the property type and the type name and the name of the thing and also a little bit to help you see you know curly braces and the like it's very cool looking thank you and I hope it's a little bit more useful because now I can basically all right I want to see what methods it's going to be I'm looking for yellow want to see what properties I'm looking for green I want to know what type I can very easily train my eye to look for a particular color and seek the information more easily and I mean this is one of those things that like uh uh a has been sort of studied over the years B uh I've learned a little bit too much about uh the long story made short to the degree it has been well studied is there's a guy in the 80s by the last name of Tullis who uh figured out that seek time is related to basically uh column count to the number of different uh it takes you an amount of time to read something based off of the number of different distinct points of horizontal alignment which means on a basic practical level even though I can Center stuff in a formatter I almost never do because centering actually forces your eye to receive sync all the time but what this gives me is basically pretty clean Columns of when things change so the column spacing already gave me that changes in contrast effectively work like changes in spacing so I can actually look very rapidly at you know that property column or very rapidly adhere or pick out a type and it's very very easy for me to find the key pieces of information that I want and if you wanted to figure out essentially that seek time you're looking for basically how many times your eye needs to move to get to the the exact point so if I wanted to figure out you know what type can I get from two string even though that's a really obvious one I'm looking for scanning down for this then this then this then this so a tallest rating of nine very fast so you're essentially saying here that Powershell puts out a ton of useful information but very rarely do people read Powershell like they're reading a book where they would read every word on the page and so you're trying to say I'm defining a way here to sort of show the different variances of data so that you can find what you want quickly and get to the piece you want so if you're not interested in properties you can just bypass all that because it's all looking the same and the methods stand out if you're not interested in methods and you just want properties they sort of stand out on their own so that's kind of you know really smart and useful because I never really thought about it until I saw it with the color like this I see this page all the time when you do get member and some commands especially like string stuff will throw up you know 30 40 lines and I'm like I really only wanted one line out of the 30. and so you're sort of making the data that I'm looking for jump out a little bit more and I can find it easy that's pretty cool thank you and yeah that that's part of the point here and honestly as I was saying towards the beginning I feel like this is something Powershell initially had a good lead-in and now needs to kind of LeapFrog and so I'm kind of trying to basically bring all of the Powershell default formatting up to the next level and you know like I I don't think asking you to install one module to get all this is that much but so um formatters so I want to go with that but I want to ask a question about just the start of this okay I missed what you I missed the importance of the dollar sign Posh so I installed your module what do I need to do to basically invoke this to make it run is it just install and it's on or install and import once it's imported all the formatting will snap right in okay and so yeah everything I see here is there for you and you'll be good okay so install and import and everything that you're sort of showing here just becomes the default yep okay okay so oh there we go sorry it took a little bit of focus stealing to get me back there um already shown on the output for git command that's also easy to explore reflection now sometimes you know what type something is but you don't have an actual instance of it and I basically said hey I want that to be in color too so I can pipe any type to format custom but I'll get this this is the short form believe it or not a summary view of its properties methods Etc okay so this is all the stuff and it can do or at least all the stuff in in 32 can do directly and I can actually pipe this into a different view now this is a good thing to highlight here because it's not really well known about Powershell but not only can you format an object any number of ways you could have any number of views for an object okay so this is the short form well not the quite shortest form for that just get the table view that you get normally but you can actually get all the information including its subclasses with format custom Dash view system type full and before you even ask this also works for generic types read them and weep all right so I'm going to ask you a question that I don't know that you can demo here okay but you know I have very little experience with format custom and so I'm guessing a lot of people watching do as well and so you sent this to format custom what would format custom normally do uh um because I don't know that people are gonna pick up what you're doing if they don't understand what format custom does on its own that's a good question okay so there are four built-in format Dash commands in Powershell okay format table format list format wide and format custom the format table and format list you might have run into before they're you know Common enough and they give you somewhat direct control over how a particular table will look okay format wide as I say in many a talk is basically useless I agree so we're just gonna forget that for a bit but it theoretically is supposed to be like a wide column view it just only can render one thing and it doesn't render it well and anyway format custom is exactly what it sounds like it'll format any object in a custom way now by default format custom is pretty ugly the default custom formatter essentially two strings down as far as it can go so it'll basically be a complete output of the object in a way that is almost entirely unusable um I kind of wish Powershell would do something about that and I probably will eventually it's just picking battles and order of operations um it is fairly likely within a couple months I'll figure out uh what I want format custom to be by default for every object instead um but if you format custom a normal object it'll just spit out all that sub property information and not be particularly usable if you write a custom formatter then format custom will use that if you wrote a custom formatter and you put it above a table in file formatter then it's going to use the custom formatter by default and the user would never be the wiser so that's what's going on when we see like dollar Posh in that case there is one formatter defined and it's a custom formatter okay okay so just for the record if people want to follow along at home I just did get shot item on the directory I'm in on my computer which is like some temp directory a scripts directory and then I sent that to format custom and I got I'm not lying it is yeah I got a lot of hot garbage I mean here I will show off a show demo feature in a second question mark nope never mind we're gonna show the show demo feature needs some work um I was going to suspend the demo and and see I'll come back to it later yeah that's just opened his new terminal window and you should be able to do it from there yeah I know but it's easy I was just gonna say that there's a reason it's gonna give me this kind of warning here uh so I'm gonna say dur select my modules I can type gosh okay armat custom yeah that is some hot garbage man that's why I didn't know that command too well because there's nothing coming to that useful for me yeah which is it's a little bit annoying because like you know you could make the default a yaml formatter maybe that might look kind of nice or a Tomo formatter but like they're just like okay every object as deep as we can go and then there are other things that are already kind of like over exposed with extra information like oh here's a time span on a date time you didn't you didn't wanna stop when you realized it was a date time because this is not helpful I'm sorry we went off the whales with this but I am so glad we did that is so interesting it's all right you're just like I'm I'm gonna need to fix it and post as far as actually you know like turning this recording into something like you know a little bit more choppy but anyway uh another custom formatter that we include here is colorized XML so here's like a SVG hello world just doing invoke rest method it's giving me back an XML object it's being rendered as colorized XML now I will say this thing gets a little bit um sort of potential backfire territory when your XML is massive it takes a while um I'm going to try to figure out how to be a little bit smarter about that and not render massive XML in color but yeah colorized XML is this a fantastic formatting is this posh is this what you really really want well I will say this when I was kind of prepping a little bit for this module and learning a little bit about what it does I didn't know all the things can do but when I saw the XML formatting I'm like you know what that is pretty useful because XML on his own is just a lot of data with a lot of indenting and it's I think it's hard to be a readable format for a lot of data and so this really helps and again the same principles of you know using colorization to break up the visual space and helping you seek to what you want are easier like okay why doesn't this font look as big as I want well I can see font size right there right yeah yeah I agree you know and you know what the other thing that is like if you're not very good at XML it kind of makes it easier to understand yeah and on that note I also do regexes uh this is actually a formatter in the module a regular which is there to basically help make regex is less painful uh for a long time but I added it to Posh as well because you shouldn't need to know about the other one to use it also I gotta fix that typo capture [Laughter] look I'm just trying to enhance readability not spelling [Laughter] he's real man you know he makes mistakes like all of us indeed unfortunately these mistakes are checked in so I'm gonna have to have that you know like it's kind of all of our nightmares like somebody's gonna look over our commit log and see that we fixed typo oh God that again but yeah we all do uh another one that came over from Easy Out is get process heat map so just like your normal get process pretty much at least uh but it gives you a heat map color scheme around you know of the working sets and the like yay uh the last easy dumb ones are time spans and time zones and uh we actually just saw basically how time spans will look normally they'll print every property of a time span which is okay total seconds total minutes total hours yada yada it's a little bit more readable and one thing that uh can drive people batty is ISO formats for time spans although you still have to remember the name of the iso but hopefully this will help drill it in right so I can say new time span hours 24 minutes 30 seconds 15 format custom view ISO 8601 8601 that is the name of the iso format that we all have to use for date times and boom that wonderfully unreadable string that is used to represent these in standard form so can you still see all the objects that come from new time span that's a wonderful question and let's talk about the get out of the jail free card and Powershell for formatting pipe to select star if you pipe to select star then whatever type name decoration that'll go away and you'll just see all the properties on an object you really want to message someone you really want to mess with someone you do a type formatter for select object [Music] but please don't I'm actually thinking about whether that'd even be possible but I think a selected objects actually have like each of the type names attached to them so like you're selecting this type of source object but I'd have to go look um but yeah um I guess one of the bits of the subtext of the presentation here is that in the many years that I've been doing Powershell I've learned a lot about little nooks and crannies including ones that most people use every day like formatting but don't really kind of appreciate its spread and yeah I figured out how to do some cool things there so um time zones are also one of those by default here let's go over and see what your normal get time zone looks like it doesn't have a formatter so it displays it as a list because it has more than four properties and I'm getting a lot of duplication of information here right more to the point I'm not actually getting anything really helpful as far as like the time zone itself so here's how I display it add a virtual property to give you the local time in the time zone give you the ID local time and display name and in this case just in this case yes I do have a centered column and what we can actually do is turn one Powershell one-liner into a world clock so it's like okay I'm gonna be talking with somebody from say Japan actually this is a bad example because as I'm going to accidentally demonstrate that one doesn't have a standard time zone name but you know all right I'm talking to somebody on the East Coast I can go basically look at these time zones and get a day night color scheme essentially telling me where they're at so Pacific time here great Eastern Standard 850. that is pretty cool and that's just basically Powershell formatting and somehow that demo took 22 minutes I need to take a little bit of formatting of this out here so can you can you scroll back up for a second I want to see the the column name for the top for the right hand column so display name oh so it's actually two there it's the UTC and I was just wondering like the display name has the offset and the name which is why like if we go back to this this is just so redundant this has all the info if I wanted to be really easy this could just be my I could just display this one column and it would be enough [Music] what I was thinking was it would be like and so I this is kind of not formatting but I because I deal with this all the time I have two teams I deal with in different time zones across the world three teams actually and it's always like trying to figure out times is fun like if I could say uh I don't remember what your command was the get time zone and then maybe pump that out to like a where and say you know uh something like this zone that zone in that zone so we could say where object ID like Eastern yeah use match projects well fine fine only because you're here to brow beat me and I write modules I'm actually brow beating I'm actually brow beating Mike yes and actually I'm gonna go for display name here and be like what the hell uh uh okay so there goes my nice demo betcha works with like or it's not called display name right well let's pipe it to get member and double check it's display name yeah just double checking oh I had to do the list available it's the little things okay so there we go we went back to like I went back to like I love Monsters Just Just so you know I'll take you to match.com now I like like two I just uh I don't like the ambiguity between like and match I kind of wish I could use both in one yeah oh that's because you're a star and the the winner of the dad joke of the night goes as expected to Stephen Judd I think can I declare winners here not yet all right we got uh that time zone thing is so useful well I mean again I was trying to figure out what built-in commands and built-in formatting could be better and it's a perfect Point said in time to say it look I love GitHub for its collaboration if you want formatting file an issue if you have an idea of how to make the perfect formatting for yourself give me a PR you know water's warm come play on a side note has anybody ever met anyone from Easter Island I I cannot say that I have I can't either I don't know that it's ever come up I I don't like those guys anyway they all have big heads you're really just trying to top the prize from a second ago right oh anyway um okay we got one more demo that I'm gonna kind of show off right now because one of the other things that I tried to make easy here although I don't do any customization out of the box because basically too many people would start yelling at me um but we can customize the prompt too now for those that don't know prompt is a Powershell function that is called just before Powershell asks for input it outputs text that goes before a prompt I know it's a little bit weird for its name but prompt is the text before the prompt anyway we can modify the prompt and that can be incredibly useful this is why however Posh makes that easy so we can see information about the current rum our prompt by just saying Posh prompt and Hey look it's another nice formatter now I'm going to highlight one trick here that is actually kind of a happy accident um I'm gonna go back into my vs code for a second and I'm going to show you this directory with a little bit of fresher eyes so we have Posh input and Posh prompt are both in the subdirectory of Posh stackable the way this is working is almost like inheritance okay so these aren't defining most of the things of a stackable function they are these only have a readme that this readme becomes a property on the object so I can say something like Posh prompt readme and there we go and here's the cool part there's a command called show markdown which I always forget doesn't have the best of all format but I can use show markdown to basically highlight an auto link that readme isn't that a Nifty trick so all I'm doing here is saying show me the readme I'm going to give you a little bit of extra helper text about what you can do to prompt or you know work with Posh prompt okay so let's pipe it to get member to see what we can do yay that colorization so we have some Alias properties of after as a pen before is prepend undo is pop then we got the built-in methods thank you I think somebody might need to mute not anymore all right okay there we go um I was wondering if there was a question but anyway uh we got a few note properties the function name uh our readme here and the stack which is basically all the different changes that we're going to do to it making a pen clear pop free pen push replace stringify and get the current prompt okay so let's modify the prompt to replace the username with asterisks easy one here I'm doing this for basically on Linux and that for Windows and there we go now again this is if you want your prompt you can keep your prompt if you had Powerline loaded it's going to modify the power line prompt instead if you had any prompt modifications before you loaded Posh it will keep those in the stack and once you unload Posh it'll replace your prompt with whatever it was originally now we can provide a string or script block or Emoji number to replace parts of it so I'm going to basically say hey replace the PS in space with this emoji and there's one half of it look there and let's fix the other end cool and I'm going to add some content to the end of The Prompt and I'm actually going to be exposing some prompt widgets going forward but I'm not quite there yet but let's just go ahead and add that and I don't think that's quite distinctive enough because my cursor is going to be over here so let's undo that step or pop it and let's add a better end by enclosing it in Brackets and there we go So Posh provides those fundamental building blocks to modify your prompt may it make your shell more sleek and just if I want to say screw all this I can say Posh prompt I can type now you see why I wrote show demo though yeah so prompt modifications there too there's also profile modification as well so profiles run when Powershell part or starts and it makes it easy to explore and modify your profile so you got the same approach hey here's a readme there's where my current profile is here's how I can add stuff to it or remove stuff to it and I can type it in get member and see what I can do I can import or remove modules I can find matches within it I can create a new one I can get the file or files so get the specific file get any current files I actually think I only have the one I can basically say hey I always want to import Posh and it'll make the modification to do that and I can make modification to do something like this too and just to kind of prove the point dot profile we'll now say welcome to Powershell and we'll import posh and I think this is kind of the end of the Mr Toad's Wild Ride for a second I'm just gonna go double check it's pretty unique in its approach does not contain any commands it's built entirely by adding Powershell formatting extending Powershell types built primarily with easy out help out generates documentation I guess that's worth briefly going over uh if I go back over to this directory structure here and I pick the right monitor to click on um inside of the docs directory I'll get any of the different script methods or properties that have documentation as a nice markdown file so I can say you know this gets the height of the host for instance right and I try to make various things in Powershell a little bit easier to get at so you can get Posh dot run space or Posh dot process or Posh dot modules or jobs or host history Etc history is probably or not history errors probably a good one to kind of talk through very briefly let's see if I've gotten the errors of course I do cool um I have extended the error object so I can actually look at all the different Errors By line or by type of error and this is just basically taking the built-in variable dollar error which contains every time you ever screwed up in that Powershell session and helping me kind of explore what those are and so when that when you were in that fight so this is part of the Posh module that's part of Posh is a coolness kitchen sink uh so and when you're in this kitchen sink and you're doing that by type example you just showed there what's the reference to get to one of those lines uh the demo you just showed what you did everybody oh how about I just go get the history well what I mean is when when you go to buy type and you say okay right and so now how do you reference that by type how does it work or no no no so pull back up your error by type so you get that list okay right I I uh dollar error is a variable that is no I know that I know I'm decorating dollar error so I'm adding a script method or property called by type and when you say dollar error buy type it goes over what was in the collection and it gives you a new collection sorted by type oh so so you would so this is a list so then I would go back one more time uh dollar era by type dot system exception yep okay and that's the part I didn't understand how to reference those yeah time zone not found exception I can find all the times that I screwed that up you're not going to Fiji that's for sure no I am not again the uh the goal here is to do as much as one can to improve the Powershell user experience and with one hand tied behind your back by not having any commands in the module itself oh there's one other good one though that just I I love it because it's so tiny before you switch before you switch Edgar had a good question he wanted to know if these exception methods do they tab complete uh I believe they will um not as ideally as I'd like though let's see yeah could be better oh yeah um so one of the other things that it does is it gives you the ability to manipulate default parameters I'm typing the wrong variable so I can say Posh parameters and I can manipulate defaults and I actually set a couple of defaults here all right uh actually ignore that one uh this one this was a trick that I had had in a module called ice pack a long time ago uh and ice pack was for customizing the ISE uh it was a very nice and helpful module in the same sort of ways this is uh but I don't think I've opened up the ISE in a couple years I don't know how many people on this call have so I wanted to have that capability um but uh the last time I built it I had built this by overwriting the function out default and this time I got to make it even smarter and I basically just say whenever out default is run it has a you know you got your Global PS default parameter values here this this is as simple as you can make the trick in one liner and what that'll do is it'll give me a variable last output which is the last output of the command now I know that you guys have all run something and wished you to signed it to a variable right yeah well if you got Posh loaded dollar last output and what's especially nice about the way this particular trick runs is it just overwrites the last one every time it runs so you're not actually shooting up memory to try to keep a big history of outputs you're literally only ever having one in there at a time I also got a plus one on module names from you Mike and yeah modules are Brands I try to try to have half decent names for my modules I the names man I think they're good plays on on things I think I find that so interesting I go through the gallery and I see this is up and I'm like man someone they can write good code but they can't think of a name for that module [Laughter] on that note I am so surprised how is Powershell been around 16 17 years and nobody else has named it Posh is it a matter of like you know the pure Gall to to name your own module Posh or is it everybody added something else for some other clarifying reason I'm why was this name still available foreign I don't know but I love it it just needed you to come along and add some spice to our console using the Posh module yes all you have to do is tell it what you want what you really really want yes the dry jokes will last and last and last the really good and sad part about this though is that the only people that will get them are already like of the dad joke age laughs I don't know how to take that it's everywhere doesn't everyone know who's Posh Spice is um I unfortunately do yeah I think I think unfortunately like it's one of the the cruelest things about the module name and that particular joke is like if you were alive in the 90s I don't even need to add the tune there and just say the phrase and it's playing in your head you can without attribution use my subtitle for your your Posh Spice module here yeah I I I um Microsoft as a place of capricious Geeks and nervous lawyers and I might be a capricious geek but I've got enough nervous lawyer inside of me to try to be conscious of the boundaries of potential litigation so I'm good with the Illusions but I don't think I'm actually going to directly make a meme that references this and now if anybody else wants to do this then you know hey good for you there we go we got some memes James could you tell me what you want what you really really want to see next uh from this module or from you know that was it this evening I blew it up because that was supposed to be with Steven and I said Jay uh I already already said that joke and you weren't listening I know you did I just wanted I already said that joke at the beginning I have more what the heck we've got Joe conception we do and beyond that like pasha's been a nickname for Powershell for forever so you know there are many Avenues to make joking fun of the module name everybody can have that fun if as long as they keep it pretty good natured I'm happy I I don't know how to say it other than I'm this this module is to some degree a little clickbaity like it's it's not going to you know fundamentally change your Powershell world on a oh I have this command this lets me work with graph perfectly now or something level but it is going to give you a lot of sleekness and coolness at pretty low cost so you know so enjoy the quick bit I do have a question on it so let's um I did hear somebody else pop up with a question a second ago and I wanted to make sure that they had the chance sure but I want your question too yeah who I had a question about the the module as a whole um would you be open to like a module parameter that would disable all the formatters and then adding a command where I could add the ones I want like say for instance I've worked on a formatter for my file system a lot and I don't want that one necessarily in there kind of thing um I'm mixed on that particular request and here's the rationale why okay uh the first part of it is technical um right now easy out creates one format file and one types file basically I could make it create many formats and types files and load those up individually and that might not be a bad feature to add to easy out okay so I'm not opposed to the idea to have that capability it's just a little bit harder of a path and definitely more complex from an authorship perspective um the other sort of problem is essentially well like take the prompt customization versus the formatting if you have to opt into something less people are going to use it and I'd rather people opt interrupt out of the module overall then start to get into that game of you know turn this on turn that on now I do want to make various things more customizable like I want to make the icons more customizable and colorization more customizable throughout uh how exactly I get there and how how elegantly I make that kind of customization that you want those are open questions but it's not my main priority because like if if you're going to be the type of user that basically wants to go a la carte you're probably not exactly the ideal type of user for a module just designed to make things easy like if you wanted to get into the technical iterations of things the thing that I'm most concerned about actually is people using the Posh variable in their scripts and getting used to programming with Powershell with its help and then having that kind of screw you up later when you try to build something that doesn't have poshloaded so yeah it's they're good technical questions um it's just not something that I I am at least I try to be a judicious developer and part of that is knowing when you're biting off more than you want to chew at a moment and I know that that would be a larger bite than I wanted to chew especially then I wanted a tube prior to delivering a talk at a conference we have a question from Ed uh who's been waiting very patiently to ask this question hey Ed do you want to ask a question sure if you don't mind yeah absolutely so James I I think you almost sort of touched on this and then blew by it way early in the process sure but um how does the colorization work if your screen's not a black background um either in vs code or terminal or just a regular window well let me uh get terminal loaded back up again and uh show a bit of another module off for a second yeah so in cool module territory we've got a module called terminal velocity which is a module I built to customize terminal okay and hopefully this will be my friend here uh but we're going to get or WT color scheme pipe to get random that looks like that formatter could use a little bit of work there we go so now we're on one with a bright background good to use a little bit work but I'm going to blame the color scheme more than I'm going to blame it if that makes sense because all I'm doing is basically saying pick these points on the color scheme right and if they don't have good complementary colors it might look like okay so you're taking advantage of a pre-built color scheme that I wasn't aware of cool okay yeah um in BS code they'd be it'd be doing the same thing uh in case you're not aware there's the I term two color scheme repository which just has I think a few hundred different color schemes that you can use okay and yeah uh I could probably get into the slight hell of figuring out whether you're on a light or a dark color scheme and doing something custom in that case but I'm not trying to rush right there either so your mileage may vary depending on your current color scheme but you know that's true of all color schemes yeah so so I guess it would be a fair assessment to say that if regardless of the background color right now you sort of have just one sort of set of colors for the colorized text in formatters right uh uh yes they are right now um more hard-coded that will likely change um a lot more likely to have people want to customize the colors of particular objects than a la carte formatting for an object but if you believe that I'm wrong you know file issues make your case no I wanna I wanna wrap up here because I think you've basically come to the meat of what you wanted to cover but I I did want to say like when you did your coloring how many colors is in use is it like like for example is it just eight um well other other Powershell things that I can show sort of kinda um also slight misnomers so we're gonna go to 4bitcss.com which is a creation on top of that iterm color scheme stuff that I mentioned earlier uh the reason it's called 4-bit CSS is it gives you 16 colors technically it actually gives 18 colors because you can have a different foreground and you know background color as well well yeah at this point you lose your catch points if you you get really technical but these uh these you know give you a free preview of what all these different color schemes would be and how they would render okay and I'll give you a way that you have the same color scheme on say a website actually I should go to that particular one for a second because it's cool one but uh one of my easy to remember light favorites is Batman it's not the best for contrast uh consolas is the one that I tend to use but another one that's quite nice is Jackie Brown I just read that it has a bright black color yes that's hilarious I know um this might be a really really obscure like cultural deep cut but I don't know if anybody's seen the movie Shallow Grave um it's like very early uh you and McGregor like early 90s uh and it involves them uh interviewing roommates at the beginning of it and they have a goth candidate and Ian McGregor asks her what do you wake up in the morning do you decide on the shade of black to wear oh and that that was called shallow grave shallow grave yeah I dig it it's good movie uh but yeah um definitely uh older than certain audience members which yeah one that's one of those phrases that makes me feel extra old anyway um so let's minimize out that go back to the terminal here for a second well thanks for the color information I appreciate it and uh just so you know I do remember using ice pack and I was using the ISE this afternoon at work so well um I wish I could give you more hope for a future version of ice pack but uh that is not the direction I'm going to go I'm glad that it's at least somewhat positively remembered um it's it was a very useful module for its time oh yes that definitely definitely loved it it was great I still want uh close all files and vs code though I really do I'm gonna make it happen one day but anyway um additional questions comments thoughts now this is really good James uh you obviously have spent time I I really do appreciate how when you were colorizing get number you thought about things that most people won't think about which is where does your eye track and how quickly can you disseminate information and so that that really shows to your attention to detail and your knowledge of the subject so this was a great presentation like you especially considering I just want to be really clear here this is not technically a presentation this is an awful cuff here's a few demos here's a fresh off the press module for you guys and I didn't really want to write a big PowerPoint after a bunch of talks in the summer so uh if anybody wants me to come by and actually talk about this at a summit-like thing I'm going to be happy to and I'm pretty sure that uh this would be worth talking about something like that okay all right so Stephen when when we when we began this did you did you think we would be learning about helles ratings and who used the ISC today we ended up in a very different place than I thought we would be but it's been a very enjoyable ride well I I Endeavor to give enjoyable rides uh on that note the light Shameless plug again you can do the sponsorship on GitHub and book your time to get your own uh customized Mr Toad's Wild Ride through whatever part of Powershell you'd like um ask any question that you'd like you know for a couple of hours if you want and let me know what your Powershell problems are and we'll try to solve them together all right so yeah um uh should I stop sharing now or we yeah good you guys go ahead the more you want to see well let's let's wrap up our present our recording and we could always talk more for the people who stuck around and so if you are watching at home you made it this far thank you so much for sticking with us we always encourage people to come and join us in person the research trial and Powershell User Group can be found on Meetup or at rtpsug.com the bonus is you get to come and if you come you get to ask the questions and get to find out exactly what you're looking for so if you'd like to come and join us please check us out online if you're looking for more videos to watch we have about 140 videos of previous meetings and uh I'm sure you're gonna find something Powershell related that is gonna that you'll find enjoyable Stephen it's been quite the ride yeah man we we kind of uh rode the rainbow as they might say on this one yeah but I have to say James uh is uh quite the Enigma when it comes to doing this stuff he's got a very brilliant mind it's part of letting James present is watching that flower unfold and grow and just see how his mind works it's the same sort of with Justin Grody but I digress here all right thank you and again I'll remind everybody you don't have to know how the sausage is made you can just enjoy the flavor you know so enjoy the flavor Taste the rainbow like share subscribe Etc see you all next whatever time um let me know what other topics you always want to talk about chances are I got a Powershell module for it um and I might have made a huge mistake by offering that [Laughter] you have to see that that you're doing yeah that's we'll put that up for next time all right Stephen any pouting any potting words go ahead I'm just I'm sorry James I don't mean to step on you go ahead no no I I was just saying that would be visually fun we just all started talking at the same time no after you please yes no Mike I don't have any more terrible jokes uh I I've managed to get quite a few in and whoever is uh lucky enough to watch the recording will get to enjoy them as well so it's been fun hanging out and thank you very much James really appreciate your time you're welcome thank you James and thanks to everyone who stuck around with us tonight we're gonna wrap it up here uh for those that are in person we'll continue the conversation but we'll see you next time thanks for joining us
Info
Channel: Research Triangle PowerShell Users Group
Views: 858
Rating: undefined out of 5
Keywords:
Id: iZgcTD_uN-w
Channel Id: undefined
Length: 98min 29sec (5909 seconds)
Published: Fri Aug 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.