How can I run a powershell script with parameters inside the Deply-Application.ps1?

I need to run a Powershell script with parameters in the toolkit. I can run it without parameters and its fine. How do I include parameters?

This is the code

Execute-Process -Path "$PSHOME\powershell.exe" -Parameters "-file `"$dirFiles\Invoke-AppDeploy.ps1`"" -Wait

You could do this:

Execute-Process -Path "$PSHOME\powershell.exe" -Parameters "-file `"$dirFiles\Invoke-AppDeploy.ps1`" -Arguments -To -Script" -Wait

or

& "$dirFiles\Invoke-AppDeploy.ps1" -Arguments -To -Script

Hi everyone, how do I make the PowerShell & β€œ$dirFiles\Invoke-AppDeploy.ps1”
visible on the screen for the user to interact with it?
I’m getting stuck on the installation in progress please wait…

reference User Interactive Win32 Intune App Deployment with PSAppDeployToolkit | Semi Annual Chat

You want users to be capable to edit a command line that runs elevated.
And you recycled an old post to ask. (You should have just created your own post)

You could try SOMETHING like this:

[void] [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.VisualBasic")
$Default = "`"$dirFiles\Invoke-AppDeploy.ps1`""

#Get user input
$CmdLine = [Microsoft.VisualBasic.interaction]::Inputbox("is this good to run?","Title",$Default)

#Run the input
. $CmdLine 
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.