Install PSADT as module on systems

Topics: Archive - General
Feb 14, 2015 at 6:11 PM
Hi,

is it possible to install the PSADT script as a own module on a system, so that in every PowerShell session the functions of PSADT are available.

In a nutshell, I'd like to add PSADT to systems and be able to load functions it's from any PowerShell Script / Session. In case of deploying multiple applications, each custom deployment PowerShell script per application would utilize the same PSADT functions rather than containing its own copy. With that approach I'm thinking of reduce duplication of having the PSADT copied across a huge amount of packages.

Let me know what you think of that.

Thanks!
Feb 27, 2015 at 11:40 PM
With the way it is built, I do not think it is possible. I think the key element would need to be the ability to rename the Deploy-Application.ps1 file and still have all of the pointers work. If you could do that you could put the toolkit in one location on a machine and deploy the .ps1 script to the root directory of the tool kit and run it. I have not tried anything so I may be way off base.
Mar 9, 2015 at 10:11 PM
I found this in the admin guide:

Deploy-Application.exe "Custom-Script.ps1"
Deploy an application with a custom name instead of Deploy-Application.ps1.

Deploy-Application.exe -Command "C:\Testing\Custom-Script.ps1" -DeploymentType "Uninstall"
Deploy an application with a custom name and custom location for the script file.

So it looks like you should be able to do what you want to do.
Mar 10, 2015 at 2:31 PM
RE: "With that approach I'm thinking of reduce duplication of having the PSADT copied across a huge amount of packages. "

Though this is noble, PSADT is still changing and improving at a fast pace.
Therefore you would create work to keep the AppDeployToolkitMain.ps1 files up-to-date on all your computers.
Also, launching PowerShell.exe would take longer before you'd see the console.

If you still want to do this, look on the internet for "how to change the colour of the console if you are elevated" and combine it with launching AppDeployToolkitMain.ps1

IMO: just dot source AppDeployToolkitMain.ps1 and be done with it. If you need to troubleshoot, you do not want to make AppDeployToolkitMain.ps1 and the console inseparable.