From 8ee0bf8f41953478703bfdcc5da0df1775747ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A1udio=20Silva?= Date: Tue, 16 Aug 2022 08:21:22 +0100 Subject: [PATCH 1/2] Fix example 7 description Not using `-Port` parameter but infer that from the `-HostName` parameter. --- reference/7.2/Microsoft.PowerShell.Core/Enter-PSSession.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/7.2/Microsoft.PowerShell.Core/Enter-PSSession.md b/reference/7.2/Microsoft.PowerShell.Core/Enter-PSSession.md index b2eee3d22b08..fa7d9f4d5945 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/Enter-PSSession.md +++ b/reference/7.2/Microsoft.PowerShell.Core/Enter-PSSession.md @@ -197,8 +197,8 @@ Otherwise you will have to use SSH key based user authentication. PS> Enter-PSSession -HostName UserA@LinuxServer02:22 -KeyFilePath c:\\userAKey_rsa ``` -This example shows how to start an interactive session using SSH. It uses the **Port** parameter to -specify the port to use and the **KeyFilePath** parameter to specify an RSA key used to authenticate +This example shows how to start an interactive session using SSH. It uses the number after the `:` (22) +to specify the **Port** to use and the **KeyFilePath** parameter to specify an RSA key used to authenticate the user on the remote computer. ## PARAMETERS From da4f5c376b1772bc571e133c3fb25ba08ed0efe9 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 16 Aug 2022 08:36:15 -0500 Subject: [PATCH 2/2] Editorial changes and copy to other versions --- .../Enter-PSSession.md | 48 +++++++++-------- .../Enter-PSSession.md | 49 ++++++++--------- .../Enter-PSSession.md | 52 ++++++++++--------- .../Enter-PSSession.md | 35 ++++++------- 4 files changed, 94 insertions(+), 90 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/Enter-PSSession.md b/reference/5.1/Microsoft.PowerShell.Core/Enter-PSSession.md index 0299a45a8ead..2f076d47a7ae 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Enter-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Enter-PSSession.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 05/15/2019 +ms.date: 08/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/enter-pssession?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Enter-PSSession @@ -108,8 +108,10 @@ session as text. The first command uses the `Enter-PSSession` cmdlet to start an interactive session with Server01, a remote computer. When the session starts, the command prompt changes to include the computer name. -The second command gets the Windows PowerShell process and redirects the output to the Process.txt -file. The command is submitted to the remote computer, and the file is saved on the remote computer. + +The second command gets the PowerShell process and redirects the output to the Process.txt file. The +command is submitted to the remote computer, and the file is saved on the remote computer. + The third command uses the **Exit** keyword to end the interactive session and close the connection. The fourth command confirms that the Process.txt file is on the remote computer. A `Get-ChildItem` ("dir") command on the local computer cannot find the file. @@ -137,7 +139,7 @@ PS C:\> Enter-PSSession -Session $s ``` These commands use the **Session** parameter of `Enter-PSSession` to run the interactive session in -an existing Windows PowerShell session (**PSSession**). +an existing PowerShell session (**PSSession**). ### Example 4: Start an interactive session and specify the Port and Credential parameters @@ -172,8 +174,8 @@ Allows redirection of this connection to an alternate Uniform Resource Identifie redirection is not allowed. When you use the **ConnectionURI** parameter, the remote destination can return an instruction to -redirect to a different URI. By default, Windows PowerShell does not redirect connections, but you -can use this parameter to allow it to redirect the connection. +redirect to a different URI. By default, PowerShell does not redirect connections, but you can use +this parameter to allow it to redirect the connection. You can also limit the number of times the connection is redirected by changing the **MaximumConnectionRedirectionCount** session option value. Use the **MaximumRedirection** parameter @@ -187,7 +189,7 @@ Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -239,11 +241,12 @@ of the Windows operating system. For more information about the values of this parameter, see [AuthenticationMechanism Enum](/dotnet/api/system.management.automation.runspaces.authenticationmechanism). -Caution: Credential Security Support Provider (CredSSP) authentication, in which the user's -credentials are passed to a remote computer to be authenticated, is designed for commands that -require authentication on more than one resource, such as accessing a remote network share. This -mechanism increases the security risk of the remote operation. If the remote computer is -compromised, the credentials that are passed to it can be used to control the network session. +> [!CAUTION] +> Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are +> passed to a remote computer to be authenticated, is designed for commands that require +> authentication on more than one resource, such as accessing a remote network share. This mechanism +> increases the security risk of the remote operation. If the remote computer is compromised, the +> credentials that are passed to it can be used to control the network session. ```yaml Type: System.Management.Automation.Runspaces.AuthenticationMechanism @@ -266,8 +269,7 @@ this action. Enter the certificate thumbprint of the certificate. Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts; they do not work with domain accounts. -To get a certificate, use the `Get-Item` or `Get-ChildItem` command in the Windows PowerShell Cert: -drive. +To get a certificate, use the `Get-Item` or `Get-ChildItem` command in the PowerShell Cert: drive. ```yaml Type: System.String @@ -296,9 +298,9 @@ computer. For instructions for adding a computer name to the TrustedHosts list, Computer to the Trusted Host List" in [about_Remote_Troubleshooting](About/about_Remote_Troubleshooting.md). -Note: In Windows Vista and later versions of the Windows operating system, to include the local -computer in the value of the **ComputerName** parameter, you must start Windows PowerShell with the -Run as administrator option. +> [!NOTE] +> On the Windows operating system, to include the local computer in the value of the +> **ComputerName** parameter, you must start PowerShell with the Run as administrator option. ```yaml Type: System.String @@ -355,11 +357,11 @@ and **ApplicationName** parameters to specify the **ConnectionURI** values. Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but do not specify a port, the session is created by using standards -ports: 80 for HTTP and 443 for HTTPS. To use the default ports for Windows PowerShell remoting, -specify port 5985 for HTTP or 5986 for HTTPS. +ports: 80 for HTTP and 443 for HTTPS. To use the default ports for PowerShell remoting, specify port +5985 for HTTP or 5986 for HTTPS. -If the destination computer redirects the connection to a different URI, Windows PowerShell prevents -the redirection unless you use the **AllowRedirection** parameter in the command. +If the destination computer redirects the connection to a different URI, PowerShell prevents the +redirection unless you use the **AllowRedirection** parameter in the command. ```yaml Type: System.Uri @@ -556,7 +558,7 @@ Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -637,7 +639,7 @@ Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/7.0/Microsoft.PowerShell.Core/Enter-PSSession.md b/reference/7.0/Microsoft.PowerShell.Core/Enter-PSSession.md index 88a80df0b83f..2b5dc38675ef 100644 --- a/reference/7.0/Microsoft.PowerShell.Core/Enter-PSSession.md +++ b/reference/7.0/Microsoft.PowerShell.Core/Enter-PSSession.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 07/23/2020 +ms.date: 08/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/enter-pssession?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Enter-PSSession @@ -133,7 +133,7 @@ The fourth command confirms that the Process.txt file is on the remote computer. ```powershell PS C:\> Enter-PSSession -ComputerName Server01 -[Server01]: PS> +[Server01]: PS C:\> [Server01]: PS C:\> Get-Process PowerShell > C:\ps-test\Process.txt [Server01]: PS C:\> exit PS C:\> @@ -188,18 +188,18 @@ PS> Enter-PSSession -HostName UserA@LinuxServer01 ``` This example shows how to start an interactive session using Secure Shell (SSH). If SSH is -configured on the remote computer to prompt for passwords then you will get a password prompt. -Otherwise you will have to use SSH key based user authentication. +configured on the remote computer to use passwords then you are prompted to enter a password. +Otherwise, you must use key-based user authentication. -### Example 7: Start an interactive session using SSH and specify the Port and user authentication key +### Example 7: Start an interactive session using SSH with a port and user authentication key ```powershell -PS> Enter-PSSession -HostName UserA@LinuxServer02:22 -KeyFilePath c:\\userAKey_rsa +PS> Enter-PSSession -HostName UserA@LinuxServer02:22 -KeyFilePath c:\sshkeys\userAKey_rsa ``` -This example shows how to start an interactive session using SSH. It uses the **Port** parameter to -specify the port to use and the **KeyFilePath** parameter to specify an RSA key used to authenticate -the user on the remote computer. +This example shows how to start an interactive session using SSH. The username and SSH port number +are specified as parts of the value of the **HostName** parameter. The **KeyFilePath** parameter +specifies the location of an RSA key used to authenticate the user on the remote computer. ## PARAMETERS @@ -224,7 +224,7 @@ Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -276,11 +276,12 @@ of the Windows operating system. For more information about the values of this parameter, see [AuthenticationMechanism Enum](/dotnet/api/system.management.automation.runspaces.authenticationmechanism). -Caution: Credential Security Support Provider (CredSSP) authentication, in which the user's -credentials are passed to a remote computer to be authenticated, is designed for commands that -require authentication on more than one resource, such as accessing a remote network share. This -mechanism increases the security risk of the remote operation. If the remote computer is -compromised, the credentials that are passed to it can be used to control the network session. +> [!CAUTION] +> Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are +> passed to a remote computer to be authenticated, is designed for commands that require +> authentication on more than one resource, such as accessing a remote network share. This mechanism +> increases the security risk of the remote operation. If the remote computer is compromised, the +> credentials that are passed to it can be used to control the network session. ```yaml Type: System.Management.Automation.Runspaces.AuthenticationMechanism @@ -332,9 +333,9 @@ computer. For instructions for adding a computer name to the TrustedHosts list, Computer to the Trusted Host List" in [about_Remote_Troubleshooting](About/about_Remote_Troubleshooting.md). -Note: In Windows Vista and later versions of the Windows operating system, to include the local -computer in the value of the **ComputerName** parameter, you must start PowerShell with the Run as -administrator option. +> [!NOTE] +> On the Windows operating system, to include the local computer in the value of the +> **ComputerName** parameter, you must start PowerShell with the Run as administrator option. ```yaml Type: System.String @@ -486,7 +487,7 @@ Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -653,7 +654,7 @@ Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -732,7 +733,7 @@ Accepted values: true Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -754,7 +755,7 @@ Aliases: Required: False Position: Named -Default value: powershell +Default value: Powershell Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` @@ -809,7 +810,7 @@ Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -892,7 +893,7 @@ is available. To cancel the `Enter-PSSession` command, press CTRL+] [] ### VMId ``` -Enter-PSSession [-VMId] [-Credential] [-ConfigurationName ] [] +Enter-PSSession [-VMId] [-Credential] [-ConfigurationName ] + [] ``` ### VMName @@ -133,7 +134,7 @@ The fourth command confirms that the Process.txt file is on the remote computer. ```powershell PS C:\> Enter-PSSession -ComputerName Server01 -[Server01]: PS> +[Server01]: PS C:\> [Server01]: PS C:\> Get-Process PowerShell > C:\ps-test\Process.txt [Server01]: PS C:\> exit PS C:\> @@ -188,18 +189,18 @@ PS> Enter-PSSession -HostName UserA@LinuxServer01 ``` This example shows how to start an interactive session using Secure Shell (SSH). If SSH is -configured on the remote computer to prompt for passwords then you will get a password prompt. -Otherwise you will have to use SSH key based user authentication. +configured on the remote computer to use passwords then you are prompted to enter a password. +Otherwise, you must use key-based user authentication. -### Example 7: Start an interactive session using SSH and specify the Port and user authentication key +### Example 7: Start an interactive session using SSH with a port and user authentication key ```powershell -PS> Enter-PSSession -HostName UserA@LinuxServer02:22 -KeyFilePath c:\\userAKey_rsa +PS> Enter-PSSession -HostName UserA@LinuxServer02:22 -KeyFilePath c:\sshkeys\userAKey_rsa ``` -This example shows how to start an interactive session using SSH. It uses the number after the `:` (22) -to specify the **Port** to use and the **KeyFilePath** parameter to specify an RSA key used to authenticate -the user on the remote computer. +This example shows how to start an interactive session using SSH. The username and SSH port number +are specified as parts of the value of the **HostName** parameter. The **KeyFilePath** parameter +specifies the location of an RSA key used to authenticate the user on the remote computer. ## PARAMETERS @@ -224,7 +225,7 @@ Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -276,11 +277,12 @@ of the Windows operating system. For more information about the values of this parameter, see [AuthenticationMechanism Enum](/dotnet/api/system.management.automation.runspaces.authenticationmechanism). -Caution: Credential Security Support Provider (CredSSP) authentication, in which the user's -credentials are passed to a remote computer to be authenticated, is designed for commands that -require authentication on more than one resource, such as accessing a remote network share. This -mechanism increases the security risk of the remote operation. If the remote computer is -compromised, the credentials that are passed to it can be used to control the network session. +> [!CAUTION] +> Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are +> passed to a remote computer to be authenticated, is designed for commands that require +> authentication on more than one resource, such as accessing a remote network share. This mechanism +> increases the security risk of the remote operation. If the remote computer is compromised, the +> credentials that are passed to it can be used to control the network session. ```yaml Type: System.Management.Automation.Runspaces.AuthenticationMechanism @@ -332,9 +334,9 @@ computer. For instructions for adding a computer name to the TrustedHosts list, Computer to the Trusted Host List" in [about_Remote_Troubleshooting](About/about_Remote_Troubleshooting.md). -Note: In Windows Vista and later versions of the Windows operating system, to include the local -computer in the value of the **ComputerName** parameter, you must start PowerShell with the Run as -administrator option. +> [!NOTE] +> On the Windows operating system, to include the local computer in the value of the +> **ComputerName** parameter, you must start PowerShell with the Run as administrator option. ```yaml Type: System.String @@ -505,7 +507,7 @@ Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -672,7 +674,7 @@ Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -751,7 +753,7 @@ Accepted values: true Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -773,7 +775,7 @@ Aliases: Required: False Position: Named -Default value: powershell +Default value: Powershell Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` @@ -828,7 +830,7 @@ Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` @@ -911,7 +913,7 @@ is available. To cancel the `Enter-PSSession` command, press CTRL+ Enter-PSSession -ComputerName Server01 -[Server01]: PS> +[Server01]: PS C:\> [Server01]: PS C:\> Get-Process PowerShell > C:\ps-test\Process.txt [Server01]: PS C:\> exit PS C:\> @@ -189,18 +189,18 @@ PS> Enter-PSSession -HostName UserA@LinuxServer01 ``` This example shows how to start an interactive session using Secure Shell (SSH). If SSH is -configured on the remote computer to prompt for passwords then you will get a password prompt. -Otherwise you will have to use SSH key based user authentication. +configured on the remote computer to use passwords then you are prompted to enter a password. +Otherwise, you must use key-based user authentication. -### Example 7: Start an interactive session using SSH and specify the Port and user authentication key +### Example 7: Start an interactive session using SSH with a port and user authentication key ```powershell PS> Enter-PSSession -HostName UserA@LinuxServer02:22 -KeyFilePath c:\sshkeys\userAKey_rsa ``` -This example shows how to start an interactive session using SSH. It uses the **Port** parameter to -specify the port to use and the **KeyFilePath** parameter to specify an RSA key used to authenticate -the user on the remote computer. +This example shows how to start an interactive session using SSH. The username and SSH port number +are specified as parts of the value of the **HostName** parameter. The **KeyFilePath** parameter +specifies the location of an RSA key used to authenticate the user on the remote computer. ### Example 8: Start an interactive session using SSH options @@ -292,11 +292,12 @@ of the Windows operating system. For more information about the values of this parameter, see [AuthenticationMechanism Enum](/dotnet/api/system.management.automation.runspaces.authenticationmechanism). -Caution: Credential Security Support Provider (CredSSP) authentication, in which the user's -credentials are passed to a remote computer to be authenticated, is designed for commands that -require authentication on more than one resource, such as accessing a remote network share. This -mechanism increases the security risk of the remote operation. If the remote computer is -compromised, the credentials that are passed to it can be used to control the network session. +> [!CAUTION] +> Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are +> passed to a remote computer to be authenticated, is designed for commands that require +> authentication on more than one resource, such as accessing a remote network share. This mechanism +> increases the security risk of the remote operation. If the remote computer is compromised, the +> credentials that are passed to it can be used to control the network session. ```yaml Type: System.Management.Automation.Runspaces.AuthenticationMechanism @@ -348,9 +349,9 @@ computer. For instructions for adding a computer name to the TrustedHosts list, Computer to the Trusted Host List" in [about_Remote_Troubleshooting](About/about_Remote_Troubleshooting.md). -Note: In Windows Vista and later versions of the Windows operating system, to include the local -computer in the value of the **ComputerName** parameter, you must start PowerShell with the Run as -administrator option. +> [!NOTE] +> On the Windows operating system, to include the local computer in the value of the +> **ComputerName** parameter, you must start PowerShell with the Run as administrator option. ```yaml Type: System.String @@ -980,8 +981,6 @@ Any values explicitly passed by parameters take precedence over values passed in hashtable. For more information about `ssh_config` files, see [ssh_config(5)](https://man.openbsd.org/ssh_config.5). - - ## RELATED LINKS [Exit-PSSession](Exit-PSSession.md)