Automate Your PowerShell Scripts from a Pipeline - April Edwards - PSConfEU 2023

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign [Music] so I'm April Edwards uh I used to be at Microsoft as of three and a half months ago then I joined GitHub we are very separate companies yes Microsoft owns us but we operate independently but I moved to GitHub to talk about the cloud and bring that Microsoft and GitHub message together I've been in tech for over 24 years I start off in the operational space and I moved into development so then devops was a really natural fit for me I moved into engineering at Microsoft I was deploying code working with customers and solving real life problems I've been working with Powershell since Powershell 2.0 I was sitting in a course many many years ago in the United States in Colorado and I remember just learning Hands-On Powershell and all the ways you can use it um you know going from SharePoint server Farms exchange environments to kind of everything in my infrastructure that I was working on and I owned a very large infrastructure at the time and so I took that and I went into the engineering side of Microsoft and I worked with some really cool Engineers I mean really smart people but they were super devs they're like everything things in bash everything's done this way and I'm like let's automate with Powershell and they thought it was absolutely crazy um I actually got into some really heated arguments with my manager at the time and I was still gainfully employed after that um but he always saw Powershell as the windows tool and he called me the windows person on our team and I sat there and I was like hmm it's not about being a Windows or a Linux person anymore it's about being cross-platform so now that I'm working at GitHub I'm supposed to be Cloud agnostic but I'll be honest I'm an Azure fan I do work at AWS a little bit I don't really touch gcp but I work in the cloud and the reality is most our customers are hybrid and that's why that's really important for me so how do we automate things why do we automate things um I do have a bunch of slides we're not going to go through them this is going to be mostly demo heavy we're going to do interactive kind of session because that's how I like to run things because I want you guys to learn I want you all to ask the questions that you want to ask is that cool all right so the deck will be available for you afterwards it has some links of where you can read GitHub has fantastic documentation on the things we're going to speak about so all right oh we need to thank our sponsors right that's very important uh chocolatey absolutely I'm a big chocolatey fan I think I'm a chocolatey sticker on the front of my laptop yes there it is um big chocolatey fan because they automate things right and Patch my PC because they have the coolest t-shirts right um I love this lie because if we think of our day-to-day job we have so many tools that we're working with now this is the devops life cycle so you know we look at how different tools we have to do different things um and the reality of it is we have so many times so many tools but not enough time to use them and it does complicate our life a little bit so we're going to talk about a single integrated platform I'm only going to talk about GitHub actions now how many of you are using GitHub today how many of you have never touched it all right cool so GitHub was known as a source control repository so I spent a lot of my time teaching people why Source control is important because someone's taken my script and they've changed it or I go on holiday and something breaks because I have a manual task um I've been in so many positions where I've come back from a holiday and someone's not been there on that Tuesday morning or that Monday morning um I actually had a very real life scenario where I went away for 10 days and a gentleman that I worked with passed away over bank holiday weekend I came in the next morning and my manager was crying a big Burly scary military man had been crying he goes we lost everything because we had so many manual processes put in place if I can't go on leave for 10 days and turn off everything then something's wrong so we're going to talk about how we can use the platform to help us do more um I like showing this slide we use this term in the devops world called shifting left forget the whole like you know all the terminology do things early and often how many of you have pushed the big red button and destroyed an entire infrastructure before I have not rebooted I'm thinking I haven't rebooted a whole VMware production system in a very long time for that very reason why because I've automated things I've ordered my way into a job and out of losing my job but I re though the reason why I like the slide and I tend to put this in all my talks no matter what the topic is because what we're seeing today you're going to see some AI because ai's kind of everywhere right um but we're bringing these tools closer to the developer experience now we use this word developer GitHub and I'm going to ruffle Pierre's feathers over here every one of us here is a developer if you tell a machine to do something for you you're a developer yes Canada um now I when I moved from hops to development I was like hold on I don't write big scary apps and platforms and things and they're scary I'm not you know I'm not a coder but I am a developer so I'm not a programmer but I'm absolutely a developer I want all of us to embrace that developer term and leave here feeling warm and fuzzy about it because you're going to probably hear it a lot from GitHub we use this term developer so the tools we're going to see are bringing that experience closer to the developer because we can do things early and often we prevent the failure in production because we push the big red button we've cost our customers lots and lots of money I'm gonna use my favorite example Uber Uber had a breach in 2017 because they put a password in their Powershell file in their production environment thanks guys has anyone heard what Uber has done more recently the same thing because they didn't learn from their first lesson so I like showing this slide because yeah Uber had a password breach in their Powershell script don't put passwords anywhere in your Powershell scripts right sounds simple but we're human we make mistakes because 96 of cloud errors are due to us the humans we're the issue in the cloud so how do we automate our way out of that let's talk about actions oh source control um no one's used Source control here we go get a repos does everyone know what a repository is anyone not know it's okay to raise your hand roll friends it's a place to put your code right actions how many of you have used a continuous integration continuous tool in your workflow in what your day-to-day job a few of you how many of you have not used a CI CD tool perfect you're my favorite people so continuous integration continuous delivery means we automate something from beginning to end from inception to delivery GitHub actions were designed to be what we call a continuous integration continuous delivery tool but it does more than that so for those of you that have used a CI CD tool cool this is a CI CD tool for those of you that have never used a GitHub action you can literally automate anything example um actually I'll explain what the actions are and I'll give some examples so you have pre-baked actions we're going to look at a few we're also going to build some actions out today we're going to walk through it step by step we're going to automate some really simple stuff the reason why actions are really cool is they work on any operating system and you can literally deploy them anywhere if you're on-prem or in any Cloud any language you can develop GitHub actions now these are pre-baked so we're literally going to take some existing actions and deploy some stuff now um you can also write your own so I work with a lot of customers that have very specific needs for their actions so they write their own and this goes into a GitHub workflow so the actions the individual component and then goes into the workflow so and if you do any kind of application development um if you do any kind of Linux windows or even Mac development we literally support all that in the cloud so we're going to talk about Cloud hosted Runners you can host these internally so if you have a data center you can run GitHub Enterprise and do all this on your own environments as well but we're gonna do all this in the cloud because the cloud never breaks it's okay it broke for me at a demo live in front of a lot of people once recently so I have a bunch of slides here that break down the components of actions and that's cool has some reference for you I'm just going to go ahead and show you actions if my laptop works and my laptop is actually Frozen that's cool so the good news is I do work in the cloud who has a spare laptop I could borrow Jess can I borrow your laptop so the funny thing is this is not the first time this has happened to me it might come up in a second just bring your laptop up so the cool thing is because I work in the cloud I can run my demo from anywhere uh github.com and I'll log in can you just yeah do a private window so second worst thing that could happen on stage is your demo breaks but because I work in devops my life is failing and re-automating and fixing it I always have a backup for my backup except when my laptop doesn't want to work can anyone play any hold music for me yeah that'd be cool uh I love a good question actually my laptop might be back hold on yes question please yes so the question yes sorry go ahead so okay that's a great question so I did kind of skip the source control thank you Jess it's up um so the source control thing uh yes thank you the question was if I'm using SharePoint for Source control because I can do versioning in it why should I not move why should I move to something like GitHub absolutely um so before the days of SharePoint we would have file servers and we'd type our files out and we go version 0.1 version 0.2 three four to two thousand right down the list um or do we work on something locally and not save it to that file share appear um sorry if you're not used to work Taylor and he did this once he saved his file locally instead of SharePoint and went on vacation for three weeks I love you but anyways yes so sharepoint's great but how do we control that mechanism of of updating and how do we organize that so yes you can Version Control in GitHub great but it does more than that so the other thing we do is we conversion it and we can put controls around it so we can do things and these could be Dev words so forgive me we can do something called a pull request meaning I can't just change a file I have to create a pull request and my colleagues have to review it and once they review it it then merges into that Source control system and then it's been approved and why is a pull request important now these are lots of Dev words and we're kind of going off track a little bit but I think it's very valid um so Pierre my real life example went on holiday for three weeks to Mexico without his phone drinking lots of urban or tequila rum or all of it um and I didn't want to bother Ramona's vacation but I had to because I was like dude we have a deadline where's the file oh I saved it oh I didn't okay so in that case with Pierre and I he was working on the file independently and I didn't have any visibility into it okay uh he saved on his machine now in a source control system or in a version control system and like GitHub I can access that file I can also bring in my colleague to work on it together right so what if we could work on a document together which we can do with word right or Google Docs we can pair up and do that um but then we make that change and then we submit it we have our peers review it so we change our process a little bit and how we work but that means when I review it with my peer my peer which would be Pierre at this point um we can see it together but then maybe I want a third or fourth person to review it that isn't Pierre or not because we've had our eyes on it and you know when we're looking at something we're like I don't see anything wrong with this nothing's wrong with this everything's fine you need someone else to come in so it brings out a peer review system what it also means is when I submit that file I can run some checks so remember we saw that graph where we can start doing things closer to that development stage I can put in linting tools does anyone know or so lending tool will be something that will look through my my Powershell code and go is it right is it correct we can check for spelling and grammar we can check it and then we can run tests on our Powershell code because we need to test it to know if it works we can put in other controls the other thing we can do with GitHub is we can put in a security scan that scans that code before that goes into that repository and it will find hidden passwords and not be Uber so it offers more than just Source control and while sharepoint's really great there's a whole set of features so we're not going into all the features of GitHub today but I probably should and there's actually I might redo maybe I'll redo my session tomorrow and we'll just talk about all the features of GitHub what do you guys what do you all think so I'm gonna talk about Dev containers tomorrow morning at 11. I could redo it we could do more in depth on GitHub stuff yes no okay we'll figure it out right I'm flexible um does that make sense okay so actions are one component so we have our stuff stored in a place so I have this GitHub repository I'm gonna go ahead and make this bigger for everyone because I think is that is that happy does everyone is everyone happy with that cool so like and SharePoint I have a place where I'm storing everything so this is gonna be our demo this is public so you all can look at it you can take it you can share it you can use it and you can break it for yourselves please don't break it for me while I'm doing it live I've already had one failure today so I have everything in this repository um and I have some scripts now the first thing I want to talk about is remember how my laptop just died and I needed to do my demo I can do all this from the cloud because it's hosted on a web browser which makes my life really easy but I want to make some changes and I want to automate some scripts so I'm holding some scripts here we're going to do some things around that um but what if my laptop actually did break which it did and it's not the first time um I need to get access to my stuff right so there's a couple ways we can do that so first and foremost when we're working in a GitHub repository and I need to edit my files so I've got a bunch of files in here I'll show you my script files I've got a really simple Powershell script here I'm going to go ahead and I'm going to query Azure and tell me which of my resources are not tagged so if any of you do not work on Azure I use resource tagging to organize all my resources in the cloud because the cloud can be a messy place you can do a lot of things and it can get messy this is a very very simple script now I wrote this script might not be perfect but this script gets executed but I need a way to execute it so there's a couple ways we can do this I can go into azure log into Azure and run my script how many of you log into a server and run a script every day because it's easy oh good okay okay you guys are never going on holiday um so yeah I could do that I could take the script I've saved it my source control but that's whatever um but I want to automate it so the really cool thing about actions is you can literally automate anything and the reason why is because it isn't just deploying something into the cloud we can take a script we could take a document and we can find a way to automate it we can add triggers to it how many of you have used like an Azure function or Azure automation before a few of you a lot of you good so how many of you use a scheduled task yes right we live off schedule tasks I'm going to create a scheduled task to run the script every night at midnight so I can go on holiday and that Pierre can go on holiday I don't call them in Mexico again you ready Pierre all right now I want to talk about a couple of the features of how I do this now if you're working in GitHub how do we how do we edit our stuff right well I have to pull down this code to my machine we talked about that developer experience how many of you work with contractors so when they pull that Powershell script down it's sitting on their machine you can't tell a contractor delete our stuff I mean you can tell them are they do you have any way of controlling that you don't right the other issue is your laptop dies on stage how do you run a demo or um your laptop isn't working or you are on holiday and you need to make a critical change to something how do you make these changes so when you're working from a GitHub repository you can take everything that's in that repository your documentation your code and we can clone this to our machine using visual studio code has anyone here not used Visual Studio code to edit their Powershell Scripts I see I see a little hand it's okay we're all friends look I remember when I had to switch from the ISE to visual studio code and I was like oh I don't like it the experience is so much better now give it a shot and I'm going to show you why in a minute okay so we have to clone this code down and we need to work on it cool now security starts when your teams your engineers clone their code on their machine how are you then locking down the machine are you prohibiting your people from working but that takes a while so I want to edit this Powershell script what do I need in Visual Studio code to get started yes Powershell extension so this gentleman here is going to go get vs code and get his Powershell extension how long do you think it takes to get a Powershell extension and get set up on vs code if you've never used vs code hour we've never used vs code yeah you got to get vs code installed the showman here could be like a real life use case he's going to tell us tomorrow how long it's going to get vs code installed and his Powershell extension what do you think all right so that takes time but then if you start a new project let's say this is a net new project and I'm bringing my colleague Pierre sorry Pierre I'm gonna pick on you all day is what you get for coming to my session um I'm gonna pick up here and Pierre wants to get started on this project and edit my script he goes yeah that script I can do that better or it needs a thing it needs to you know Beef It Up okay cool it's going to take him time to pull that code down do a thing and modify it we're going to introduce a code space what is a code space I'm going to let this spin up this is an exact replica of my visual studio code environment in the cloud where nothing breaks um famous last words right this is taking my repository of code so why is this better than SharePoint because I can see my repository in my visual studio code experience in my browser window so if my machine overheats which it does on a very regular basis and I'm very happy it's not doing that right now or it doesn't connect to the projector I would have logged into my GitHub repository spun up this code space on Jess's machine I would still be able to do my demo end to end and it wouldn't matter now you're thinking well you're on Jess's machine correct her machine security doesn't prevent me from working this is a containerized environment running in azure as the owner repository of an organization you set the limits of how your teams work the other cool thing about a code space is it spins up a secure environment for you to write code see I told you everything would break today um and it spins up a secure environment for your for your teams to write code and to do things um and you can set compute requirements so this compute requirement in this code space I think is uh four gigs of RAM two CPU and if I need to run tests or I start consuming a lot more of the component it then scales it up for me so I'm only paying for what I use pretty much the model of how we work in the cloud but this is spitting up our entire GitHub repository the other cool thing about it it already has Powershell installed for me so someone going net new into a project I don't need to do anything to get started so we're going to Deep dive into into how this works tomorrow in my Dev container session um but we're going to go ahead and let this zoom in while this loads so I can go ahead and see my really pretty script sides to load so this is our great script that we have let me go ahead and take that out for a minute the same one I just showed you a minute ago I can also spin this up in my visual studio code experience locally or I can share it with a friend and we can work on this together so I have this script I want to execute it how do we do that well I have a folder here on the left hand side that says GitHub and I know we're supposed to work in um in white background is the black background bothering anyone because I can change it to White it bothers you um where is the color parents thank you da there we go Barbara's happy um I actually work in Black because I see things better as I literally can't see the wood through the trees on that um but Teamwork Makes the Dream work all right so we have this script up here as we had before and then I have this folder that says GitHub workflows this is our these are our actions workflow so I'm going to go ahead and I've created a workflow for us and we're going to walk through how it works and we're going to make some edits so in this workflow I want to tell it to go to Azure and query my Azure um subscription for things without tags I can easily do this in on-prem environment I just change how it does that so every workflow needs a name it's going to make this bigger you can never have it large enough right so here I gave this the name Azure tag check really really simple name it makes easy for me if any of you have not really used vs code very much the hashtag and then the comment is telling you what it does I love comments in my code because I don't remember what I ate for breakfast yesterday I don't remember why I did something as well so it also means that if Pierre picks up my project or just picks up my project or Jeff Hicks picks up my project they knew what I was thinking on the day potentially so we have a trigger every workflow has a trigger and you can customize these triggers so this one where on line item five it says on that's our trigger line item six is called workflow underscore dispatch this is a manual trigger that means I can go into my GitHub portal hit a button and just run the workflow because maybe I do want to manually run something below that I want to run it on a schedule so this will run in two ways on a schedule and on the Quran job it says it runs every day at midnight I can change that I can say run it at 5am run it at 3am run it four times a day however many times I need to run it for my organization and then in GitHub we have a thing called jobs and jobs are a stage if you will so when you talk about continuous integration continuous deployment you might do something test it go into Dev stage a QA stage a pre-prod and production jobs are great for environments jobs are also good if you need to do separate tasks so in this task we're going to use one job that is just going to run this script we go down to line item 13. and we use what's called a runner now this is a cloud hosted Runner so we're using compute in the cloud to run this and it's micro seconds the billing charges are minuscule so instead of running a virtual machine and running a scheduled task I'm doing this in the cloud and I'm only paying for what I use now someone's gonna ask me about money and billing and charges I don't do money I'm an advocate we have account teams that do money but with um GitHub Enterprise that you do the on-prem server version that you can host in your data center there's it's a licensing charge the cloud hosted is pretty miniscule there are different tiers of it but for the most part they're really you're not going to get charged for what we're doing okay so this is my own repository I paid nothing to run this I also will be really honest I don't have an infrastructure overhead I hate managing and monitoring all my server environments just to run tasks because if that goes down then my tasks don't run now also if my GitHub actions goes It goes down as a service that's a problem so the first thing we do is run some steps and in each job we're gonna have steps we're going to tell this what to do and in what order so the first step we're going to check out our code we always have to check out our code and then we're going to log into azure and if you can see on line 22 I don't have my secrets exposed because I'm a good developer so I'll tell you where that goes in a moment and then line 24 after it logs into azure I tell it to execute my script using the Powershell as a shell and I'm calling my script here get Azure resource tags underscore AE and Powershell script really simple task now I was going to run this for you as a former Microsoft employee I lost access to azure as a current GitHub employee I got it back but I couldn't get this up and running today so we're not going to deploy anything into Azure today we're just going to pretend we did it right and make everything worked um so my Azure access is a bit of issue but anytime I execute the script it's going to go ahead and log into Azure for me and it's going to execute it it's going to do it for me every day at midnight so what does that look like in the real life so if I go back to my repository and I'll put this into light mode for Barbara uh appearanced anything I can do to help dear okay well so if I go into the action tab here I can see this so we have the Azure Tech tag check it has failed okay because it's not going to deploy to Azure but we see this little button here where I can run my workflow I hit run workflow the big green button so the big red button it'll run that workflow and it will go into Azure and then pull that report for me really simple right I've taken something off my hands I've automated so I did run this earlier and it failed because um the Azure subscription was an issue so all that yaml code that we used spits out into a little visual thing here and we can see that it was running and it failed but that's the job so up the top here we have our jobs on the top left and the get last used date which is what I titled in my action so remember in those actions we had in that excuse me in the job we had those steps these are the steps so every job has a step or more so I'm setting up the job that was checking out our code we can see that ran through and we have full output of what happened so when I work with organizations that are like yeah we can't do the devops thing we can't do the automation we can't do the cloud thing because we need to audit everything we do this audits every single step of your automation piece and you can output all these records and it sits in your Source control instead of in SharePoint so you see everything that's happened you have full traceability now traceability is scary because sometimes when we do traceability we do the blame game well Pierre went on holiday he didn't do that we need to think about having blameless post-mortems and saying yeah I screwed up that's okay we learn and we move on that's the devops mindset um I just bring up the pier story because it's pertinent to so many of my talks and I love picking up here so we log into Azure and then it's supposed to execute that script and it completes the job so in an Ideal World I'd have Azure running we'd execute our script we had an output and everyone's happy so what I'd like to do is and I just want to show you real quickly how did I create this there's a GitHub actions Marketplace and if I type in Powershell these are the pre-baked actions that I was talking about you can go click on an action select it and Pull It in and also when we author an action we can do stuff with it as well and we can see it from there so we can do things like Powershell hello world we click on this and it all pulled up here we go and it gives us the uses for it we can use the latest version and pull that into our code and this is very simple it's just a little action that someone's published maybe you want to publish a Powershell script to the Powershell Gallery because that's pretty useful right this gives us the actions workflow here on the left hand side we can go ahead and change that name publish to something that's more pertinent for us copy and paste that in but we can see this publishes our code checks out our code takes your script and deploys it out so when I'm writing an action it's very very important to not put passwords anywhere in your code so one of the things that I do is I go into my settings and I hit the secrets and variables things and in secrets and variables I have one here that says Azure underscore credentials so to log into Azure I don't expose my secrets so if you need to put a password somewhere we have all sorts of places we can put passwords Azure key vault I don't know aws's native key volte solution we have powershell's solution for storing Keys which is viable or you can use GitHub and we put it here in the repository Secrets whatever you do please don't expose your secrets right really simple so we've created a really simple actions workflow so you the gentleman asked why use actions or you why use GitHub over another another um I'm actually going to go into here let's go back to our code I just want to show you a few more this is actually a workflow in more of the CI CD style so we're automating a task because we're in a Powershell conference we have lots of tasks we want to do lots of things I just want to show this one real quickly where I'm actually deploying something again we're not going to deploy anything today that's why we're just going to show it but you can see here that I have six jobs the green tick mark means that it's completed the red means it did not now the reason why this deployment did not deploy because at the very bottom I run a scan on my application in my code and I have a security breach so I've stopped my deployment so in the actions workflow I can put in different things to stop bad code from going into production because we don't want to push the big red button so when I look at the workflow here in the bottom go ahead and make this a little bit bigger I can see where I am deploying things in each stage and I actually have gates at the end of each stage that I have to either manually approve or um do it through an automated session so let's do another thing with our Powershell code I want to run some tests so we're going to make some changes to a live file so we're going to test some Powershell code I find testing is really valid another reason to not just use a SharePoint site we want to deploy something we're going to go ahead and run some tests now testing to me as an operational person was foreign completely foreign how many of you write tests for your code good amount I mean back in my day um many years ago I wasn't running tests so I've actually pulled this code in from another uh workflow they you can access and anytime I create a pull request um because I'm not gonna just push my code up to my repository without any controls I have some controls in place so I have different triggers and I'm running a job where I want to go ahead and run a pester test okay and with my pester test I I created it as a job I create my pester test checks out my code and we notice here I've written jobs again and there's a red squiggly line does anyone know what the red squiggly line means there's a problem so if I hover over it I can view the problem it's already defined okay so let's go ahead and take this out and the red squiggly line goes away I'm gonna go into my code and everything's happy all right so I can run some tests now the other thing I'm going to do is go back to our original thing now before we deploy this into azure maybe I want to insert some tests let's see if it picks it up give it a moment it's going to work no okay so I've co-pilot turned on so I was going to inject some tests in there and see what happens but um instead we have the one I've already pre-baked for this reason okay so I can run some tests in my workflow so these triggers I have at the top means anytime I commit that change to my source control repository in GitHub I can then run tests on my code from beginning to end so it doesn't go straight into the repository without controls in place so it's not about controlling what we can and can't do but it's preventing those things from going into production it's bringing it closer to what you're doing so if I go ahead and make a code change this will run and if it fails my code changes will not go up the other really cool thing we have is something called GitHub push protection this it doesn't run as an action runs on a different mechanism but we also have a couple other different security tools that you can enable immediately in your repository and it will run an action and search for passwords every time you push something up so if I were to put a password into my um and to buy the script push it up it would scan it find it and tell me and then we wouldn't have it in our code so I know we're conscious of time because we've only had 45 minutes to talk about all the amazing things of actions um I'm gonna open up for questions yes will this work the same way in Azure devops so uh no so uh yeah so I used to work a lot with Azure devops so that's a great question there's integration between GitHub and Azure devops so if you're currently using Azure devops and that's the direction of your organization so you can't use an action but you can use a Azure devops workflow okay the what you can't do is go from a Azure devops code repository into GitHub because there's an identity active directory limitation and data residency limitation because they're stored very differently so that is a problem with an actions workflow we can literally automate anything whereas Azure devops it is CI CD so we cannot use these same triggers so you do have to use GitHub for it so you need to get your code into GitHub and then use the workflow mechanism to execute yes Jeff how to create a yaml file like um like day one yaml I am happy to share this around thank you for pulling that because I did have that saved before everything kind of crashed workflow Syntax for GitHub actions it does use yaml so if any of you have used Azure devops or another tool we also used to have a visualizer for those things the visualizer is in use or classic Mode as we call it but yaml is the new way forward so for those who have been in the industry for a while everything was kind of like not GUI based then it went to GUI based and now we're going back to writing everything as code and the advantage to using yaml is everything becomes code so in that actions workflow the other one I showed you with all the jobs I can hook an Azure policy does my environment comply to Azure policy any other security things I need and I can run those checks that's why all those red marks online because it didn't comply so I can run those compliance checks before they go and I have full record of everything so that's a really good question and yaml we call it yet another markup language there's all sorts of acronyms for it it is another learning experience so if you like cursing a lot and pulling your hair out and losing your hair yaml is a fun new language to learn um but sorry yes you've been shutting your laptop because yeah so I actually had a yaml issue earlier but when I'm writing these things oops sorry when I was writing these yaml files previously uh we went to edit that one we saw that I had a name mismatch using your editor matters get the Powershell extension put in there run your editor and you can find that I've worked with you know I mean me trying to change the color today was interesting but that's a setting issue um whenever I work with yaml I always have the add-ins there so I can find out what I'm doing wrong because if you've not used vs code before and you've used like notepad plus plus or ISE is great for telling you which is wrong spaces and tabs matter in yaml so it's a whole new format but yes there's great documentation on it if any of you start looking through the documentation and find that there's holes in the documentation reach out to me on LinkedIn and or Twitter and let me know because I'm going to help go back to those teams and write the docs better the other thing that's coming down is a lot more documentation GitHub for the it pro because we use the word developer and we expect all these people to use code but we don't talk about what people are really doing running infrastructures that actually run that code right so there's gonna be a lot more coming in that space and that's why I get brought into GitHub is to help achieve that so if there's any other thoughts you guys have about documentation products send them my way yes sir do code space exist on gitlab no so they run from GitHub because they're hosted in Azure gitlab has another tool and I've used it and I apologize I forget the name of it they have their own tool that is similar but if you use Visual Studio code we find that code spaces is pretty synchronous on that but yes you do have to have a GitHub account to use it so gitlab does not have the same thing but they have something else yes Leo so the question was GitHub actions can be written by anyone how do I convince my security officer they are safe I get this question a lot so if I go to the gallery here I'm just going to go ahead and look at the sorry it's on the gallery it's a Marketplace we have a Azure Powershell action here in the middle of the screen with a blue tick mark the blue tick mark means it's verified it means we've verified who's written it how it's done I work with a lot of customers that write their own custom actions because it doesn't do what they need now the security side of it I work with a lot of FIS customers Healthcare customers they write their own actions because the actions are open source now we can do a whole discussion on open source the great thing about open source is it's an enabler because we share things but you have to trust the provider that it's up to date uh and there aren't security holes so that is another use case for customers to write their own is if they have a very specific need or very specific security requirement but we have a lot of getting started templates there's also a template Gallery um let me see if I have that up for us I will get the link and send it out but there is a GitHub actions gallery that um has a ton of actions to get started as well not just Powershell stuffers and well thank you Leo for the good question yes sir yes the question is about running a task on-prem absolutely how how do we run a GitHub action workflow on-prem a couple different ways I'm going to talk about GitHub Enterprise server first so you've used Azure devops Azure devops Azure devops server every product that Microsoft puts out has some kind of server specific uh entity you can install and manage locally so you can run it locally I have a lot of customers that run data center environments like private data centers or public data centers not Microsoft but in the UK work a lot of data center providers they need their own environment or they work in the FIS industry you can get you can acquire licensing for GitHub Enterprise server and you have actions there the downside to that is maintaining and upgrading and updating that if that makes sense same as you do with any on-prem environment you got to keep it up to date but yes and a lot of customers use that where they have networking limitations so um you just set your target as the on-prem environment you can use private IP addressing Etc saying that when I did code spaces that's a cloud-based product we have I I don't know the date it's coming out uh soon it's on a public roadmap so that code spaces can to a private v-net for private peers so you can have the code space up and connect to a private environment internally for that secure connection so if you so yes so then if you're in the cloud then you can um there's all sorts of things you can do with v-neting and networking to Target your on-prem environment very similar to how Azure devops does it with the token if you're familiar with that use a secure token handshake and then you direct it to that environment anyone else we got two minutes and 40 seconds so the question was about is there any plan to integrate Arc Enterprise Arc enabled servers into actions I assume with r i don't know that exact answer but because we can do to any environment I know customers are doing it I don't know which capacity so if you want to give me a shout offline and I can probably find some use cases for you if that helps any other questions all right so with two minutes of spare and more coffee time for you all um automate things um stop being the human error right we don't want to be part of that 96 um but I'm happy to go a little bit more Deep dive into actions later I might do a little 10 minute thing on the stage up there we'll see and go a little Deep dive but please feel free to pay me questions and if all any of you come to my Dev container session tomorrow and we want to modify it and go a little deeper dive on some of the other features on GitHub as a platform happy to do that but I will be covering off code spaces and Dev containers and the ability to spin up an environment really quickly without all the necessary bulk that sometimes takes us hours days months years to get access to so thank you all and uh very much thank you for coming [Applause] [Music] thank you [Music]
Info
Channel: PowerShell Conference EU
Views: 974
Rating: undefined out of 5
Keywords: Monad, PSConfEU, PowerShell
Id: 2edD0akUwGQ
Channel Id: undefined
Length: 44min 18sec (2658 seconds)
Published: Fri Jul 07 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.