Start-ADTProcessAsUser
SYNOPSIS
Invokes a process in another user's session.
SYNTAX
Default_CreateWindow_Wait (Default)
Start-ADTProcessAsUser [-Username <NTAccount>] -FilePath <String> [-ArgumentList <String[]>]
[-SecureArgumentList] [-WorkingDirectory <String>] [-UseLinkedAdminToken] [-UseHighestAvailableToken]
[-DenyUserTermination] [-InheritEnvironmentVariables] [-ExpandEnvironmentVariables] [-WaitForMsiExec]
[-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
[-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>]
[-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure] [-ContinueWhenNoUserLoggedOn] [-PassThru]
[-WhatIf] [-Confirm] [<CommonParameters>]
Default_CreateNoWindow_Timeout
Start-ADTProcessAsUser [-Username <NTAccount>] -FilePath <String> [-ArgumentList <String[]>]
[-SecureArgumentList] [-WorkingDirectory <String>] [-UseLinkedAdminToken] [-UseHighestAvailableToken]
[-DenyUserTermination] [-InheritEnvironmentVariables] [-ExpandEnvironmentVariables] [-CreateNoWindow]
[-StreamEncoding <Encoding>] [-StandardInput <String[]>] [-NoStreamLogging] [-WaitForMsiExec]
[-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent] -Timeout <TimeSpan>
[-TimeoutAction <ActionPreference>] [-NoTerminateOnTimeout] [-SuccessExitCodes <Int32[]>]
[-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>]
[-ExitOnProcessFailure] [-ContinueWhenNoUserLoggedOn] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Default_CreateNoWindow_NoWait
Start-ADTProcessAsUser [-Username <NTAccount>] -FilePath <String> [-ArgumentList <String[]>]
[-SecureArgumentList] [-WorkingDirectory <String>] [-UseLinkedAdminToken] [-UseHighestAvailableToken]
[-DenyUserTermination] [-InheritEnvironmentVariables] [-ExpandEnvironmentVariables] [-CreateNoWindow]
[-StreamEncoding <Encoding>] [-StandardInput <String[]>] [-NoStreamLogging] [-WaitForMsiExec]
[-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
[-PriorityClass <ProcessPriorityClass>] [-ContinueWhenNoUserLoggedOn] [-NoWait] [-PassThru] [-WhatIf]
[-Confirm] [<CommonParameters>]
Default_CreateNoWindow_Wait
Start-ADTProcessAsUser [-Username <NTAccount>] -FilePath <String> [-ArgumentList <String[]>]
[-SecureArgumentList] [-WorkingDirectory <String>] [-UseLinkedAdminToken] [-UseHighestAvailableToken]
[-DenyUserTermination] [-InheritEnvironmentVariables] [-ExpandEnvironmentVariables] [-CreateNoWindow]
[-StreamEncoding <Encoding>] [-StandardInput <String[]>] [-NoStreamLogging] [-WaitForMsiExec]
[-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
[-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>]
[-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure] [-ContinueWhenNoUserLoggedOn] [-PassThru]
[-WhatIf] [-Confirm] [<CommonParameters>]
Default_WindowStyle_Timeout
Start-ADTProcessAsUser [-Username <NTAccount>] -FilePath <String> [-ArgumentList <String[]>]
[-SecureArgumentList] [-WorkingDirectory <String>] [-UseLinkedAdminToken] [-UseHighestAvailableToken]
[-DenyUserTermination] [-InheritEnvironmentVariables] [-ExpandEnvironmentVariables]
-WindowStyle <ProcessWindowStyle> [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] -Timeout <TimeSpan> [-TimeoutAction <ActionPreference>]
[-NoTerminateOnTimeout] [-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>]
[-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure]
[-ContinueWhenNoUserLoggedOn] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Default_WindowStyle_NoWait
Start-ADTProcessAsUser [-Username <NTAccount>] -FilePath <String> [-ArgumentList <String[]>]
[-SecureArgumentList] [-WorkingDirectory <String>] [-UseLinkedAdminToken] [-UseHighestAvailableToken]
[-DenyUserTermination] [-InheritEnvironmentVariables] [-ExpandEnvironmentVariables]
-WindowStyle <ProcessWindowStyle> [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] [-PriorityClass <ProcessPriorityClass>] [-ContinueWhenNoUserLoggedOn]
[-NoWait] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Default_WindowStyle_Wait
Start-ADTProcessAsUser [-Username <NTAccount>] -FilePath <String> [-ArgumentList <String[]>]
[-SecureArgumentList] [-WorkingDirectory <String>] [-UseLinkedAdminToken] [-UseHighestAvailableToken]
[-DenyUserTermination] [-InheritEnvironmentVariables] [-ExpandEnvironmentVariables]
-WindowStyle <ProcessWindowStyle> [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] [-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>]
[-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure]
[-ContinueWhenNoUserLoggedOn] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Default_CreateWindow_Timeout
Start-ADTProcessAsUser [-Username <NTAccount>] -FilePath <String> [-ArgumentList <String[]>]
[-SecureArgumentList] [-WorkingDirectory <String>] [-UseLinkedAdminToken] [-UseHighestAvailableToken]
[-DenyUserTermination] [-InheritEnvironmentVariables] [-ExpandEnvironmentVariables] [-WaitForMsiExec]
[-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent] -Timeout <TimeSpan>
[-TimeoutAction <ActionPreference>] [-NoTerminateOnTimeout] [-SuccessExitCodes <Int32[]>]
[-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>]
[-ExitOnProcessFailure] [-ContinueWhenNoUserLoggedOn] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Default_CreateWindow_NoWait
Start-ADTProcessAsUser [-Username <NTAccount>] -FilePath <String> [-ArgumentList <String[]>]
[-SecureArgumentList] [-WorkingDirectory <String>] [-UseLinkedAdminToken] [-UseHighestAvailableToken]
[-DenyUserTermination] [-InheritEnvironmentVariables] [-ExpandEnvironmentVariables] [-WaitForMsiExec]
[-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses] [-KillChildProcessesWithParent]
[-PriorityClass <ProcessPriorityClass>] [-ContinueWhenNoUserLoggedOn] [-NoWait] [-PassThru] [-WhatIf]
[-Confirm] [<CommonParameters>]
UseShellExecute_CreateNoWindow_NoWait
Start-ADTProcessAsUser [-Username <NTAccount>] -FilePath <String> [-ArgumentList <String[]>]
[-SecureArgumentList] [-WorkingDirectory <String>] [-ExpandEnvironmentVariables] [-UseShellExecute]
[-Verb <String>] [-CreateNoWindow] [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] [-PriorityClass <ProcessPriorityClass>] [-ContinueWhenNoUserLoggedOn]
[-NoWait] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
UseShellExecute_CreateNoWindow_Wait
Start-ADTProcessAsUser [-Username <NTAccount>] -FilePath <String> [-ArgumentList <String[]>]
[-SecureArgumentList] [-WorkingDirectory <String>] [-ExpandEnvironmentVariables] [-UseShellExecute]
[-Verb <String>] [-CreateNoWindow] [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] [-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>]
[-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure]
[-ContinueWhenNoUserLoggedOn] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
UseShellExecute_WindowStyle_NoWait
Start-ADTProcessAsUser [-Username <NTAccount>] -FilePath <String> [-ArgumentList <String[]>]
[-SecureArgumentList] [-WorkingDirectory <String>] [-ExpandEnvironmentVariables] [-UseShellExecute]
[-Verb <String>] -WindowStyle <ProcessWindowStyle> [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>]
[-WaitForChildProcesses] [-KillChildProcessesWithParent] [-PriorityClass <ProcessPriorityClass>]
[-ContinueWhenNoUserLoggedOn] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
UseShellExecute_WindowStyle_Wait
Start-ADTProcessAsUser [-Username <NTAccount>] -FilePath <String> [-ArgumentList <String[]>]
[-SecureArgumentList] [-WorkingDirectory <String>] [-ExpandEnvironmentVariables] [-UseShellExecute]
[-Verb <String>] -WindowStyle <ProcessWindowStyle> [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>]
[-WaitForChildProcesses] [-KillChildProcessesWithParent] [-SuccessExitCodes <Int32[]>]
[-RebootExitCodes <Int32[]>] [-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>]
[-ExitOnProcessFailure] [-ContinueWhenNoUserLoggedOn] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
UseShellExecute_CreateWindow_NoWait
Start-ADTProcessAsUser [-Username <NTAccount>] -FilePath <String> [-ArgumentList <String[]>]
[-SecureArgumentList] [-WorkingDirectory <String>] [-ExpandEnvironmentVariables] [-UseShellExecute]
[-Verb <String>] [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] [-PriorityClass <ProcessPriorityClass>] [-ContinueWhenNoUserLoggedOn]
[-NoWait] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
UseShellExecute_CreateWindow_Wait
Start-ADTProcessAsUser [-Username <NTAccount>] -FilePath <String> [-ArgumentList <String[]>]
[-SecureArgumentList] [-WorkingDirectory <String>] [-ExpandEnvironmentVariables] [-UseShellExecute]
[-Verb <String>] [-WaitForMsiExec] [-MsiExecWaitTime <TimeSpan>] [-WaitForChildProcesses]
[-KillChildProcessesWithParent] [-SuccessExitCodes <Int32[]>] [-RebootExitCodes <Int32[]>]
[-IgnoreExitCodes <String[]>] [-PriorityClass <ProcessPriorityClass>] [-ExitOnProcessFailure]
[-ContinueWhenNoUserLoggedOn] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
The Start-ADTProcessAsUser function invokes a process from SYSTEM in another user's session.
EXAMPLES
EXAMPLE 1
Start-ADTProcessAsUser -FilePath "$($adtSession.DirFiles)\Bin\setup.exe" -ArgumentList '/S' -WindowStyle 'Hidden'
Launch InstallShield "setup.exe" from the ".\Files\Bin" sub-directory.
EXAMPLE 2
Start-ADTProcessAsUser -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 3
Start-ADTProcessAsUser -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 4
Start-ADTProcessAsUser -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 5
Start-ADTProcessAsUser -FilePath 'setup.exe' -ArgumentList "/s /v`"ALLUSERS=1 /qn /L* `"$((Get-ADTConfig).Toolkit.LogPath)\$($adtSession.InstallName).log`"`"" -Timeout 00:10:00
Launch InstallShield "setup.exe" with embedded MSI and force log files to the logging folder, terminating the process if it takes longer than 10 minutes to complete.
EXAMPLE 6
Start-ADTProcessAsUser -FilePath 'setup.exe' -ArgumentList "/s /v`"ALLUSERS=1 /qn /L* `"$((Get-ADTConfig).Toolkit.LogPath)\$($adtSession.InstallName).log`"`"" -Timeout (New-TimeSpan -Minutes 10)
Launch InstallShield "setup.exe" with embedded MSI and force log files to the logging folder, terminating the process if it takes longer than 10 minutes to complete.
PARAMETERS
-Username
A username to invoke the process as. Only supported while running as the SYSTEM account.
Type: NTAccount
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: $RunAsActiveUser.UserName
Accept pipeline input: False
Accept wildcard characters: False
-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 arguments 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 the directory of the file being executed.
The use of -UseShellExecute affects this parameter.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
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: 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
-UseHighestAvailableToken
Use a user's linked administrative token if it's available while running the process under their context.
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
-DenyUserTermination
Specifies that users cannot terminate the process started in their context.
Note: This will not prevent the user from terminating the process if they are a member of the built-in Administrators group.
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
-InheritEnvironmentVariables
Specifies whether the process running as a user should inherit the SYSTEM account's environment variables.
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
-ExpandEnvironmentVariables
Specifies whether to expand any Windows/DOS-style environment variables in the specified -FilePath and -ArgumentList parameters.
Type: SwitchParameter
Parameter Sets: (All)
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 parameter behaves differently depending on the value of the -UseShellExecute parameter.
When -UseShellExecute is $true, the -WorkingDirectory parameter specifies the location of the executable.
When -UseShellExecute is $false, the -WorkingDirectory parameter 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_NoWait, UseShellExecute_CreateNoWindow_Wait, UseShellExecute_WindowStyle_NoWait, UseShellExecute_WindowStyle_Wait, 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_NoWait, UseShellExecute_CreateNoWindow_Wait, UseShellExecute_WindowStyle_NoWait, UseShellExecute_WindowStyle_Wait, UseShellExecute_CreateWindow_NoWait, UseShellExecute_CreateWindow_Wait
Aliases:
Required: False
Position: Named
Default value: None
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: Default_WindowStyle_Timeout, Default_WindowStyle_NoWait, Default_WindowStyle_Wait, 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: Default_CreateNoWindow_Timeout, Default_CreateNoWindow_NoWait, Default_CreateNoWindow_Wait, 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 stdin/stdout/stderr. Some apps like WinGet encode using UTF8, which will corrupt if incorrectly set.
Type: Encoding
Parameter Sets: Default_CreateNoWindow_Timeout, Default_CreateNoWindow_NoWait, Default_CreateNoWindow_Wait
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-StandardInput
Specifies a string to write to the process's stdin stream. This is handy for answering known prompts, etc.
Type: String[]
Parameter Sets: Default_CreateNoWindow_Timeout, Default_CreateNoWindow_NoWait, Default_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: Default_CreateNoWindow_Timeout, Default_CreateNoWindow_NoWait, Default_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: Default_CreateNoWindow_Timeout, Default_WindowStyle_Timeout, Default_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: Default_CreateNoWindow_Timeout, Default_WindowStyle_Timeout, Default_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, or when -CreateNoWindow isn't specified.
Type: SwitchParameter
Parameter Sets: Default_CreateNoWindow_Timeout, Default_WindowStyle_Timeout, Default_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, Default_CreateNoWindow_Timeout, Default_CreateNoWindow_Wait, Default_WindowStyle_Timeout, Default_WindowStyle_Wait, Default_CreateWindow_Timeout, UseShellExecute_CreateNoWindow_Wait, UseShellExecute_WindowStyle_Wait, 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, Default_CreateNoWindow_Timeout, Default_CreateNoWindow_Wait, Default_WindowStyle_Timeout, Default_WindowStyle_Wait, Default_CreateWindow_Timeout, UseShellExecute_CreateNoWindow_Wait, UseShellExecute_WindowStyle_Wait, 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, or -ErrorAction SilentlyContinue as this parameter is deprecated and will be removed in PSAppDeployToolkit 4.3.0.
Type: String[]
Parameter Sets: Default_CreateWindow_Wait, Default_CreateNoWindow_Timeout, Default_CreateNoWindow_Wait, Default_WindowStyle_Timeout, Default_WindowStyle_Wait, Default_CreateWindow_Timeout, UseShellExecute_CreateNoWindow_Wait, UseShellExecute_WindowStyle_Wait, 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, Default_CreateNoWindow_Timeout, Default_CreateNoWindow_Wait, Default_WindowStyle_Timeout, Default_WindowStyle_Wait, Default_CreateWindow_Timeout, UseShellExecute_CreateNoWindow_Wait, UseShellExecute_WindowStyle_Wait, UseShellExecute_CreateWindow_Wait
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-ContinueWhenNoUserLoggedOn
When specified, if no user is logged on, the condition is logged and the function returns without throwing an exception.
Type: SwitchParameter
Parameter Sets: (All)
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: 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 -SuccessExitCodes is used.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
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
None
By default, this function returns no output.
PSADT.ProcessManagement.ProcessResult
Returns an object with the results of the installation if -PassThru is specified.
- Process
- LaunchInfo
- CommandLine
- ExitCode
- StdOut
- StdErr
- Interleaved
PSADT.ProcessManagement.ProcessHandle
Returns an object with the handle of the installation process if -PassThru and -NoWait are specified.
- Process
- LaunchInfo
- CommandLine
- Task
NOTES
An active ADT session is NOT required to use this function.
This function supports the -WhatIf and -Confirm parameters for testing changes before applying them.
Tags: psadt
Website: https://psappdeploytoolkit.com
Copyright: (C) 2026 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