Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #10601 - Remove broken example #10607

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions reference/5.1/Microsoft.PowerShell.Management/Start-Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 12/12/2022
ms.date: 11/01/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/start-process?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Start-Process
Expand Down Expand Up @@ -135,26 +135,6 @@ Start-Process -FilePath "$env:comspec" -ArgumentList "/c dir `"%SystemDrive%\Pro
Start-Process -FilePath "$env:comspec" -ArgumentList "/c","dir","`"%SystemDrive%\Program Files`""
```

### Example 8: Run a command as an Administrator using alternate credentials

On Windows, you can run `Start-Process -Verb RunAs` to start a process with elevated permissions.
This elevates the current user's context. The **Credential** parameter allows you to specify an
alternate username and password, allowing you to start a process in a different user content.
However, the **Credential** and **Verb** parameters can't be used together.

To start a process with elevated rights, using alternate credentials, you must first start
PowerShell using the alternate credentials, then use `Start-Process` to start the process with
elevated rights.

```powershell
$cred = Get-Credential
$args = '-noprofile -command "Start-Process cmd.exe -Verb RunAs -args /k"'
Start-Process pwsh.exe -Credential $cred -WindowStyle Hidden -ArgumentList $args
```

The example starts `cmd.exe` with elevated permissions from a PowerShell session that is running
under alternate credentials.

## PARAMETERS

### -ArgumentList
Expand Down
24 changes: 2 additions & 22 deletions reference/7.2/Microsoft.PowerShell.Management/Start-Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 12/12/2022
ms.date: 11/01/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/start-process?view=powershell-7.2&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Start-Process
Expand Down Expand Up @@ -136,27 +136,7 @@ Start-Process -FilePath "$env:comspec" -ArgumentList "/c dir `"%SystemDrive%\Pro
Start-Process -FilePath "$env:comspec" -ArgumentList "/c","dir","`"%SystemDrive%\Program Files`""
```

### Example 8: Run a command as an Administrator using alternate credentials

On Windows, you can run `Start-Process -Verb RunAs` to start a process with elevated permissions.
This elevates the current user's context. The **Credential** parameter allows you to specify an
alternate username and password, allowing you to start a process in a different user content.
However, the **Credential** and **Verb** parameters can't be used together.

To start a process with elevated rights, using alternate credentials, you must first start
PowerShell using the alternate credentials, then use `Start-Process` to start the process with
elevated rights.

```powershell
$cred = Get-Credential
$args = '-noprofile -command "Start-Process cmd.exe -Verb RunAs -args /k"'
Start-Process pwsh.exe -Credential $cred -WindowStyle Hidden -ArgumentList $args
```

The example starts `cmd.exe` with elevated permissions from a PowerShell session that is running
under alternate credentials.

### Example 9: Create a detached process on Linux
### Example 8: Create a detached process on Linux

On Windows, `Start-Process` creates an independent process that remains running independently of the
launching shell. On non-Windows platforms, the newly started process is attached to the shell that
Expand Down
24 changes: 2 additions & 22 deletions reference/7.3/Microsoft.PowerShell.Management/Start-Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 12/12/2022
ms.date: 11/01/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/start-process?view=powershell-7.3&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Start-Process
Expand Down Expand Up @@ -136,27 +136,7 @@ Start-Process -FilePath "$env:comspec" -ArgumentList "/c dir `"%SystemDrive%\Pro
Start-Process -FilePath "$env:comspec" -ArgumentList "/c","dir","`"%SystemDrive%\Program Files`""
```

### Example 8: Run a command as an Administrator using alternate credentials

On Windows, you can run `Start-Process -Verb RunAs` to start a process with elevated permissions.
This elevates the current user's context. The **Credential** parameter allows you to specify an
alternate username and password, allowing you to start a process in a different user content.
However, the **Credential** and **Verb** parameters can't be used together.

To start a process with elevated rights, using alternate credentials, you must first start
PowerShell using the alternate credentials, then use `Start-Process` to start the process with
elevated rights.

```powershell
$cred = Get-Credential
$args = '-noprofile -command "Start-Process cmd.exe -Verb RunAs -args /k"'
Start-Process pwsh.exe -Credential $cred -WindowStyle Hidden -ArgumentList $args
```

The example starts `cmd.exe` with elevated permissions from a PowerShell session that is running
under alternate credentials.

### Example 9: Create a detached process on Linux
### Example 8: Create a detached process on Linux

On Windows, `Start-Process` creates an independent process that remains running independently of the
launching shell. On non-Windows platforms, the newly started process is attached to the shell that
Expand Down
26 changes: 3 additions & 23 deletions reference/7.4/Microsoft.PowerShell.Management/Start-Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 04/21/2023
ms.date: 11/01/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/start-process?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Start-Process
Expand Down Expand Up @@ -134,27 +134,7 @@ Start-Process -FilePath "$env:comspec" -ArgumentList "/c dir `"%SystemDrive%\Pro
Start-Process -FilePath "$env:comspec" -ArgumentList "/c","dir","`"%SystemDrive%\Program Files`""
```

### Example 8: Run a command as an Administrator using alternate credentials

On Windows, you can run `Start-Process -Verb RunAs` to start a process with elevated permissions.
This elevates the current user's context. The **Credential** parameter allows you to specify an
alternate username and password, allowing you to start a process in a different user content.
However, the **Credential** and **Verb** parameters can't be used together.

To start a process with elevated rights, using alternate credentials, you must first start
PowerShell using the alternate credentials, then use `Start-Process` to start the process with
elevated rights.

```powershell
$cred = Get-Credential
$args = '-noprofile -command "Start-Process cmd.exe -Verb RunAs -args /k"'
Start-Process pwsh.exe -Credential $cred -WindowStyle Hidden -ArgumentList $args
```

The example starts `cmd.exe` with elevated permissions from a PowerShell session that is running
under alternate credentials.

### Example 9: Create a detached process on Linux
### Example 8: Create a detached process on Linux

On Windows, `Start-Process` creates an independent process that remains running independently of the
launching shell. On non-Windows platforms, the newly started process is attached to the shell that
Expand All @@ -174,7 +154,7 @@ In this example, `Start-Process` is running the Linux `nohup` command, which lau
detached process. For more information, see the [nohup](https://wikipedia.org/wiki/Nohup) article on
Wikipedia.

### Example 10: Overriding an environment variable for a process
### Example 9: Overriding an environment variable for a process

By default, when you use `Start-Process`, the new process is created with the same environment
variables as the current session. You can use the **Environment** parameter to override the values
Expand Down