How do you load the toolkit so it autocomplete in Visual Code?

ISESteroids is cool but it not free and…like vscode because there is a dark theme for it and alot of extensions.

got it to work by following these steps:

Configuring PSAppDeployToolkit for Intellisense in Visual Studio Code

  1. Install the PowerShell Extension for VS Code
  2. PowerShell - Visual Studio Marketplace
  3. Set the default language to PowerShell (optional)
  4. Under Settings (Ctrl+,) find Files: Default Language
  5. Set this to powershell
  6. Close Settings
  7. Download PSAppDeployToolkit
  8. Releases · PSAppDeployToolkit/PSAppDeployToolkit · GitHub
  9. Extract the contents to a folder
  10. Copy the Toolkit folder to a path of your choosing (such as these options)
  11. $Home\Documents\WindowsPowerShell\Modules
    1. $Env:ProgramFiles\WindowsPowerShell\Modules
  12. Mine is copied to: C:\Users\user\Documents\WindowsPowerShell\Modules\AppDeployToolkit
  13. Convert the script to a module
  14. In ISE: Open \Documents\WindowsPowerShell\Modules\AppDeployToolkit_AppDeployToolkitMain.ps1_
  15. File > Save As
    1. Change type to PowerShell Script Module
    2. Change name to: AppDeployToolkit.psm1
  16. Delete AppDeployToolkitMain.ps1, it is no longer needed
  17. Update the PSADT XML
  18. Edit AppDeployToolkitConfig.xml
  19. Edit Toolkit_RequireAdmin (line 17) from True to False
  20. Create a VS Code profile
  21. Launch VS Code and select the PowerShell Integrated Console terminal then type in notepad $profile
    1. If no profile exists, Notepad will ask to create the file, select Yes
  22. Add a line to import the module:
    1. Import-Module $Home\Documents\WindowsPowerShell\Modules\AppDeployToolkit
  23. I also add a line to clear the host, as I don’t want to see the import each time.
    1. Clear-Host
  24. Save Microsoft.VSCode_profile.ps1 and close Notepad
  25. Relaunch VS Code
  26. It will switch to the PowerShell extension, perform the import from the profile, then clear the host.
  27. You can confirm by running: get-help copy-file

Credit to Christian Nyhuus for documenting the steps for ISE

https://www.nyhu.us/powershell/psadt/intellisense-psadt-powershell-ise/ Reddit - Dive into anything

2 Likes