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
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
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.
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
get-help copy-fileCredit to Christian Nyhuus for documenting the steps for ISE
Intellisense on PSADT in PowerShell ISE • Christian Nyhuus Reddit - The heart of the internet
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.
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
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 …
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?
The toolkit isn’t compatible with PowerShellCore yet. Use PowerShell 5.1
Since PowerShell 5.1 is no longer actively supported, when will the toolkit be upgraded to support PowerShellCore?
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
@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 ![]()
![]()