|
2 | 2 | external help file: System.Management.Automation.dll-Help.xml |
3 | 3 | Locale: en-US |
4 | 4 | Module Name: Microsoft.PowerShell.Core |
5 | | -ms.date: 12/09/2022 |
| 5 | +ms.date: 03/23/2026 |
6 | 6 | online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/new-pssession?view=powershell-7.4&WT.mc_id=ps-gethelp |
7 | 7 | schema: 2.0.0 |
8 | 8 | aliases: |
@@ -91,7 +91,7 @@ remote computer. |
91 | 91 | Use a **PSSession** to run multiple commands that share data, such as a function or the value of a |
92 | 92 | variable. To run commands in a **PSSession**, use the `Invoke-Command` cmdlet. To use the |
93 | 93 | **PSSession** to interact directly with a remote computer, use the `Enter-PSSession` cmdlet. For |
94 | | -more information, see [about_PSSessions](about/about_PSSessions.md). |
| 94 | +more information, see [about_PSSessions](About/about_PSSessions.md). |
95 | 95 |
|
96 | 96 | You can run commands on a remote computer without creating a **PSSession** with the **ComputerName** |
97 | 97 | parameters of `Enter-PSSession` or `Invoke-Command`. When you use the **ComputerName** parameter, |
@@ -140,7 +140,7 @@ help you manage the **PSSession** objects in subsequent commands. |
140 | 140 | ### Example 3: Create sessions on multiple computers |
141 | 141 |
|
142 | 142 | ```powershell |
143 | | -$s1, $s2, $s3 = New-PSSession -ComputerName Server01,Server02,Server03 |
| 143 | +$s1, $s2, $s3 = New-PSSession -ComputerName Server01, Server02, Server03 |
144 | 144 | ``` |
145 | 145 |
|
146 | 146 | This command creates three **PSSession** objects, one on each of the computers specified by the |
@@ -463,7 +463,7 @@ To use an IP address in the value of the **ComputerName** parameter, the command |
463 | 463 | address of the remote computer must be included in the WinRM TrustedHosts list on the local |
464 | 464 | computer. For instructions for adding a computer name to the TrustedHosts list, see "How to Add a |
465 | 465 | Computer to the Trusted Host List" in |
466 | | -[about_Remote_Troubleshooting](about/about_Remote_Troubleshooting.md). |
| 466 | +[about_Remote_Troubleshooting](About/about_Remote_Troubleshooting.md). |
467 | 467 |
|
468 | 468 | To include the local computer in the value of the **ComputerName** parameter, start Windows |
469 | 469 | PowerShell by using the **Run as administrator option**. |
@@ -742,7 +742,7 @@ Before using another port, you must configure the WinRM listener on the remote c |
742 | 742 | that port. Use the following commands to configure the listener: |
743 | 743 |
|
744 | 744 | 1. `winrm delete winrm/config/listener?Address=*+Transport=HTTP` |
745 | | -2. `winrm create winrm/config/listener?Address=*+Transport=HTTP @{Port="\<port-number\>"}` |
| 745 | +1. `winrm create winrm/config/listener?Address=*+Transport=HTTP @{Port="\<port-number\>"}` |
746 | 746 |
|
747 | 747 | Do not use the **Port** parameter unless you must. The port setting in the command applies to all |
748 | 748 | computers or sessions on which the command runs. An alternate port setting might prevent the command |
@@ -922,20 +922,13 @@ Accept wildcard characters: False |
922 | 922 |
|
923 | 923 | ### -UserName |
924 | 924 |
|
925 | | -Specifies the username for the account used to create a session on the remote computer. The user |
| 925 | +Specifies the user name for the account used to create a session on the remote computer. If the |
| 926 | +**UserName** parameter isn't specified then the current logged on username is used. User |
926 | 927 | authentication method depends on how Secure Shell (SSH) is configured on the remote computer. |
927 | 928 |
|
928 | | -If SSH is configured for basic password authentication then you'll be prompted for the user |
929 | | -password. |
930 | | - |
931 | | -If SSH is configured for key-based user authentication then a key file path can be provided via the |
932 | | -**KeyFilePath** parameter and you won't be prompted for a password. Note that if the client user key |
933 | | -file is located in an SSH known location then the **KeyFilePath** parameter is not needed for |
934 | | -key-based authentication, and user authentication occurs automatically based on the username. See |
935 | | -SSH documentation about key-based user authentication for more information. |
936 | | - |
937 | | -This is not a required parameter. If no **UserName** parameter is specified then the current log on |
938 | | -username is used for the connection. |
| 929 | +- If SSH is configured for password authentication then you are prompted for the user password. |
| 930 | +- If SSH is configured for key-based user authentication then you must have an SSH key file. If the |
| 931 | + user key file is located in an SSH-known location then the **KeyFilePath** parameter isn't needed. |
939 | 932 |
|
940 | 933 | This parameter was introduced in PowerShell 6.0. |
941 | 934 |
|
@@ -1035,8 +1028,8 @@ Accept wildcard characters: False |
1035 | 1028 |
|
1036 | 1029 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, |
1037 | 1030 | -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, |
1038 | | --WarningAction, and -WarningVariable. For more information, see about_CommonParameters |
1039 | | -(https://go.microsoft.com/fwlink/?LinkID=113216). |
| 1031 | +-WarningAction, and -WarningVariable. For more information, see |
| 1032 | +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). |
1040 | 1033 |
|
1041 | 1034 | ## INPUTS |
1042 | 1035 |
|
|
0 commit comments