< Back

New-PSFSessionContainer

Sun Jan 19, 2020 6:42 pm

NAME New-PSFSessionContainer



SYNOPSIS

Creates an object containing multiple session objects to the same computer.





SYNTAX

New-PSFSessionContainer [-ComputerName] <ComputerParameter> [-Session] <Object[]> [-EnableException]

[<CommonParameters>]





DESCRIPTION

Creates an object containing multiple session objects to the same computer.

Using this, a single object can be used to point at a computer while containing session objects for multiple

protocols inside.



Only session types registered via Reigster-PSSessionObjectType are supported.





PARAMETERS

-ComputerName <ComputerParameter>

The name of the computer to connect to



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Session <Object[]>

The session objects that are a live connection to the host.



Required? true

Position? 2

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-EnableException [<SwitchParameter>]

This parameters disables user-friendly warnings and enables the throwing of exceptions.

This is less user friendly, but allows catching exceptions in calling scripts.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>New-PSFSessionContainer -ComputerName "server1" -Session $pssession, $cimsession, $smosession



Create a session container containing three different kinds of session objects











RELATED LINKS