PowerShell App Deployment Toolkit with Microsoft Intune

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I've been looking forward to creating a video around the Powershell application deployment toolkit for quite a while now let's get stuck in you might remember the zoom application I packaged up I did it a couple of times I did it through MSI and then I used the win32 method and you know both of those are fine MSI less so than win32 in fact when we look at the win32 we can actually use some scripts when we deploy these applications and one of those scripts could be pretty intense script that is the Powershell application deployment toolkit you might have noticed when you were looking at that video If you haven't looked at it yet please take a look just click the link at the top somewhere over here I think and take a quick look at the video see what I did there and I'm going to jump straight into a version using the Powershell application deployment toolkit so at the top left here we have psadt it's just a tab group you won't see that in your browser obviously so take a look at the GitHub latest version of this is 3.9.2 so very simply a case of finding the zip file just choose it download and when you've downloaded it I'll show you exactly what you get you have this zip file right click that open it in Windows Explorer and you get two main folders one is examples and the other is toolkit now the toolkit is the thing we actually need you can use examples if you want to find out more about this in your own time I need the toolkit because I'm going to start using it so I'm going to copy that toolkit and I actually already have done this so bear with me while I just get back to that folder it's in D example and toolkit I've just copied the contents of toolkit I'll prove it to you in downloads go back into that in toolkit we have after blue toolkit files support files and these three files here go back to my example folder and that's exactly what we get also I've placed my zoom installer file in here that's the same windows installed the same MSI file that I showed you earlier on so let's use the Powershell application deployment toolkit to deploy this MSI go back into the toolkit find deploy application now in here we have deploy application which is an application file as you can see here and we also have deploy application which is a Windows Powershell script if we choose view show file name extensions you'll see that we have go back into that folder we'll see we have the deploy application.exe and deploy application.ps1 the executable need to stay at its that's exactly where we need it to be we're going to play with deploy application PS1 just open that and actually I don't have BS code on this machine let me grab that all right close that down I'm going to open this in vs code always get some close down the welcome screen maximize this and I might even zoom in because this is a little bit okay so at the top we have a synopsis around the script we have a description of how the script works we have some parameters that are defined here some examples of the use case I'm going to scroll all the way down this because I understand all of this but I would appreciate it if you could take a look at all of those details if you haven't yet look through the psadt please read through all the documentation it's a great level of detail you have in here once we get through that we go to the variable declaration and you can tap in things like the app vendor the app name the app version which was three uh what was it five one three one six two rolls off the tongue the architecture is 64. okay I'm done I'm pretty happy with what I've got here that'll do for this example I'm going to scroll down further and all of this is just routine scripting that we can just leave alone we don't need to do anything with it at all until we get to in this case line 178 but anywhere after the end variable declaration section this is where it says if deployment type is not equal to uninstall therefore we're installing it or repairing it and deployment type is not equal to repair therefore we're installing it do these things and these things start off with pre-installation so for example we might want to show a welcome message and close maybe Internet Explorer allow some deferrals if we aren't expecting the user to be ready to install this immediately and the the pre-installation task could be you know close Zoom close Outlook and uninstall any previous version of Zoom it's simply a case of tapping in underneath this line here under line 185 just tapping in the uninstall command for the existing version of Zoom that's installed I'm not going to show you that right now we'll just move straight on but that is definitely possible Within These pre-installation tasks so if we just scroll down you can see the next section is called installation and we have this section up here called zero config MSI installations if you want if you are creating many many applications and you need to automate that as much as possible it's possible to just use zero config MSI installations take a look at the documentation about how all that works to make sure you do it right for me I'm going to just use standard MSI installation which are in the perform installation tasks here section as you can see I've pre-typed this in but we have execute MSI and the action is installed and the path for the MSI is in der files which is a variable and the file is called Zoom installer full let me show you how this matters so we have dirt files Zoom installer full their files is very simply this files folder here if I go in there the next file you find is the zoom installer full MSI this is defined somewhere within this script package next the parameters I want to use to install this MSI are quiet and no restart that's pretty much it it'll install absolutely fine after that we scroll down the post installation tasks for example you can do whatever you want post installation you have full free rein of all the things that can possibly happen post installation you can run another executable the rmsi you could do anything you want you could write a script you could write individual lines of code here that will do certain things it's very customizable next we have if deployment type there's the if if deployment type is equal to uninstall then we are uninstalling it so we have to do the uninstall piece of work which here you can see I haven't quite filled out yet let's go back to my existing application that I've got let's go to properties find the uninstall command that was pre-filled for me here back to visual studio code and just tap that in oops just tap that in tab that across just there and so that is possibly oh you could do this I will caution though that's not the correct way to do that in the Powershell absolutely toolkit so actually what I'm going to do is tap in the correct command here which is execute MSI and then just tap in the path of this MSI it's this one here and make sure it's in single quotes and we can remove this line the incorrect line just above it so now we know that this will uninstall the MSI for us we also have post on installation tasks if you've got any cleanup tasks that you need to do right here and then we also can configure what happens during the repair option in this case I don't have any repair options that I need to configure just now so that's pretty much it I want to save this file and close down vs code heading back to our folders you can see we have this example toolkit files so this content here that I've just selected is the content we need to get to our Target devices it's the app deploy toolkit modules and files and scripts it's the files itself which is the MSI that I've just added it's support files that are things like logos and Banners and that kind of thing and then we have the actual executable we have the config file for it which is language translations all that kind of stuff and then the script that we've just modified so those are all the things that we need to package up so just like before we're going to package them up in the win32 app I'm gonna head to my local disk and just go to demo again and grab my InTune Win app util which is just here in fact I'm going to run it from here and reference the files that I've got in the toolkit so from here open the command prompt it's going to be in this folder here just run that as admin Source folder let's grab that here's example toolkit now I want all of these files so I'm going to just grab this location here there it is this setup file in this case is deploy application .exe and the output folder where we want this to go to is going to be a folder called packaged just put that there okay all done we'll head over to the InTune portal now so straight up to here now I've packaged Zoom a lot this this isn't the oh none of the ways I've done this are the only way to package Zoom Zoom is not the only application in the world Zoom is just an example of an application that I'm using it can be any application obviously it can be any script obviously I'm just using Zoom because it happens to be very simple to install so I'm going to go to add we go to app type I'm going to choose Windows app win32 select in the app package file go ahead and grab my not this one that would be a bad idea because that's the existing one I already had that's the zoom output one that I created the other day and choose d example packaged and then this InTune win file that I created just now with you she's open she's okay you can see that's set to deploy application.exe that will be very confusing if you left that as deploy application.xe for every single application that you packaged up using the ps80t don't do that that's not a good idea what we should do instead is give it a proper name like Zoom the windows and in the description we can give it a more similar title publisher name assume I assume uh it was version 5.0.16 I don't remember which is next now in the install command this is quite important we need to get this right and thankfully it's incredibly simple we're going to tap in deploy application dot XC right there and for the uninstall it's going to be not that that's a great hint but that's not it deploy application .xe Dash or minus deployment type uninstall and we're installing it for the user all the rest of this we can leave choose next the architecture is going to be x64 minimum OS something current maybe choose next rules format for the installation detection we're going to choose detection rules choose add and we'll go for MSI and just need to grab this product code that we had for this now at this stage I will admit I made a slight mistake when I was doing this the setup file that we configured should have been the MSI file that we're installing and the reason it should have been that is because it would have pre-filled this information about the text removal for us my bad yeah I've it's been a while since I did this let's just assume I didn't make that mistake and move on so that's the MSI product code I'm going to use for the detection so we'll choose ok which is next I have no dependencies in this particular case which is super seasons and again nothing in this case and I'm going to deploy it to all of my devices choose next and create now one of the benefits of using the Powershell application term toolkit is that you don't need to wait for it to be deployed via InTune before you actually get to test it let's take a look at what I mean I want to just minimize this while it's uploading all that content we've just done close all this down and then I've got to grow two of folder here called toolkit and we have deploy application.exe now you know that the script I'm using to install this application was simply deploy application.exe let's see what happens when we run that it's going to run deploy application.exe now for a few seconds you can see exactly what's going to show for your users we have the Powershell application deployment toolkit banner across the top it says the application is about to be installed and it's the Zoom app 5.13.12 602 and we're able to defer this if we need to I'm just show you what that means if I choose defer now that's just killed the application the application itself would report a failure into InTune because it didn't it wasn't able to to install it will give a specific code to InTune and then InTune won't immediately redeploy it it will be whatever whatever period you've got between your redeployment which could be one day it could be more let's assume that we make it happen immediately again just as a quick test you'll see the remaining deferrals is set to two that's going to happen however frequently you have the installation running on your device it is likely to be every day or so so let's choose continue it says installation started with that pop-up box called installation in progress it says installation complete now it's installation is complete because it finished installing it and then we have that you can customize the text to appear at the end of the install maybe you want to fix that before you get it out to your end users choose OK see if zoom's installed and oh Zoom there it is now that wasn't there before I haven't used this device for Zoo before so that's definitely a new application that's just been installed and it worked so that's exactly what we wanted we can probably clean up that application deployment toolkit a little bit in the future as well hopefully this has given you an insight into what the Powershell application deployment toolkit can do and I'm going to be diving deeper into these features in a future video see you next time foreign
Info
Channel: Dean Ellerby MVP
Views: 12,916
Rating: undefined out of 5
Keywords: powershell app deployment toolkit, how to use psadt, powershell app deployment toolkit tutorial, powershell app deployment toolkit guide, intune training, intune, microsoft intune
Id: USJj3lrhPBM
Channel Id: undefined
Length: 18min 12sec (1092 seconds)
Published: Mon Mar 20 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.