benchpress/Modules/BenchPress.Azure/Public/Confirm-AksCluster.ps1

49 строки
1.1 KiB
PowerShell
Исходник Постоянная ссылка Обычный вид История

# INLINE_SKIP
#159 Refactor file structure * Initial commit with all but one unit test functioning correctly. Confirm-Resource.Tests.ps1 is failing due to "Unable to find type [ResourceType]", which makes no sense, since Get-ResourceByType uses the same enum, but the unit tests pass without issue. * Merged examples into grouped folders. Removed modules from the psd1. * Added a build script that can be used both during development and to build the final .psm1 for publishing to PS Gallery. * Minor code cleanup. * Updating CI/CD workflows. * Updated the installation and contributing docs. * Moved pr-psgallery.yml workflow into ci.yml. Now that there is a "build" process for the module this should happen in the CI pipeline and not the PR pipeline. * Fixing working directory for unit tests. * Swapped out relative paths for the PS Gallery module name in the examples, because the relative path will no longer work without building the module. * Moved the ci-publish-docs-branch.yml into the ci.yml. It made sense logically once I tried rewriting it after the refactor. * Fixing broken reference in the 'ci_cd_workflows.md' file. * Minor update to 'ci_cd_workflows.md' * I honestly couldn't figure out why `ResourceType` was not able to be found. I tried every which way of `using`/`Import`ing/dot sourcing that can be imagined. I think that this is a fundamental issue with PowerShell. The more I researched the more I found about enums and classes not being available from nested modules. I'm not sure why the classes work and enums do not though. * Fixing broken unit test's reference to `ResourceType.psm1`.
2023-03-01 03:32:31 +03:00
using module ./../Classes/ConfirmResult.psm1
#159 Refactor file structure * Initial commit with all but one unit test functioning correctly. Confirm-Resource.Tests.ps1 is failing due to "Unable to find type [ResourceType]", which makes no sense, since Get-ResourceByType uses the same enum, but the unit tests pass without issue. * Merged examples into grouped folders. Removed modules from the psd1. * Added a build script that can be used both during development and to build the final .psm1 for publishing to PS Gallery. * Minor code cleanup. * Updating CI/CD workflows. * Updated the installation and contributing docs. * Moved pr-psgallery.yml workflow into ci.yml. Now that there is a "build" process for the module this should happen in the CI pipeline and not the PR pipeline. * Fixing working directory for unit tests. * Swapped out relative paths for the PS Gallery module name in the examples, because the relative path will no longer work without building the module. * Moved the ci-publish-docs-branch.yml into the ci.yml. It made sense logically once I tried rewriting it after the refactor. * Fixing broken reference in the 'ci_cd_workflows.md' file. * Minor update to 'ci_cd_workflows.md' * I honestly couldn't figure out why `ResourceType` was not able to be found. I tried every which way of `using`/`Import`ing/dot sourcing that can be imagined. I think that this is a fundamental issue with PowerShell. The more I researched the more I found about enums and classes not being available from nested modules. I'm not sure why the classes work and enums do not though. * Fixing broken unit test's reference to `ResourceType.psm1`.
2023-03-01 03:32:31 +03:00
. $PSScriptRoot/../Private/Connect-Account.ps1
# end INLINE_SKIP
#159 Refactor file structure * Initial commit with all but one unit test functioning correctly. Confirm-Resource.Tests.ps1 is failing due to "Unable to find type [ResourceType]", which makes no sense, since Get-ResourceByType uses the same enum, but the unit tests pass without issue. * Merged examples into grouped folders. Removed modules from the psd1. * Added a build script that can be used both during development and to build the final .psm1 for publishing to PS Gallery. * Minor code cleanup. * Updating CI/CD workflows. * Updated the installation and contributing docs. * Moved pr-psgallery.yml workflow into ci.yml. Now that there is a "build" process for the module this should happen in the CI pipeline and not the PR pipeline. * Fixing working directory for unit tests. * Swapped out relative paths for the PS Gallery module name in the examples, because the relative path will no longer work without building the module. * Moved the ci-publish-docs-branch.yml into the ci.yml. It made sense logically once I tried rewriting it after the refactor. * Fixing broken reference in the 'ci_cd_workflows.md' file. * Minor update to 'ci_cd_workflows.md' * I honestly couldn't figure out why `ResourceType` was not able to be found. I tried every which way of `using`/`Import`ing/dot sourcing that can be imagined. I think that this is a fundamental issue with PowerShell. The more I researched the more I found about enums and classes not being available from nested modules. I'm not sure why the classes work and enums do not though. * Fixing broken unit test's reference to `ResourceType.psm1`.
2023-03-01 03:32:31 +03:00
function Confirm-AksCluster {
<#
.SYNOPSIS
Confirms that an AKS Cluster exists.
#159 Refactor file structure * Initial commit with all but one unit test functioning correctly. Confirm-Resource.Tests.ps1 is failing due to "Unable to find type [ResourceType]", which makes no sense, since Get-ResourceByType uses the same enum, but the unit tests pass without issue. * Merged examples into grouped folders. Removed modules from the psd1. * Added a build script that can be used both during development and to build the final .psm1 for publishing to PS Gallery. * Minor code cleanup. * Updating CI/CD workflows. * Updated the installation and contributing docs. * Moved pr-psgallery.yml workflow into ci.yml. Now that there is a "build" process for the module this should happen in the CI pipeline and not the PR pipeline. * Fixing working directory for unit tests. * Swapped out relative paths for the PS Gallery module name in the examples, because the relative path will no longer work without building the module. * Moved the ci-publish-docs-branch.yml into the ci.yml. It made sense logically once I tried rewriting it after the refactor. * Fixing broken reference in the 'ci_cd_workflows.md' file. * Minor update to 'ci_cd_workflows.md' * I honestly couldn't figure out why `ResourceType` was not able to be found. I tried every which way of `using`/`Import`ing/dot sourcing that can be imagined. I think that this is a fundamental issue with PowerShell. The more I researched the more I found about enums and classes not being available from nested modules. I'm not sure why the classes work and enums do not though. * Fixing broken unit test's reference to `ResourceType.psm1`.
2023-03-01 03:32:31 +03:00
.DESCRIPTION
The Confirm-AzBPAksCluster cmdlet gets an AKS Cluster using the specified AKS Cluster and Resource Group names.
#159 Refactor file structure * Initial commit with all but one unit test functioning correctly. Confirm-Resource.Tests.ps1 is failing due to "Unable to find type [ResourceType]", which makes no sense, since Get-ResourceByType uses the same enum, but the unit tests pass without issue. * Merged examples into grouped folders. Removed modules from the psd1. * Added a build script that can be used both during development and to build the final .psm1 for publishing to PS Gallery. * Minor code cleanup. * Updating CI/CD workflows. * Updated the installation and contributing docs. * Moved pr-psgallery.yml workflow into ci.yml. Now that there is a "build" process for the module this should happen in the CI pipeline and not the PR pipeline. * Fixing working directory for unit tests. * Swapped out relative paths for the PS Gallery module name in the examples, because the relative path will no longer work without building the module. * Moved the ci-publish-docs-branch.yml into the ci.yml. It made sense logically once I tried rewriting it after the refactor. * Fixing broken reference in the 'ci_cd_workflows.md' file. * Minor update to 'ci_cd_workflows.md' * I honestly couldn't figure out why `ResourceType` was not able to be found. I tried every which way of `using`/`Import`ing/dot sourcing that can be imagined. I think that this is a fundamental issue with PowerShell. The more I researched the more I found about enums and classes not being available from nested modules. I'm not sure why the classes work and enums do not though. * Fixing broken unit test's reference to `ResourceType.psm1`.
2023-03-01 03:32:31 +03:00
.PARAMETER AKSName
The name of the AKS Cluster.
#159 Refactor file structure * Initial commit with all but one unit test functioning correctly. Confirm-Resource.Tests.ps1 is failing due to "Unable to find type [ResourceType]", which makes no sense, since Get-ResourceByType uses the same enum, but the unit tests pass without issue. * Merged examples into grouped folders. Removed modules from the psd1. * Added a build script that can be used both during development and to build the final .psm1 for publishing to PS Gallery. * Minor code cleanup. * Updating CI/CD workflows. * Updated the installation and contributing docs. * Moved pr-psgallery.yml workflow into ci.yml. Now that there is a "build" process for the module this should happen in the CI pipeline and not the PR pipeline. * Fixing working directory for unit tests. * Swapped out relative paths for the PS Gallery module name in the examples, because the relative path will no longer work without building the module. * Moved the ci-publish-docs-branch.yml into the ci.yml. It made sense logically once I tried rewriting it after the refactor. * Fixing broken reference in the 'ci_cd_workflows.md' file. * Minor update to 'ci_cd_workflows.md' * I honestly couldn't figure out why `ResourceType` was not able to be found. I tried every which way of `using`/`Import`ing/dot sourcing that can be imagined. I think that this is a fundamental issue with PowerShell. The more I researched the more I found about enums and classes not being available from nested modules. I'm not sure why the classes work and enums do not though. * Fixing broken unit test's reference to `ResourceType.psm1`.
2023-03-01 03:32:31 +03:00
.PARAMETER ResourceGroupName
The name of the Resource Group. The name is case insensitive.
#159 Refactor file structure * Initial commit with all but one unit test functioning correctly. Confirm-Resource.Tests.ps1 is failing due to "Unable to find type [ResourceType]", which makes no sense, since Get-ResourceByType uses the same enum, but the unit tests pass without issue. * Merged examples into grouped folders. Removed modules from the psd1. * Added a build script that can be used both during development and to build the final .psm1 for publishing to PS Gallery. * Minor code cleanup. * Updating CI/CD workflows. * Updated the installation and contributing docs. * Moved pr-psgallery.yml workflow into ci.yml. Now that there is a "build" process for the module this should happen in the CI pipeline and not the PR pipeline. * Fixing working directory for unit tests. * Swapped out relative paths for the PS Gallery module name in the examples, because the relative path will no longer work without building the module. * Moved the ci-publish-docs-branch.yml into the ci.yml. It made sense logically once I tried rewriting it after the refactor. * Fixing broken reference in the 'ci_cd_workflows.md' file. * Minor update to 'ci_cd_workflows.md' * I honestly couldn't figure out why `ResourceType` was not able to be found. I tried every which way of `using`/`Import`ing/dot sourcing that can be imagined. I think that this is a fundamental issue with PowerShell. The more I researched the more I found about enums and classes not being available from nested modules. I'm not sure why the classes work and enums do not though. * Fixing broken unit test's reference to `ResourceType.psm1`.
2023-03-01 03:32:31 +03:00
.EXAMPLE
Confirm-AzBPAksCluster -AKSName "benchpresstest" -ResourceGroupName "rgbenchpresstest"
#159 Refactor file structure * Initial commit with all but one unit test functioning correctly. Confirm-Resource.Tests.ps1 is failing due to "Unable to find type [ResourceType]", which makes no sense, since Get-ResourceByType uses the same enum, but the unit tests pass without issue. * Merged examples into grouped folders. Removed modules from the psd1. * Added a build script that can be used both during development and to build the final .psm1 for publishing to PS Gallery. * Minor code cleanup. * Updating CI/CD workflows. * Updated the installation and contributing docs. * Moved pr-psgallery.yml workflow into ci.yml. Now that there is a "build" process for the module this should happen in the CI pipeline and not the PR pipeline. * Fixing working directory for unit tests. * Swapped out relative paths for the PS Gallery module name in the examples, because the relative path will no longer work without building the module. * Moved the ci-publish-docs-branch.yml into the ci.yml. It made sense logically once I tried rewriting it after the refactor. * Fixing broken reference in the 'ci_cd_workflows.md' file. * Minor update to 'ci_cd_workflows.md' * I honestly couldn't figure out why `ResourceType` was not able to be found. I tried every which way of `using`/`Import`ing/dot sourcing that can be imagined. I think that this is a fundamental issue with PowerShell. The more I researched the more I found about enums and classes not being available from nested modules. I'm not sure why the classes work and enums do not though. * Fixing broken unit test's reference to `ResourceType.psm1`.
2023-03-01 03:32:31 +03:00
.INPUTS
System.String
#159 Refactor file structure * Initial commit with all but one unit test functioning correctly. Confirm-Resource.Tests.ps1 is failing due to "Unable to find type [ResourceType]", which makes no sense, since Get-ResourceByType uses the same enum, but the unit tests pass without issue. * Merged examples into grouped folders. Removed modules from the psd1. * Added a build script that can be used both during development and to build the final .psm1 for publishing to PS Gallery. * Minor code cleanup. * Updating CI/CD workflows. * Updated the installation and contributing docs. * Moved pr-psgallery.yml workflow into ci.yml. Now that there is a "build" process for the module this should happen in the CI pipeline and not the PR pipeline. * Fixing working directory for unit tests. * Swapped out relative paths for the PS Gallery module name in the examples, because the relative path will no longer work without building the module. * Moved the ci-publish-docs-branch.yml into the ci.yml. It made sense logically once I tried rewriting it after the refactor. * Fixing broken reference in the 'ci_cd_workflows.md' file. * Minor update to 'ci_cd_workflows.md' * I honestly couldn't figure out why `ResourceType` was not able to be found. I tried every which way of `using`/`Import`ing/dot sourcing that can be imagined. I think that this is a fundamental issue with PowerShell. The more I researched the more I found about enums and classes not being available from nested modules. I'm not sure why the classes work and enums do not though. * Fixing broken unit test's reference to `ResourceType.psm1`.
2023-03-01 03:32:31 +03:00
.OUTPUTS
ConfirmResult
#>
[CmdletBinding()]
[OutputType([ConfirmResult])]
param (
[Parameter(Mandatory=$true)]
[string]$AksName,
[Parameter(Mandatory=$true)]
[string]$ResourceGroupName
)
Begin {
$connectResults = Connect-Account
}
Process {
$resource = Get-AzAksCluster -ResourceGroupName $ResourceGroupName -Name $AksName
[ConfirmResult]::new($resource, $connectResults.AuthenticationData)
}
End { }
}