Skip to content

Commit 203d774

Browse files
SteveL-MSFTjoeyaiello
authored and
joeyaiello
committed
update documentation to reflect that -ConfigurationName can be used with SSH (#2318)
1 parent ae0f04e commit 203d774

File tree

3 files changed

+119
-10
lines changed

3 files changed

+119
-10
lines changed

reference/6/Microsoft.PowerShell.Core/Enter-PSSession.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ Enter-PSSession -ContainerId <String> [-ConfigurationName <String>] [-RunAsAdmin
6868

6969
### HostName
7070
```
71-
Enter-PSSession [-HostName] <string> [-Port <int>] [-UserName <string>] [-KeyFilePath <string>] [-SSHTransport] [<CommonParameters>]
71+
Enter-PSSession [-HostName] <string> [-Port <int>] [-UserName <string>] [-KeyFilePath <string>] [-SSHTransport]
72+
[-ConfigurationName <String>] [<CommonParameters>]
7273
```
7374

7475
## DESCRIPTION
@@ -304,6 +305,9 @@ Specifies the session configuration that is used for the interactive session.
304305
Enter a configuration name or the fully qualified resource URI for a session configuration.
305306
If you specify only the configuration name, the following schema URI is prepended: http://schemas.microsoft.com/powershell.
306307
308+
When used with SSH, this specifies the subsystem to use on the target as defined in sshd_config.
309+
The default value for SSH is the `powershell` subsystem.
310+
307311
The session configuration for a session is located on the remote computer.
308312
If the specified session configuration does not exist on the remote computer, the command fails.
309313

@@ -313,7 +317,7 @@ For more information, see about_Preference_Variables.
313317

314318
```yaml
315319
Type: String
316-
Parameter Sets: ComputerName, Uri, VMId, VMName, ContainerId
320+
Parameter Sets: ComputerName, Uri, VMId, VMName, ContainerId, HostName
317321
Aliases:
318322
319323
Required: False

reference/6/Microsoft.PowerShell.Core/Invoke-Command.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ Invoke-Command [-ConfigurationName <String>] [-ThrottleLimit <Int32>] [-AsJob] [
116116

117117
### HostName
118118
```
119-
Invoke-Command -ScriptBlock <scriptblock> -HostName <string[]> [-Port <int>] [-AsJob]
120-
[-HideComputerName] [-UserName <string>] [-KeyFilePath <string>] [-SSHTransport] [-RemoteDebug]
121-
[-InputObject <psobject>] [-ArgumentList <Object[]>] [<CommonParameters>]
119+
Invoke-Command [-ConfigurationName <String>] -ScriptBlock <scriptblock> -HostName <string[]> [-Port <int>]
120+
[-AsJob] [-HideComputerName] [-UserName <string>] [-KeyFilePath <string>] [-SSHTransport] [-RemoteDebug]
121+
[-InputObject <psobject>] [-ArgumentList <Object[]>] [<CommonParameters>]
122122
```
123123

124124
### FilePathHostName
@@ -703,6 +703,9 @@ Specifies the session configuration that is used for the new **PSSession**.
703703
Enter a configuration name or the fully qualified resource URI for a session configuration.
704704
If you specify only the configuration name, the following schema URI is prepended: http://schemas.microsoft.com/PowerShell.
705705

706+
When used with SSH, this specifies the subsystem to use on the target as defined in sshd_config.
707+
The default value for SSH is the `powershell` subsystem.
708+
706709
The session configuration for a session is located on the remote computer.
707710
If the specified session configuration does not exist on the remote computer, the command fails.
708711

@@ -712,7 +715,7 @@ For more information, see about_Preference_Variables.
712715

713716
```yaml
714717
Type: String
715-
Parameter Sets: ComputerName, FilePathComputerName, Uri, FilePathUri, VMId, VMName, FilePathVMId, FilePathVMName, ContainerId, FilePathContainerId
718+
Parameter Sets: ComputerName, FilePathComputerName, Uri, FilePathUri, VMId, VMName, FilePathVMId, FilePathVMName, ContainerId, FilePathContainerId, HostName
716719
Aliases:
717720
718721
Required: False
@@ -1245,7 +1248,7 @@ Accept wildcard characters: False
12451248
```
12461249

12471250
### -SSHConnection
1248-
This parameter takes an array of hashtables where each hashtable contains one or more connection parameters needed to establish a Secure Shell (SSH) connection (HostName, Port, UserName, KeyFilePath).
1251+
This parameter takes an array of hashtables where each hashtable contains one or more connection parameters needed to establish a Secure Shell (SSH) connection (HostName, Port, UserName, KeyFilePath, Subsystem).
12491252

12501253
The hashtable connection parameters are the same as defined for the HostName parameter set.
12511254

reference/6/Microsoft.PowerShell.Core/New-PSSession.md

Lines changed: 105 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ New-PSSession [-Name <String[]>] [-ConfigurationName <String>] -ContainerId <Str
5858

5959
### SSHHost
6060
```
61-
New-PSSession [-Name <String[]>] [-Port <Int32>] [-HostName] <String[]> [-UserName <String>]
62-
[-KeyFilePath <String>] [-SSHTransport] [<CommonParameters>]
61+
New-PSSession [-HostName] <string[]> [-Name <string[]>] [-Port <int>] [-UserName <string>] [-KeyFilePath <string>
62+
[-ConfigurationName <String>] [-SSHTransport] [<CommonParameters>]
6363
```
6464

6565
### SSHHostHashParam
@@ -372,6 +372,9 @@ Specifies the session configuration that is used for the new **PSSession**.
372372
Enter a configuration name or the fully qualified resource URI for a session configuration.
373373
If you specify only the configuration name, the following schema URI is prepended: http://schemas.microsoft.com/PowerShell.
374374
375+
When used with SSH, this specifies the subsystem to use on the target as defined in sshd_config.
376+
The default value for SSH is the `powershell` subsystem.
377+
375378
The session configuration for a session is located on the remote computer.
376379
If the specified session configuration does not exist on the remote computer, the command fails.
377380

@@ -381,7 +384,7 @@ For more information, see [about_Preference_Variables](About/about_Preference_Va
381384

382385
```yaml
383386
Type: String
384-
Parameter Sets: ComputerName, VMName, Uri, VMId, ContainerId
387+
Parameter Sets: ComputerName, VMName, Uri, VMId, ContainerId, HostName
385388
Aliases:
386389
387390
Required: False
@@ -796,6 +799,105 @@ Accept pipeline input: True (ByPropertyName)
796799
Accept wildcard characters: False
797800
```
798801

802+
### -HostName
803+
Specifies an array of computer names for a Secure Shell (SSH) based connection. This is similar to the ComputerName parameter except that the connection to the remote computer is made using SSH rather than Windows WinRM.
804+
805+
This parameter was introduced in PowerShell 6.0.
806+
807+
```yaml
808+
Type: String[]
809+
Parameter Sets: HostName
810+
Aliases:
811+
812+
Required: True
813+
Position: 0
814+
Default value: None
815+
Accept pipeline input: False
816+
Accept wildcard characters: False
817+
```
818+
819+
### -KeyFilePath
820+
Specifies a key file path used by Secure Shell (SSH) to authenticate a user on a remote computer.
821+
822+
SSH allows user authentication to be performed via private/public keys as an alternative to basic password authentication. If the remote computer is configured for key authentication then this parameter can be used to provide the key that identifies the user.
823+
824+
This parameter was introduced in PowerShell 6.0.
825+
826+
```yaml
827+
Type: String
828+
Parameter Sets: HostName
829+
Aliases:
830+
831+
Required: False
832+
Position: Named
833+
Default value: None
834+
Accept pipeline input: False
835+
Accept wildcard characters: False
836+
```
837+
838+
### -SSHTransport
839+
Indicates that the remote connection is established using Secure Shell (SSH).
840+
841+
By default PowerShell uses Windows WinRM to connect to a remote computer. This switch forces PowerShell to use the HostName parameter set for establishing an SSH based remote connection.
842+
843+
This parameter was introduced in PowerShell 6.0.
844+
845+
```yaml
846+
Type: SwitchParameter
847+
Parameter Sets: HostName
848+
Aliases:
849+
850+
Required: False
851+
Position: Named
852+
Default value: None
853+
Accept pipeline input: False
854+
Accept wildcard characters: False
855+
```
856+
857+
### -UserName
858+
Specifies the user name for the account used to create a session on the remote computer. User authentication method will depend on how Secure Shell (SSH) is configured on the remote computer.
859+
860+
If SSH is configured for basic password authentication then you will be prompted for the user password.
861+
862+
If SSH is configured for key based user authentication then a key file path can be provided via the KeyFilePath parameter and no password prompt will occur. Note that if the client user key file is located in an SSH known location then the KeyFilePath parameter is not needed for key based authentication, and user authentication will occur automatically based on the user name. See SSH documentation about key based user authentication for more information.
863+
864+
This is not a required parameter. If no UserName parameter is specified then the current log on user name is used for the connection.
865+
866+
This parameter was introduced in PowerShell 6.0.
867+
868+
```yaml
869+
Type: String
870+
Parameter Sets: HostName
871+
Aliases:
872+
873+
Required: False
874+
Position: Named
875+
Default value: None
876+
Accept pipeline input: False
877+
Accept wildcard characters: False
878+
```
879+
880+
### -SSHConnection
881+
This parameter takes an array of hashtables where each hashtable contains one or more connection parameters needed to establish a Secure Shell (SSH) connection (HostName, Port, UserName, KeyFilePath, Subsystem).
882+
883+
The hashtable connection parameters are the same as defined for the **HostName** parameter set.
884+
885+
The *SSHConnection* parameter is useful for creating multiple sessions where each session requires different connection information.
886+
887+
This parameter was introduced in PowerShell 6.0.
888+
889+
```yaml
890+
Type: hashtable
891+
Parameter Sets: SSHConnection
892+
Aliases:
893+
894+
Required: True
895+
Position: Named
896+
Default value: None
897+
Accept pipeline input: False
898+
Accept wildcard characters: False
899+
```
900+
799901
### CommonParameters
800902
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
801903

0 commit comments

Comments
 (0)