Skip to content

New ConnectionParameters

mgrzywa edited this page May 31, 2017 · 3 revisions

New-ConnectionParameters

PPoShTools -> New-ConnectionParameters.ps1

Synopsis

Creates an universal connection parameters object that can be conveniently used for opening connections.

Syntax

New-ConnectionParameters [[-Nodes] <String[]>] [[-RemotingMode] <String>] 
[[-Credential] <PSCredential>] [[-Authentication] <String>] [[-Port] <String>] 
[[-Protocol] <String>] [-CrossDomain] [<CommonParameters>]

Description

It returns following hashtable:

@{
    Nodes = <array of nodes>
    NodesAsString = <nodes in string format>
    RemotingMode = <RemotingMode>
    Credential = <Credential>
    Authentication = <Authentication>
    Port = <Port>
    Protocol = <Protocol>
    PSSessionParams = <hashtable that can be used for splatting in Invoke-Command>
    CimSessionParams = <hashtable that can be used for splatting in New-CimSession>
    MsDeployDestinationString = <string that can be used for opening msdeploy connections>
    OptionsAsString = <string describing all options for logging purposes>
}

Parameters

-Nodes<String[]>

Names of remote nodes where the connection will be established.

  • PipelineInput: false
  • Required: false

-RemotingMode<String> (default: PSRemoting)

Defines type of remoting protocol to be used for remote connection. Available values:

  • PSRemoting (default)
  • WebDeployHandler - https://<server>:<8172>/msdeploy.axd
  • WebDeployAgentService - http://<server>/MsDeployAgentService
  • Valid values: PSRemoting, WebDeployHandler, WebDeployAgentService
  • DefaultValue: PSRemoting
  • PipelineInput: false
  • Required: false

-Credential<PSCredential>

A PSCredential object that will be used when opening a remoting session to any of the $Nodes specified.

  • PipelineInput: false
  • Required: false

-Authentication<String>

Defines type of authentication that will be used to establish remote connection. Available values:

  • Basic
  • NTLM
  • CredSSP
  • Default (default)
  • Digest
  • Kerberos
  • Negotiate
  • NegotiateWithImplicitCredential
  • Valid values: <empty>, Basic, NTLM, Credssp, Default, Digest, Kerberos, Negotiate, NegotiateWithImplicitCredential
  • PipelineInput: false
  • Required: false

-Port<String>

Defines the port used for establishing remote connection.

  • PipelineInput: false
  • Required: false

-Protocol<String>

Defines the transport protocol used for establishing remote connection (HTTP or HTTPS). Available values:

  • HTTP (default)
  • HTTPS
  • Valid values: <empty>, HTTP, HTTPS
  • PipelineInput: false
  • Required: false

-CrossDomain<SwitchParameter> (default: False)

Should be on when destination nodes are outside current domain.

  • DefaultValue: False
  • PipelineInput: false
  • Required: false

Examples

Example 1

New-ConnectionParameters -Nodes server1