Add the -NotDefault parameter. This causes the Cmdlet to not set $global:DefaultUcs

This commit is contained in:
admwkiv839 2022-06-16 08:25:07 +02:00
parent 739c8cb9b0
commit 9e955cd037

View File

@ -175,7 +175,7 @@ function Connect-To {
switch ($Type) {
"CiscoUcs" {
try {
$handle = Connect-Ucs -Name $RemoteHost -Credential $creds -ErrorAction Stop
$handle = Connect-Ucs -Name $RemoteHost -Credential $creds -ErrorAction Stop -NotDefault
$ExecutionContext.SessionState.PSVariable.Set("DefaultUcs", $handle)
}