From 9e955cd0375bc1045ab768b9e1d1459eefac3677 Mon Sep 17 00:00:00 2001 From: admwkiv839 Date: Thu, 16 Jun 2022 08:25:07 +0200 Subject: [PATCH] Add the -NotDefault parameter. This causes the Cmdlet to not set $global:DefaultUcs --- src/Connection/Connect-To.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Connection/Connect-To.ps1 b/src/Connection/Connect-To.ps1 index b7e1abb..e587c6a 100644 --- a/src/Connection/Connect-To.ps1 +++ b/src/Connection/Connect-To.ps1 @@ -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) } -- 2.40.1