ps/Modules/Alkami.PowerShell.ServiceFabric/Public/Clear-AlkamiServiceFabricClusterConnection.ps1

19 lines
599 B
PowerShell
Raw Permalink Normal View History

2023-05-30 22:51:22 -07:00
function Clear-AlkamiServiceFabricClusterConnection {
<#
.SYNOPSIS
Disconnects the current session from a Service Fabric cluster if connected.
This is mostly useful if you need to switch between client/admin credentials on the same cluster.
#>
[CmdletBinding()]
Param()
$loglead = (Get-LogLeadName);
if($null -eq $Global:ClusterConnection) {
Write-Host "$loglead Not connected to a Service Fabric cluster.";
return;
}
Write-Host "$loglead Clearing Service Fabric cluster connection.";
$Global:ClusterConnection = $null;
}