Start-ADTProcess
SYNOPSIS
Execute a process with optional arguments, working directory, window style.
SYNTAX
Default_CreateWindow_Wait (Default)
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseUnelevatedToken] [-ExpandEnvironmentVariables] [-WaitForMsiExec]
[-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
[-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>]
[-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure] [-PassThru] [<CommonParameters>]
RunAsActiveUser_CreateNoWindow_Timeout
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] -RunAsActiveUser <RunAsActiveUser> [-UseLinkedAdminToken]
[-UseHighestAvailableToken] [-InheritEnvironmentVariables] [-DenyUserTermination]
[-ExpandEnvironmentVariables] [-CreateNoWindow] [-StreamEncoding <Encoding>] [-NoStreamLogging]
[-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
-Timeout <TimeSpan> [-TimeoutAction <ActionPreference>] [-NoTerminateOnTimeout] [-SuccessExitCodes <Int32[]>]
[-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>]
[-ExitOnProcessFailure] [-PassThru] [<CommonParameters>]
RunAsActiveUser_CreateNoWindow_NoWait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] -RunAsActiveUser <RunAsActiveUser> [-UseLinkedAdminToken]
[-UseHighestAvailableToken] [-InheritEnvironmentVariables] [-DenyUserTermination]
[-ExpandEnvironmentVariables] [-CreateNoWindow] [-StreamEncoding <Encoding>] [-NoStreamLogging]
[-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
[-PriorityClass <ProcessPriorityClass>] [-NoWait] [-PassThru] [<CommonParameters>]
RunAsActiveUser_CreateNoWindow_Wait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] -RunAsActiveUser <RunAsActiveUser> [-UseLinkedAdminToken]
[-UseHighestAvailableToken] [-InheritEnvironmentVariables] [-DenyUserTermination]
[-ExpandEnvironmentVariables] [-CreateNoWindow] [-StreamEncoding <Encoding>] [-NoStreamLogging]
[-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
[-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>]
[-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure] [-PassThru] [<CommonParameters>]
RunAsActiveUser_WindowStyle_Timeout
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] -RunAsActiveUser <RunAsActiveUser> [-UseLinkedAdminToken]
[-UseHighestAvailableToken] [-InheritEnvironmentVariables] [-DenyUserTermination]
[-ExpandEnvironmentVariables] -WindowStyle <ProcessWindowStyle> [-WaitForMsiExec]
[-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent] -Timeout <TimeSpan>
[-TimeoutAction <ActionPreference>] [-NoTerminateOnTimeout] [-SuccessExitCodes <Int32[]>]
[-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>]
[-ExitOnProcessFailure] [-PassThru] [<CommonParameters>]
RunAsActiveUser_WindowStyle_NoWait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] -RunAsActiveUser <RunAsActiveUser> [-UseLinkedAdminToken]
[-UseHighestAvailableToken] [-InheritEnvironmentVariables] [-DenyUserTermination]
[-ExpandEnvironmentVariables] -WindowStyle <ProcessWindowStyle> [-WaitForMsiExec]
[-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
[-PriorityClass <ProcessPriorityClass>] [-NoWait] [-PassThru] [<CommonParameters>]
RunAsActiveUser_WindowStyle_Wait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] -RunAsActiveUser <RunAsActiveUser> [-UseLinkedAdminToken]
[-UseHighestAvailableToken] [-InheritEnvironmentVariables] [-DenyUserTermination]
[-ExpandEnvironmentVariables] -WindowStyle <ProcessWindowStyle> [-WaitForMsiExec]
[-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
[-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>]
[-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure] [-PassThru] [<CommonParameters>]
RunAsActiveUser_CreateWindow_Timeout
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] -RunAsActiveUser <RunAsActiveUser> [-UseLinkedAdminToken]
[-UseHighestAvailableToken] [-InheritEnvironmentVariables] [-DenyUserTermination]
[-ExpandEnvironmentVariables] [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] -Timeout <TimeSpan> [-TimeoutAction <ActionPreference>]
[-NoTerminateOnTimeout] [-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>]
[-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure] [-PassThru]
[<CommonParameters>]
RunAsActiveUser_CreateWindow_NoWait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] -RunAsActiveUser <RunAsActiveUser> [-UseLinkedAdminToken]
[-UseHighestAvailableToken] [-InheritEnvironmentVariables] [-DenyUserTermination]
[-ExpandEnvironmentVariables] [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] [-PriorityClass <ProcessPriorityClass>] [-NoWait] [-PassThru]
[<CommonParameters>]
RunAsActiveUser_CreateWindow_Wait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] -RunAsActiveUser <RunAsActiveUser> [-UseLinkedAdminToken]
[-UseHighestAvailableToken] [-InheritEnvironmentVariables] [-DenyUserTermination]
[-ExpandEnvironmentVariables] [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] [-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>]
[-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure] [-PassThru]
[<CommonParameters>]
Default_CreateNoWindow_Timeout
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseUnelevatedToken] [-ExpandEnvironmentVariables] [-CreateNoWindow]
[-StreamEncoding <Encoding>] [-NoStreamLogging] [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>]
[-WaitForChildProcesses] [-KillChildProcessesWithParent] -Timeout <TimeSpan>
[-TimeoutAction <ActionPreference>] [-NoTerminateOnTimeout] [-SuccessExitCodes <Int32[]>]
[-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>]
[-ExitOnProcessFailure] [-PassThru] [<CommonParameters>]
Default_CreateNoWindow_NoWait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseUnelevatedToken] [-ExpandEnvironmentVariables] [-CreateNoWindow]
[-StreamEncoding <Encoding>] [-NoStreamLogging] [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>]
[-WaitForChildProcesses] [-KillChildProcessesWithParent] [-PriorityClass <ProcessPriorityClass>] [-NoWait]
[-PassThru] [<CommonParameters>]
Default_CreateNoWindow_Wait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseUnelevatedToken] [-ExpandEnvironmentVariables] [-CreateNoWindow]
[-StreamEncoding <Encoding>] [-NoStreamLogging] [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>]
[-WaitForChildProcesses] [-KillChildProcessesWithParent] [-SuccessExitCodes <Int32[]>]
[-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>]
[-ExitOnProcessFailure] [-PassThru] [<CommonParameters>]
Default_WindowStyle_Timeout
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseUnelevatedToken] [-ExpandEnvironmentVariables]
-WindowStyle <ProcessWindowStyle> [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] -Timeout <TimeSpan> [-TimeoutAction <ActionPreference>]
[-NoTerminateOnTimeout] [-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>]
[-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure] [-PassThru]
[<CommonParameters>]
Default_WindowStyle_NoWait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseUnelevatedToken] [-ExpandEnvironmentVariables]
-WindowStyle <ProcessWindowStyle> [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] [-PriorityClass <ProcessPriorityClass>] [-NoWait] [-PassThru]
[<CommonParameters>]
Default_WindowStyle_Wait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseUnelevatedToken] [-ExpandEnvironmentVariables]
-WindowStyle <ProcessWindowStyle> [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] [-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>]
[-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure] [-PassThru]
[<CommonParameters>]
Default_CreateWindow_Timeout
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseUnelevatedToken] [-ExpandEnvironmentVariables] [-WaitForMsiExec]
[-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent] -Timeout <TimeSpan>
[-TimeoutAction <ActionPreference>] [-NoTerminateOnTimeout] [-SuccessExitCodes <Int32[]>]
[-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>]
[-ExitOnProcessFailure] [-PassThru] [<CommonParameters>]
Default_CreateWindow_NoWait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseUnelevatedToken] [-ExpandEnvironmentVariables] [-WaitForMsiExec]
[-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
[-PriorityClass <ProcessPriorityClass>] [-NoWait] [-PassThru] [<CommonParameters>]
UseShellExecute_CreateNoWindow_Timeout
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseShellExecute] [-Verb <String>] [-ExpandEnvironmentVariables]
[-CreateNoWindow] [-StreamEncoding <Encoding>] [-NoStreamLogging] [-WaitForMsiExec]
[-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent] -Timeout <TimeSpan>
[-TimeoutAction <ActionPreference>] [-NoTerminateOnTimeout] [-SuccessExitCodes <Int32[]>]
[-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>]
[-ExitOnProcessFailure] [-PassThru] [<CommonParameters>]
UseShellExecute_CreateNoWindow_NoWait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseShellExecute] [-Verb <String>] [-ExpandEnvironmentVariables]
[-CreateNoWindow] [-StreamEncoding <Encoding>] [-NoStreamLogging] [-WaitForMsiExec]
[-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
[-PriorityClass <ProcessPriorityClass>] [-NoWait] [-PassThru] [<CommonParameters>]
UseShellExecute_CreateNoWindow_Wait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseShellExecute] [-Verb <String>] [-ExpandEnvironmentVariables]
[-CreateNoWindow] [-StreamEncoding <Encoding>] [-NoStreamLogging] [-WaitForMsiExec]
[-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
[-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>]
[-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure] [-PassThru] [<CommonParameters>]
UseShellExecute_WindowStyle_Timeout
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseShellExecute] [-Verb <String>] [-ExpandEnvironmentVariables]
-WindowStyle <ProcessWindowStyle> [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] -Timeout <TimeSpan> [-TimeoutAction <ActionPreference>]
[-NoTerminateOnTimeout] [-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>]
[-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure] [-PassThru]
[<CommonParameters>]
UseShellExecute_WindowStyle_NoWait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseShellExecute] [-Verb <String>] [-ExpandEnvironmentVariables]
-WindowStyle <ProcessWindowStyle> [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] [-PriorityClass <ProcessPriorityClass>] [-NoWait] [-PassThru]
[<CommonParameters>]
UseShellExecute_WindowStyle_Wait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseShellExecute] [-Verb <String>] [-ExpandEnvironmentVariables]
-WindowStyle <ProcessWindowStyle> [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] [-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>]
[-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure] [-PassThru]
[<CommonParameters>]
UseShellExecute_CreateWindow_Timeout
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseShellExecute] [-Verb <String>] [-ExpandEnvironmentVariables]
[-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
-Timeout <TimeSpan> [-TimeoutAction <ActionPreference>] [-NoTerminateOnTimeout] [-SuccessExitCodes <Int32[]>]
[-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>]
[-ExitOnProcessFailure] [-PassThru] [<CommonParameters>]
UseShellExecute_CreateWindow_NoWait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseShellExecute] [-Verb <String>] [-ExpandEnvironmentVariables]
[-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
[-PriorityClass <ProcessPriorityClass>] [-NoWait] [-PassThru] [<CommonParameters>]
UseShellExecute_CreateWindow_Wait
Start-ADTProcess -FilePath <String> [-ArgumentList <String[]>] [-SecureArgumentList]
[-WorkingDirectory <String>] [-UseShellExecute] [-Verb <String>] [-ExpandEnvironmentVariables]
[-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
[-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>]
[-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure] [-PassThru] [<CommonParameters>]
DESCRIPTION
Executes a process, e.g. a file included in the Files directory of the App Deploy Toolkit, or a file on the local machine. Provides various options for handling the return codes (see Parameters).
EXAMPLES
EXAMPLE 1
Start-ADTProcess -FilePath 'setup.exe' -ArgumentList '/S' -SuccessExitCodes 1,2
Launch InstallShield "setup.exe" from the ".\Files" sub-directory.
EXAMPLE 2
Start-ADTProcess -FilePath "$($adtSession.DirFiles)\Bin\setup.exe" -ArgumentList '/S' -WindowStyle 'Hidden'
Launch InstallShield "setup.exe" from the ".\Files\Bin" sub-directory.
EXAMPLE 3
Start-ADTProcess -FilePath 'uninstall_flash_player_64bit.exe' -ArgumentList '/uninstall' -WindowStyle 'Hidden'
If the file is in the "Files" directory of the AppDeployToolkit, only the file name needs to be specified.
EXAMPLE 4
Start-ADTProcess -FilePath 'setup.exe' -ArgumentList "-s -f2`"$((Get-ADTConfig).Toolkit.LogPath)\$($adtSession.InstallName).log`""
Launch InstallShield "setup.exe" from the ".\Files" sub-directory and force log files to the logging folder.
EXAMPLE 5
Start-ADTProcess -FilePath 'setup.exe' -ArgumentList "/s /v`"ALLUSERS=1 /qn /L* `"$((Get-ADTConfig).Toolkit.LogPath)\$($adtSession.InstallName).log`"`""
Launch InstallShield "setup.exe" with embedded MSI and force log files to the logging folder.
EXAMPLE 6
$result = Start-ADTProcess -FilePath "setup.exe" -ArgumentList "-i -f `"$($adtSession.DirFiles)\licenseFile.lic`"" -CreateNoWindow -ErrorAction SilentlyContinue -PassThru
Launch "setup.exe" with -PassThru so we can capture the exit code and stdout/stderr from the executable if it's a console application.
PARAMETERS
-FilePath
Path to the file to be executed. If the file is located directly in the "Files" directory of the App Deploy Toolkit, only the file name needs to be specified.
Otherwise, the full path of the file must be specified. If the files is in a subdirectory of "Files", use the "$($adtSession.DirFiles)" variable as shown in the example.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ArgumentList
Arguments to be passed to the executable.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-SecureArgumentList
Hides all parameters passed to the executable from the Toolkit log file.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-WorkingDirectory
The working directory used for executing the process. Defaults to DirFiles if there is an active DeploymentSession. The use of UseShellExecute affects this parameter.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: [System.Management.Automation.Language.NullString]::Value
Accept pipeline input: False
Accept wildcard characters: False
-RunAsActiveUser
A RunAsActiveUser object to invoke the process as.
Type: RunAsActiveUser
Parameter Sets: RunAsActiveUser_CreateNoWindow_Timeout, RunAsActiveUser_CreateNoWindow_NoWait, RunAsActiveUser_CreateNoWindow_Wait, RunAsActiveUser_WindowStyle_Timeout, RunAsActiveUser_WindowStyle_NoWait, RunAsActiveUser_WindowStyle_Wait, RunAsActiveUser_CreateWindow_Timeout, RunAsActiveUser_CreateWindow_NoWait, RunAsActiveUser_CreateWindow_Wait
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-UseLinkedAdminToken
Use a user's linked administrative token while running the process under their context.
Type: SwitchParameter
Parameter Sets: RunAsActiveUser_CreateNoWindow_Timeout, RunAsActiveUser_CreateNoWindow_NoWait, RunAsActiveUser_CreateNoWindow_Wait, RunAsActiveUser_WindowStyle_Timeout, RunAsActiveUser_WindowStyle_NoWait, RunAsActiveUser_WindowStyle_Wait, RunAsActiveUser_CreateWindow_Timeout, RunAsActiveUser_CreateWindow_NoWait, RunAsActiveUser_CreateWindow_Wait
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-UseHighestAvailableToken
Use a user's linked administrative token if it's available while running the process under their context.
Type: SwitchParameter
Parameter Sets: RunAsActiveUser_CreateNoWindow_Timeout, RunAsActiveUser_CreateNoWindow_NoWait, RunAsActiveUser_CreateNoWindow_Wait, RunAsActiveUser_WindowStyle_Timeout, RunAsActiveUser_WindowStyle_NoWait, RunAsActiveUser_WindowStyle_Wait, RunAsActiveUser_CreateWindow_Timeout, RunAsActiveUser_CreateWindow_NoWait, RunAsActiveUser_CreateWindow_Wait
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-InheritEnvironmentVariables
Specifies whether the process running as a user should inherit the SYSTEM account's environment variables.
Type: SwitchParameter
Parameter Sets: RunAsActiveUser_CreateNoWindow_Timeout, RunAsActiveUser_CreateNoWindow_NoWait, RunAsActiveUser_CreateNoWindow_Wait, RunAsActiveUser_WindowStyle_Timeout, RunAsActiveUser_WindowStyle_NoWait, RunAsActiveUser_WindowStyle_Wait, RunAsActiveUser_CreateWindow_Timeout, RunAsActiveUser_CreateWindow_NoWait, RunAsActiveUser_CreateWindow_Wait
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-DenyUserTermination
Specifies that users cannot terminate the process started in their context. The user will still be able to terminate the process if they're an administrator, though.
Type: SwitchParameter
Parameter Sets: RunAsActiveUser_CreateNoWindow_Timeout, RunAsActiveUser_CreateNoWindow_NoWait, RunAsActiveUser_CreateNoWindow_Wait, RunAsActiveUser_WindowStyle_Timeout, RunAsActiveUser_WindowStyle_NoWait, RunAsActiveUser_WindowStyle_Wait, RunAsActiveUser_CreateWindow_Timeout, RunAsActiveUser_CreateWindow_NoWait, RunAsActiveUser_CreateWindow_Wait
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-UseUnelevatedToken
If the current process is elevated, starts the new process unelevated using the user's unelevated linked token.
Type: SwitchParameter
Parameter Sets: Default_CreateWindow_Wait, Default_CreateNoWindow_Timeout, Default_CreateNoWindow_NoWait, Default_CreateNoWindow_Wait, Default_WindowStyle_Timeout, Default_WindowStyle_NoWait, Default_WindowStyle_Wait, Default_CreateWindow_Timeout, Default_CreateWindow_NoWait
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-UseShellExecute
Specifies whether to use the operating system shell to start the process. $true if the shell should be used when starting the process; $false if the process should be created directly from the executable file.
The word "Shell" in this context refers to a graphical shell (similar to the Windows shell) rather than command shells (for example, bash or sh) and lets users launch graphical applications or open documents. It lets you open a file or a url and the Shell will figure out the program to open it with.
The WorkingDirectory property behaves differently depending on the value of the UseShellExecute property. When UseShellExecute is true, the WorkingDirectory property specifies the location of the executable. When UseShellExecute is false, the WorkingDirectory property is not used to find the executable. Instead, it is used only by the process that is started and has meaning only within the context of the new process.
If you set UseShellExecute to $true, there will be no available output from the process.
Type: SwitchParameter
Parameter Sets: UseShellExecute_CreateNoWindow_Timeout, UseShellExecute_CreateNoWindow_NoWait, UseShellExecute_CreateNoWindow_Wait, UseShellExecute_WindowStyle_Timeout, UseShellExecute_WindowStyle_NoWait, UseShellExecute_WindowStyle_Wait, UseShellExecute_CreateWindow_Timeout, UseShellExecute_CreateWindow_NoWait, UseShellExecute_CreateWindow_Wait
Aliases:
Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Verb
The verb to use when doing a ShellExecute invocation. Common usages are "runas" to trigger a UAC elevation of the process.
Type: String
Parameter Sets: UseShellExecute_CreateNoWindow_Timeout, UseShellExecute_CreateNoWindow_NoWait, UseShellExecute_CreateNoWindow_Wait, UseShellExecute_WindowStyle_Timeout, UseShellExecute_WindowStyle_NoWait, UseShellExecute_WindowStyle_Wait, UseShellExecute_CreateWindow_Timeout, UseShellExecute_CreateWindow_NoWait, UseShellExecute_CreateWindow_Wait
Aliases:
Required: False
Position: Named
Default value: [System.Management.Automation.Language.NullString]::Value
Accept pipeline input: False
Accept wildcard characters: False
-ExpandEnvironmentVariables
Specifies whether to expand any Windows/DOS-style environment variables in the specified FilePath/ArgumentList.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-WindowStyle
Style of the window of the process executed. Options: Normal, Hidden, Maximized, Minimized. Only works for native Windows GUI applications. If the WindowStyle is set to Hidden, UseShellExecute should be set to $true.
Note: Not all processes honor WindowStyle. WindowStyle is a recommendation passed to the process. They can choose to ignore it.
Type: ProcessWindowStyle
Parameter Sets: RunAsActiveUser_WindowStyle_Timeout, RunAsActiveUser_WindowStyle_NoWait, RunAsActiveUser_WindowStyle_Wait, Default_WindowStyle_Timeout, Default_WindowStyle_NoWait, Default_WindowStyle_Wait, UseShellExecute_WindowStyle_Timeout, UseShellExecute_WindowStyle_NoWait, UseShellExecute_WindowStyle_Wait
Aliases:
Accepted values: Normal, Hidden, Minimized, Maximized
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-CreateNoWindow
Specifies whether the process should be started with a new window to contain it.
Type: SwitchParameter
Parameter Sets: RunAsActiveUser_CreateNoWindow_Timeout, RunAsActiveUser_CreateNoWindow_NoWait, RunAsActiveUser_CreateNoWindow_Wait, Default_CreateNoWindow_Timeout, Default_CreateNoWindow_NoWait, Default_CreateNoWindow_Wait, UseShellExecute_CreateNoWindow_Timeout, UseShellExecute_CreateNoWindow_NoWait, UseShellExecute_CreateNoWindow_Wait
Aliases:
Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-StreamEncoding
Specifies the encoding type to use when reading stdout/stderr. Some apps like WinGet encode using UTF8, which will corrupt if incorrectly set.
Type: Encoding
Parameter Sets: RunAsActiveUser_CreateNoWindow_Timeout, RunAsActiveUser_CreateNoWindow_NoWait, RunAsActiveUser_CreateNoWindow_Wait, Default_CreateNoWindow_Timeout, Default_CreateNoWindow_NoWait, Default_CreateNoWindow_Wait, UseShellExecute_CreateNoWindow_Timeout, UseShellExecute_CreateNoWindow_NoWait, UseShellExecute_CreateNoWindow_Wait
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-NoStreamLogging
Don't log any available stdout/stderr data to the log file.
Type: SwitchParameter
Parameter Sets: RunAsActiveUser_CreateNoWindow_Timeout, RunAsActiveUser_CreateNoWindow_NoWait, RunAsActiveUser_CreateNoWindow_Wait, Default_CreateNoWindow_Timeout, Default_CreateNoWindow_NoWait, Default_CreateNoWindow_Wait, UseShellExecute_CreateNoWindow_Timeout, UseShellExecute_CreateNoWindow_NoWait, UseShellExecute_CreateNoWindow_Wait
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-WaitForMsiExec
Sometimes an EXE bootstrapper will launch an MSI install. In such cases, this variable will ensure that this function waits for the msiexec engine to become available before starting the install.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-MsiExecWaitTime
Specify the length of time in seconds to wait for the msiexec engine to become available.
Type: TimeSpan
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WaitForChildProcesses
Specifies whether the started process should be considered finished only when any child processes it spawns have finished also.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-KillChildProcessesWithParent
Specifies whether any child processes started by the provided executable should be closed when the provided executable closes. This is handy for application installs that open web browsers and other programs that cannot be suppressed.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Timeout
How long to wait for the process before timing out.
Type: TimeSpan
Parameter Sets: RunAsActiveUser_CreateNoWindow_Timeout, RunAsActiveUser_WindowStyle_Timeout, RunAsActiveUser_CreateWindow_Timeout, Default_CreateNoWindow_Timeout, Default_WindowStyle_Timeout, Default_CreateWindow_Timeout, UseShellExecute_CreateNoWindow_Timeout, UseShellExecute_WindowStyle_Timeout, UseShellExecute_CreateWindow_Timeout
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-TimeoutAction
What action to take on timeout. Follows ErrorAction if not specified.
Type: ActionPreference
Parameter Sets: RunAsActiveUser_CreateNoWindow_Timeout, RunAsActiveUser_WindowStyle_Timeout, RunAsActiveUser_CreateWindow_Timeout, Default_CreateNoWindow_Timeout, Default_WindowStyle_Timeout, Default_CreateWindow_Timeout, UseShellExecute_CreateNoWindow_Timeout, UseShellExecute_WindowStyle_Timeout, UseShellExecute_CreateWindow_Timeout
Aliases:
Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-NoTerminateOnTimeout
Indicates that the process should not be terminated on timeout. Only supported for GUI-based applications.
Type: SwitchParameter
Parameter Sets: RunAsActiveUser_CreateNoWindow_Timeout, RunAsActiveUser_WindowStyle_Timeout, RunAsActiveUser_CreateWindow_Timeout, Default_CreateNoWindow_Timeout, Default_WindowStyle_Timeout, Default_CreateWindow_Timeout, UseShellExecute_CreateNoWindow_Timeout, UseShellExecute_WindowStyle_Timeout, UseShellExecute_CreateWindow_Timeout
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-SuccessExitCodes
List of exit codes to be considered successful. Defaults to values set during ADTSession initialization, otherwise: 0
Type: Int32[]
Parameter Sets: Default_CreateWindow_Wait, RunAsActiveUser_CreateNoWindow_Timeout, RunAsActiveUser_CreateNoWindow_Wait, RunAsActiveUser_WindowStyle_Timeout, RunAsActiveUser_WindowStyle_Wait, RunAsActiveUser_CreateWindow_Timeout, RunAsActiveUser_CreateWindow_Wait, Default_CreateNoWindow_Timeout, Default_CreateNoWindow_Wait, Default_WindowStyle_Timeout, Default_WindowStyle_Wait, Default_CreateWindow_Timeout, UseShellExecute_CreateNoWindow_Timeout, UseShellExecute_CreateNoWindow_Wait, UseShellExecute_WindowStyle_Timeout, UseShellExecute_WindowStyle_Wait, UseShellExecute_CreateWindow_Timeout, UseShellExecute_CreateWindow_Wait
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-RebootExitCodes
List of exit codes to indicate a reboot is required. Defaults to values set during ADTSession initialization, otherwise: 1641, 3010
Type: Int32[]
Parameter Sets: Default_CreateWindow_Wait, RunAsActiveUser_CreateNoWindow_Timeout, RunAsActiveUser_CreateNoWindow_Wait, RunAsActiveUser_WindowStyle_Timeout, RunAsActiveUser_WindowStyle_Wait, RunAsActiveUser_CreateWindow_Timeout, RunAsActiveUser_CreateWindow_Wait, Default_CreateNoWindow_Timeout, Default_CreateNoWindow_Wait, Default_WindowStyle_Timeout, Default_WindowStyle_Wait, Default_CreateWindow_Timeout, UseShellExecute_CreateNoWindow_Timeout, UseShellExecute_CreateNoWindow_Wait, UseShellExecute_WindowStyle_Timeout, UseShellExecute_WindowStyle_Wait, UseShellExecute_CreateWindow_Timeout, UseShellExecute_CreateWindow_Wait
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IgnoreExitCodes
List the exit codes to ignore or * to ignore all exit codes. Where possible, please use -SuccessExitCodes
and/or -RebootExitCodes
instead.
Type: String[]
Parameter Sets: Default_CreateWindow_Wait, RunAsActiveUser_CreateNoWindow_Timeout, RunAsActiveUser_CreateNoWindow_Wait, RunAsActiveUser_WindowStyle_Timeout, RunAsActiveUser_WindowStyle_Wait, RunAsActiveUser_CreateWindow_Timeout, RunAsActiveUser_CreateWindow_Wait, Default_CreateNoWindow_Timeout, Default_CreateNoWindow_Wait, Default_WindowStyle_Timeout, Default_WindowStyle_Wait, Default_CreateWindow_Timeout, UseShellExecute_CreateNoWindow_Timeout, UseShellExecute_CreateNoWindow_Wait, UseShellExecute_WindowStyle_Timeout, UseShellExecute_WindowStyle_Wait, UseShellExecute_CreateWindow_Timeout, UseShellExecute_CreateWindow_Wait
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True
-PriorityClass
Specifies priority class for the process. Options: Idle, Normal, High, AboveNormal, BelowNormal, RealTime.
Type: ProcessPriorityClass
Parameter Sets: (All)
Aliases:
Accepted values: Normal, Idle, High, RealTime, BelowNormal, AboveNormal
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ExitOnProcessFailure
Automatically closes the active deployment session via Close-ADTSession in the event the process exits with a non-success or non-ignored exit code.
Type: SwitchParameter
Parameter Sets: Default_CreateWindow_Wait, RunAsActiveUser_CreateNoWindow_Timeout, RunAsActiveUser_CreateNoWindow_Wait, RunAsActiveUser_WindowStyle_Timeout, RunAsActiveUser_WindowStyle_Wait, RunAsActiveUser_CreateWindow_Timeout, RunAsActiveUser_CreateWindow_Wait, Default_CreateNoWindow_Timeout, Default_CreateNoWindow_Wait, Default_WindowStyle_Timeout, Default_WindowStyle_Wait, Default_CreateWindow_Timeout, UseShellExecute_CreateNoWindow_Timeout, UseShellExecute_CreateNoWindow_Wait, UseShellExecute_WindowStyle_Timeout, UseShellExecute_WindowStyle_Wait, UseShellExecute_CreateWindow_Timeout, UseShellExecute_CreateWindow_Wait
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-NoWait
Immediately continue after executing the process.
Type: SwitchParameter
Parameter Sets: RunAsActiveUser_CreateNoWindow_NoWait, RunAsActiveUser_WindowStyle_NoWait, RunAsActiveUser_CreateWindow_NoWait, Default_CreateNoWindow_NoWait, Default_WindowStyle_NoWait, Default_CreateWindow_NoWait, UseShellExecute_CreateNoWindow_NoWait, UseShellExecute_WindowStyle_NoWait, UseShellExecute_CreateWindow_NoWait
Aliases:
Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-PassThru
If -NoWait
is not specified, returns an object with ExitCode, StdOut, and StdErr output from the process. If -NoWait
is specified, returns a task that can be awaited. Note that a failed execution will only return an object if either -ErrorAction
is set to SilentlyContinue
/Ignore
, or if -IgnoreExitCodes
/-SuccessExitCodes
are used.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
None
You cannot pipe objects to this function.
OUTPUTS
PSADT.Types.ProcessResult
Returns an object with the results of the installation if -PassThru is specified.
- ProcessId
- ExitCode
- StdOut
- StdErr
- Interleaved
NOTES
An active ADT session is NOT required to use this function.
Tags: psadt
Website: https://psappdeploytoolkit.com
Copyright: (C) 2025 PSAppDeployToolkit Team (Sean Lillis, Dan Cunningham, Muhammad Mashwani, Mitch Richters, Dan Gough).
License: https://opensource.org/license/lgpl-3-0
RELATED LINKS
https://psappdeploytoolkit.com/docs/reference/functions/Start-ADTProcess