2023-04-05 01:01:03 +03:00
|
|
|
|
# INLINE_SKIP
|
2023-03-01 03:32:31 +03:00
|
|
|
|
using module ./../Classes/ConfirmResult.psm1
|
2023-02-22 20:21:50 +03:00
|
|
|
|
|
2023-03-01 03:32:31 +03:00
|
|
|
|
. $PSScriptRoot/../Private/Connect-Account.ps1
|
|
|
|
|
# end INLINE_SKIP
|
2023-02-22 20:21:50 +03:00
|
|
|
|
|
2023-03-01 03:32:31 +03:00
|
|
|
|
function Confirm-AksCluster {
|
|
|
|
|
<#
|
|
|
|
|
.SYNOPSIS
|
|
|
|
|
Confirms that an AKS Cluster exists.
|
2023-02-22 20:21:50 +03:00
|
|
|
|
|
2023-03-01 03:32:31 +03:00
|
|
|
|
.DESCRIPTION
|
2023-04-05 01:01:03 +03:00
|
|
|
|
The Confirm-AzBPAksCluster cmdlet gets an AKS Cluster using the specified AKS Cluster and Resource Group names.
|
2023-02-22 20:21:50 +03:00
|
|
|
|
|
2023-03-01 03:32:31 +03:00
|
|
|
|
.PARAMETER AKSName
|
2023-04-05 01:01:03 +03:00
|
|
|
|
The name of the AKS Cluster.
|
2023-02-22 20:21:50 +03:00
|
|
|
|
|
2023-03-01 03:32:31 +03:00
|
|
|
|
.PARAMETER ResourceGroupName
|
2023-04-05 01:01:03 +03:00
|
|
|
|
The name of the Resource Group. The name is case insensitive.
|
2023-02-22 20:21:50 +03:00
|
|
|
|
|
2023-03-01 03:32:31 +03:00
|
|
|
|
.EXAMPLE
|
|
|
|
|
Confirm-AzBPAksCluster -AKSName "benchpresstest" -ResourceGroupName "rgbenchpresstest"
|
2023-02-22 20:21:50 +03:00
|
|
|
|
|
2023-03-01 03:32:31 +03:00
|
|
|
|
.INPUTS
|
|
|
|
|
System.String
|
2023-02-22 20:21:50 +03:00
|
|
|
|
|
2023-03-01 03:32:31 +03:00
|
|
|
|
.OUTPUTS
|
|
|
|
|
ConfirmResult
|
|
|
|
|
#>
|
2023-02-22 20:21:50 +03:00
|
|
|
|
[CmdletBinding()]
|
|
|
|
|
[OutputType([ConfirmResult])]
|
|
|
|
|
param (
|
|
|
|
|
[Parameter(Mandatory=$true)]
|
|
|
|
|
[string]$AksName,
|
|
|
|
|
|
|
|
|
|
[Parameter(Mandatory=$true)]
|
|
|
|
|
[string]$ResourceGroupName
|
|
|
|
|
)
|
|
|
|
|
Begin {
|
2023-04-05 01:01:03 +03:00
|
|
|
|
$connectResults = Connect-Account
|
2023-02-22 20:21:50 +03:00
|
|
|
|
}
|
|
|
|
|
Process {
|
2023-04-05 01:01:03 +03:00
|
|
|
|
$resource = Get-AzAksCluster -ResourceGroupName $ResourceGroupName -Name $AksName
|
2023-02-22 20:21:50 +03:00
|
|
|
|
|
2023-04-05 01:01:03 +03:00
|
|
|
|
[ConfirmResult]::new($resource, $connectResults.AuthenticationData)
|
2023-02-22 20:21:50 +03:00
|
|
|
|
}
|
|
|
|
|
End { }
|
|
|
|
|
}
|