I love PowerShell App Deployment Toolkit (PSADT), and i do love autocomplete/Intellisense in PowerShell Integrated Scripting Environment (ISE). But this won’t work by default on the PSADT functions and arguments.
So in this article i will teach you how to make it work!
Download PowerShell App Deployment Toolkit
First of all, you will need to grab a copy of PSADT
- Go to https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/releases
- Download the latest version, or the version that you do use.
- Unzip it using your favorite unzipping tool! (i use 7-Zip)
Prepare PSADT for module integration
- Edit “\Toolkit\AppDeployToolkit\AppDeployToolkitMain.ps1” in PowerShell ISE
- Go to “File“, and hit “Save As“
- In “Save as type” select the “PowerShell Script Modules (*.psm1)“, make sure the file extentionis .psm1 and not ps1.
- Save it in the “\Toolkit\AppDeployToolkit\” folder.
- Edit “\Toolkit\AppDeployToolkit\AppDeployToolkitConfig.xml” in your favorite XML editor.
- Change the following line from (line 12 for PSADT 3.6.8)
<Toolkit_RequireAdmin>True</Toolkit_RequireAdmin>
to
<Toolkit_RequireAdmin>False</Toolkit_RequireAdmin>
- Then save the “\Toolkit\AppDeployToolkit\AppDeployToolkitConfig.xml” again.
- Go to “$env:UserProfile\Documents\WindowsPowerShell” (C:\Users\<Username>\Documents\WindowsPowerShell)
- Create a folder named “Modules”, if it doesn’t already exists.
- Copy the folder AppDeployToolkit from the Toolkit folder, into “$env:UserProfile\Documents\WindowsPowerShell\Modules”
Full path to the .psm1 file should now be:
“C:\Users\<Username>\Documents\WindowsPowerShell\Modules\AppDeployToolkit\AppDeployToolkitMain.psm1“
Create a PowerShell ISE Profile
- Launch PowerShell ISE
- Write Test-Path $Profile
If the result is $True , you can skip to step 4. If the result is $False , follow in step 3. - Write New-Item -Type File -Force $Profile
- In PowerShell ISE, write ISE $Profile and execute it.
This will open your PowerShell ISE Profile, in the PowerShell ISE.
Path to your profile is: “C:\Users\<Username>\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1“ - Add the following line to your profile:
Import-Module $env:UserProfile\Documents\WindowsPowerShell\Modules\AppDeployToolkit\AppDeployToolkitMain.psm1
- Save your profile file, restart PowerShell ISE, and you are done! Congratulations!
You should now be able to use Intellisense/autocomplete all functions in, the PowerShell App Deployment Toolkit.
This include the possibility to use the Get-Help cmdlet, on PSADT functions too, eg Get-Help Copy-File
Could you make a guide on making this work also in VScode
Thats a great ida, i will add that one to my todo list!