Functions/Internal/Get-CachedDatabricksClusterId.ps1
Function Get-CachedDatabricksClusterId{ param($ClusterName) if ($null -eq $ClusterIdCache){ $global:ClusterIdCache = @{} } if (-not $global:ClusterIdCache.ContainsKey($ClusterName)){ $global:ClusterIdCache.$ClusterName = (Get-DatabricksClusters | Where-Object { $_.cluster_name -eq $ClusterName }).cluster_id } return @{Id= $global:ClusterIdCache.$ClusterName} } |