CmdID

CmdID / PowerShell / Cmdlets / Start

Start-Process

Starts one or more processes on the local computer. PowerShell reference

From the PowerShell reference 14 parameters Aliases saps, start

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Starts one or more processes on the local computer. The Start-Process cmdlet starts one or more processes on the local computer. By default, Start-Process creates a new process that inherits all the environment variables that are defined in the current process. To specify the program that runs in the process, enter an executable file or script file, or a file that can be opened using a program on the computer. If you specify a non-executable file, Start-Process starts the program that's associated with the file, similar to the Invoke-Item cmdlet. You can use the parameters of Start-Process to specify options, such as loading a user profile, starting the process in a new window, or using alternate credentials.

Start-Process [-FilePath] <string> [[-ArgumentList] <string[]>] [-Credential <pscredential>] [-WorkingDirectory <string>] [-LoadUserProfile] [-NoNewWindow] [-PassThru] [-RedirectStandardError <string>] [-RedirectStandardInput <string>] [-RedirectStandardOutput <string>] [-WindowStyle <ProcessWindowStyle>] [-Wait] [-UseNewEnvironment] [<CommonParameters>]
Start-Process [-FilePath] <string> [[-ArgumentList] <string[]>] [-WorkingDirectory <string>] [-PassThru] [-Verb <string>] [-WindowStyle <ProcessWindowStyle>] [-Wait] [<CommonParameters>]

Start a process that uses default values

Start-Process -FilePath "sort.exe"Identify

Print a text file

Start-Process -FilePath "myfile.txt" -WorkingDirectory "C:\PS-Test" -Verb PrintIdentify

Start a process to sort items to a new file

$processOptions = @{ FilePath = "sort.exe" RedirectStandardInput = "TestSort.txt" RedirectStandardOutput = "Sorted.txt" RedirectStandardError = "SortError.txt" UseNewEnvironment = $true } Start-Process @processOptionsIdentify

Start a process in a maximized window

Start-Process -FilePath "notepad" -Wait -WindowStyle MaximizedIdentify

Start PowerShell as an administrator

Start-Process -FilePath "powershell" -Verb RunAsIdentify

Using different verbs to start a process

$startExe = New-Object System.Diagnostics.ProcessStartInfo -Args powershell.exe $startExe.VerbsIdentify

Specifying arguments to the process

Start-Process -FilePath "$Env:ComSpec" -ArgumentList "/c dir "%SystemDrive%\Program Files"" Start-Process -FilePath "$Env:ComSpec" -ArgumentList "/c","dir",""%SystemDrive%\Program Files""Identify

Its page in the reference: Start-Process.

Parameters

14 in the PowerShell reference
-ArgumentListSpecifies parameters or parameter values to use when this cmdlet starts the process. Arguments can be accepted as a single string with the arguments separated by spaces, or as an array of strings separated by commas. The cmdlet joins the array into a single string with each element of the array separated by a single space. The outer quotes of the PowerShell strings aren't included when the ArgumentList values are passed to the new process. If parameters or parameter values contain a space or quotes, they need to be surrounded with escaped double quotes. For more information, see about_Quoting_Rules. For the best results, use a single ArgumentList value containing all the arguments and any needed quote characters.
-CredentialSpecifies a user account that has permission to perform this action. By default, the cmdlet uses the credentials of the current user. Credentials are stored in a PSCredential object and the password is stored as a SecureString. NOTE: For more information about SecureString data protection, see How secure is SecureString?.
-FilePathSpecifies the optional path and filename of the program that runs in the process. Enter the name of an executable file or of a document, such as a .txt or .doc file, that's associated with a program on the computer. This parameter is required. If you specify only a filename, use the WorkingDirectory parameter to specify the path. IMPORTANT: Using this parameter with untrusted data is a security risk. Only use trusted data with this parameter. For more information, see Validate All Inputs.
-LoadUserProfileIndicates that this cmdlet loads the Windows user profile stored in the HKEY_USERS registry key for the current user. This parameter doesn't affect the PowerShell profiles. For more information, see about_Profiles.
-NoNewWindowStart the new process in the current console window. By default on Windows, PowerShell opens a new window. You can't use the NoNewWindow and WindowStyle parameters in the same command.
-PassThruReturns a process object for each process that the cmdlet started. By default, this cmdlet doesn't generate any output.
-RedirectStandardErrorSpecifies a file. This cmdlet sends any errors generated by the process to a file that you specify. Enter the path and filename. By default, the errors are displayed in the console.
-RedirectStandardInputSpecifies a file. This cmdlet reads input from the specified file. Enter the path and filename of the input file. By default, the process gets its input from the keyboard.
-RedirectStandardOutputSpecifies a file. This cmdlet sends the output generated by the process to a file that you specify. Enter the path and filename. By default, the output is displayed in the console.
-UseNewEnvironmentIndicates that this cmdlet uses new environment variables specified for the process. By default, the started process runs with the environment variables inherited from the parent process.
-VerbSpecifies a verb to use when this cmdlet starts the process. The verbs that are available are determined by the filename extension of the file that runs in the process. The following table shows the verbs for some common process file types. To find the verbs that can be used with the file that runs in a process, use the New-Object cmdlet to create a System.Diagnostics.ProcessStartInfo object for the file. The available verbs are in the Verbs property of the ProcessStartInfo object. For details, see the examples.
-WaitIndicates that this cmdlet waits for the specified process and its descendants to complete before accepting more input. This parameter suppresses the command prompt or retains the window until the processes finish.
-WindowStyleSpecifies the state of the window that's used for the new process. The default value is Normal. The acceptable values for this parameter are: - Normal - Hidden - Minimized - Maximized You can't use the WindowStyle and NoNewWindow parameters in the same command.
-WorkingDirectorySpecifies the location that the new process should start in. The default is the location of the executable file or document being started. Wildcards aren't supported. The path must not contain characters that would be interpreted as wildcards. IMPORTANT: Using this parameter with untrusted data is a security risk. Only use trusted data with this parameter. For more information, see Validate All Inputs.