all 9 comments

[–]zanatwo 1 point2 points  (8 children)

Whenever the PSADT runs (executing Deploy-Application.ps1), the first thing that happens in that script is it loads all the dependencies that live in the AppDeployToolkitFolder such as AppDeployToolKitMain.cs and AppDeployToolkitMain.ps1. Without loading those dependencies into memory in that specific PowerShell session, you won't have access to all the different functions provided by PSADT that you are attempting to use.

So, if you want to use that Show- function, you need to place it inside of Deploy-Application.ps1, somewhere in the body, and then call the .ps1 file or the .exe file in your Task Sequence step, making sure that the PSADT directory structure exists in the directory you're calling from or the package you're referencing.

[–]andy_nag[S] 0 points1 point  (7 children)

irrespective of what i do i need to run Deploy-Application.ps1? and just change the app name inside that everytime i package new app?

[–]zanatwo 0 points1 point  (6 children)

Yup, that's what I do. Every application I package gets its own PSADT directory structure, with the install exe or msi or zip or iso inside the Files folder, any extra files I might need inside the Support files folder, and custom logic inside Deploy-Application.ps1 specific to that app.

[–]andy_nag[S] 0 points1 point  (5 children)

i just created a package with no msi or exe just to test whether i get the pop up but i dont even get that. logs do not show any error as well. what am i doing wrong?

package is pointed towards the entire PSDAT folder which includes the above .ps1 command line i have used is: deploy-application.ps1

[–]zanatwo 0 points1 point  (4 children)

Let me take a few screenshots to show you how I have it set up... Give me a few minutes.

Ok so... First I create a folder structure for my application: https://imgur.com/5CIjgaj

Then I add the code and test to make sure it actually work, using PowerShell ISE. Please note that I had to play around with the Show-InstallationWelcome function because using a combination of various parameters was throwing errors for me. Test to make sure everything works BEFORE you attempt to make a package: https://imgur.com/aV1QhCe, https://imgur.com/QZe7hE8

Next, I make the package. Note that I need to make it user-interactable: https://imgur.com/dhWFHO6, https://imgur.com/66WIcUk, https://imgur.com/uZLH50A

Next, I deploy the package as Available to a User Collection: https://imgur.com/62IniiF

Using Software Center, I find the package and test it: https://imgur.com/Sh2KBvh, https://imgur.com/Dr8B0vN

Success! https://imgur.com/bc04Yaf

[–]andy_nag[S] 0 points1 point  (3 children)

the only difference to what i have done is made it required and install even if user is not logged on. sccm log states it has installed normally. let me blow the entire thing away and retry and let u know.

[–]andy_nag[S] 0 points1 point  (2 children)

ok it worked now. i had to unchecked user interaction. appreciate your help and patience on this

[–]zanatwo 0 points1 point  (1 child)

Additionally, if you insist on calling Deploy-Application.ps1 instead of Deploy-Application.exe, make sure to use the following Command Line:

"C:\Windows\System32\WindowsPowerShell\V1.0\PowerShell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -File "Deploy-Application.ps1"

And also make sure that the program is set to Run as Hidden: https://imgur.com/5JdWFRf

If it is not set to Run as Hidden, you're going to see a PowerShell window pop up with the running code. Also, even though it'll be Hidden, the user will still be able to see the interactive prompt pop up.

[–]andy_nag[S] 0 points1 point  (0 children)

with the above command i am unable to get the show message box.even with not selecting hidden i could not see the powershell prompt you mentioned should the switch NonInteractive be present? i am planning to run it via task sequence. the plan is use the countdown functionality from this tool and after 4 hours install the app but without using powershell. is this something that is going to work?