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

**URL:** <https://discourse.psappdeploytoolkit.com/t/how-do-you-load-the-toolkit-so-it-autocomplete-in-visual-code/2138>\
**Category:** General Discussion\
**Created:** [October 2, 2019, 9:31am UTC](https://discourse.psappdeploytoolkit.com/t/how-do-you-load-the-toolkit-so-it-autocomplete-in-visual-code/2138 "2019-10-02T09:31:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![long](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.psappdeploytoolkit.com/long/32/276_2.png) [@long](https://discourse.psappdeploytoolkit.com/u/long)\
**Post date:** [October 2, 2019, 9:31am UTC](https://discourse.psappdeploytoolkit.com/t/how-do-you-load-the-toolkit-so-it-autocomplete-in-visual-code/2138/1 "2019-10-02T09:31:51Z")

</div>

I use mostly visual code for creating the install script but how do i load so the function in the toolkit so it autocomplete in the editor…

thanks

---

<div class="post-metadata">

**Author:** ![bahnjee](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.psappdeploytoolkit.com/bahnjee/32/541_2.png) [@bahnjee](https://discourse.psappdeploytoolkit.com/u/bahnjee)\
**Post date:** [October 8, 2019, 3:52pm UTC](https://discourse.psappdeploytoolkit.com/t/how-do-you-load-the-toolkit-so-it-autocomplete-in-visual-code/2138/2 "2019-10-08T15:52:05Z")

</div>

I wasn’t a big fan of Visual Code when I tried it out, but I do recall you need to load a Powershell extension in order to get it to autocomplete and do the color-coding. (File \> Preferences \> Extensions)

Instead of Visual Code, I’m using the Windows Powershell ISE with an addon called ISESteroids. You may want to give it a look. It’s pretty awesome.

---

<div class="post-metadata">

**Author:** ![long](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.psappdeploytoolkit.com/long/32/276_2.png) [@long](https://discourse.psappdeploytoolkit.com/u/long)\
**Post date:** [October 8, 2019, 6:35pm UTC](https://discourse.psappdeploytoolkit.com/t/how-do-you-load-the-toolkit-so-it-autocomplete-in-visual-code/2138/3 "2019-10-08T18:35:03Z")

</div>

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:

[https://github.com/ofortun/ConfigMgr/tree/master/VSCode](https://github.com/ofortun/ConfigMgr/tree/master/VSCode)

# Configuring PSAppDeployToolkit for Intellisense in Visual Studio Code

1. Install the PowerShell Extension for VS Code
2. [PowerShell - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell)
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](https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/releases)
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

> [Intellisense on PSADT in PowerShell ISE • Christian Nyhuus](https://www.nyhu.us/powershell/psadt/intellisense-psadt-powershell-ise/) [Reddit - The heart of the internet](https://www.reddit.com/r/MDT/comments/5e3n5e/autocomplete_for_psadt_in_powershell_ise/)

---

<div class="post-metadata">

**Author:** ![Francois](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.psappdeploytoolkit.com/francois/32/196_2.png) [@Francois](https://discourse.psappdeploytoolkit.com/u/Francois)\
**Post date:** [October 13, 2019, 9:51am UTC](https://discourse.psappdeploytoolkit.com/t/how-do-you-load-the-toolkit-so-it-autocomplete-in-visual-code/2138/4 "2019-10-13T09:51:26Z")

</div>

I prefer ISE as I have to move from computer to computer so no need to be install. Also, PSADTK is running with no need to special configuration as shown below.

---

<div class="post-metadata">

**Author:** ![BaBa](https://avatars.discourse-cdn.com/v4/letter/b/a5b964/32.png) [@BaBa](https://discourse.psappdeploytoolkit.com/u/BaBa)\
**Post date:** [October 17, 2019, 2:07pm UTC](https://discourse.psappdeploytoolkit.com/t/how-do-you-load-the-toolkit-so-it-autocomplete-in-visual-code/2138/5 "2019-10-17T14:07:07Z")

</div>

Thanks for this detailed information, @long!

Based on your post, i edited my $profile-file with this:

```
$PSADTPath = "H:\Pack\Scripts\GDrive\CMDs\CodeSnippets\Silvermonkey Templates Test\Release\AppDeployToolkit"

If ( Test-Path -Path $PSADTPath ) {
  Copy-Item -Path $PSADTPath -Destination "$env:Temp" -Force -Recurse

  Push-Location "$env:Temp\$(Split-Path -Path $PSADTPath -Leaf)"
  $ToolKit = [XML](Get-Content .\AppDeployToolkitConfig.xml)
  $ToolKit.AppDeployToolkit_Config.Toolkit_Options.Toolkit_RequireAdmin = "False"
  $ToolKit.Save("$pwd\AppDeployToolkitConfig.xml")

  If ( Test-Path -Path .\AppDeployToolkitMain.ps1 ) {
    Move-Item -Path .\AppDeployToolkitMain.ps1 -Destination .\AppDeployToolkitMain.psm1 -Force
  }

  Import-Module .\AppDeployToolkitMain.psm1

  Pop-Location
} 

```

so it’ll load a fresh copy everytime, i start my favorite editor, or if using vscode: reload the window.

Thank you so much for guiding me in the right direction!

kind regards  
BaBa

---

<div class="post-metadata">

**Author:** ![mstrmnd1523](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.psappdeploytoolkit.com/mstrmnd1523/32/632_2.png) [@mstrmnd1523](https://discourse.psappdeploytoolkit.com/u/mstrmnd1523)\
**Post date:** [July 29, 2020, 9:37pm UTC](https://discourse.psappdeploytoolkit.com/t/how-do-you-load-the-toolkit-so-it-autocomplete-in-visual-code/2138/6 "2020-07-29T21:37:25Z")

</div>

I have been trying to follow these steps to import into VisualStudio Code. I have the powershell extension installed but it is 7.0.3 Core.

I converted all the Get-WmiObject commands to Get-CimInstance but I still get an error when trying to import the module.

Line10708  
Add-Type -Path $appDeployCustomTypesSourceCode -ReferencedAssembl …

```auto
C:\$Location\PowerShell\Modules\AppDeployToolkit\Toolkit\AppDeployToolkit\AppDeployToolkitMain.cs(9,23): error CS0234: The type or namespace name 'Principal' does not exist in the namespace 'System.Security' (are you missing an assembly reference?) using System.Security.Principal;      

Any ideas on how to fix this?
```

---

<div class="post-metadata">

**Author:** ![luki1412](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.psappdeploytoolkit.com/luki1412/32/630_2.png) [@luki1412](https://discourse.psappdeploytoolkit.com/u/luki1412)\
**Post date:** [July 31, 2020, 1:41pm UTC](https://discourse.psappdeploytoolkit.com/t/how-do-you-load-the-toolkit-so-it-autocomplete-in-visual-code/2138/7 "2020-07-31T13:41:18Z")

</div>

The toolkit isn’t compatible with PowerShellCore yet. Use PowerShell 5.1

---

<div class="post-metadata">

**Author:** ![mstrmnd1523](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.psappdeploytoolkit.com/mstrmnd1523/32/632_2.png) [@mstrmnd1523](https://discourse.psappdeploytoolkit.com/u/mstrmnd1523)\
**Post date:** [August 4, 2020, 4:36pm UTC](https://discourse.psappdeploytoolkit.com/t/how-do-you-load-the-toolkit-so-it-autocomplete-in-visual-code/2138/8 "2020-08-04T16:36:49Z")

</div>

Since PowerShell 5.1 is no longer actively supported, when will the toolkit be upgraded to support PowerShellCore?

---

<div class="post-metadata">

**Author:** ![lodhal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.psappdeploytoolkit.com/lodhal/32/2000_2.png) [@lodhal](https://discourse.psappdeploytoolkit.com/u/lodhal)\
**Post date:** [January 20, 2025, 10:32am UTC](https://discourse.psappdeploytoolkit.com/t/how-do-you-load-the-toolkit-so-it-autocomplete-in-visual-code/2138/9 "2025-01-20T10:32:34Z")

</div>

Just wanted to pop up all these years later to say that this still works with PSADT 4 and it is a massive help.

Thank you

---

<div class="post-metadata">

**Author:** ![mjr4077au](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.psappdeploytoolkit.com/mjr4077au/32/1976_2.png) [@mjr4077au](https://discourse.psappdeploytoolkit.com/u/mjr4077au)\
**Post date:** [January 20, 2025, 9:07pm UTC](https://discourse.psappdeploytoolkit.com/t/how-do-you-load-the-toolkit-so-it-autocomplete-in-visual-code/2138/10 "2025-01-20T21:07:08Z")

</div>

@lodhal I appreciate the praise and intent behind your comment, but please don’t raise 4.5 year old threads from the dead.

The autocomplete in v4 likely works simply because it’s a better architecture by way of it being a module rather than any steps performed here.

@That-Annoying-Guy, another one to lock please 🤜🤛

---

<div class="post-metadata">

**Author:** ![That-Annoying-Guy](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.psappdeploytoolkit.com/that-annoying-guy/32/22_2.png) [@That-Annoying-Guy](https://discourse.psappdeploytoolkit.com/u/That-Annoying-Guy)\
**Post date:** [January 20, 2025, 9:42pm UTC](https://discourse.psappdeploytoolkit.com/t/how-do-you-load-the-toolkit-so-it-autocomplete-in-visual-code/2138/11 "2025-01-20T21:42:59Z")

</div>


