When deploying v4 to devices which do not have the PS module installed, how do we go about that?
Previous PSADT versions were not an issue as all the cmdlets where in the main toolkit .ps1 file and any additional ones we made were in the extensions .ps1.
I dont really want to install-module for each deployment going forward as that will not be maintained.
You do not need to install the PSADT module. All you really need to do is Import-module into your current PowerShell session.
Import-Module does not install anything that needs to be cleaned up. Importing the module just loads it into memory, similar to dot sourcing the old toolkit.(source)
My understanding is that Invoke-AppDeployToolkit.ps1 script will import the PSADT module automatically.
As I understand the code that imports the module from the Invoke-AppDeployToolkit.ps1: if the module files are included in your package, the import will use them. (You do not need to install the module on all your computers prior to deploying a package.)
Only if you remove the module files from your package will it try to import an already-installed module. (This is probably useful in cases where you do not want to copy ~40 MB of files each time you deploy a package made with PSADT v4. In such cases, you can choose to install the module once on all your computers and then remove the “PsAppDeployToolkit” folder, which is 40 MB, from your packages.)
In short: if you don’t touch the “PsAppDeployToolkit” folder, you do not have to deal with module installation. It will load the module from there and unload it at the end.
Please keep in mind if you package and deploy, or in any other way install the module on the client systems, that you will need to be able to remove that module and replace it in the future as upgrades happen to PSADT.
As PSADT V4 is fairly new, I would expect there will likely be at least a few more updates coming to it in fairly quick succession.
Hi Dennis_S,
you will only need to clean or uninstall the PSADT module IF you purposefully install the module on a computer.
Otherwise, if you not need to think about it as the Invoke-AppDeployToolkit.ps1 script (aka Front Script) will import the PSADT module into the current PowerShell session. when the session is done, The module will disappear just like the main functions from v3.