Private/Get-PstComplexityFeatures.ps1
|
function Get-PstComplexityFeatures { <# .SYNOPSIS Retrieves feature set for a given complexity level and artifact type. .DESCRIPTION Wrapper around Get-PstComplexitySchema that returns just the features for a specific complexity level and type. Simplifies access to schema data. .PARAMETER Complexity The complexity level: Basic, Standard, or Advanced. .PARAMETER Type The artifact type: Function, Script, or Module. .EXAMPLE Get-PstComplexityFeatures -Complexity Standard -Type Function Returns the Standard complexity features for functions. .NOTES Version: 1.0 Author: numidia Creation Date: 2025-12-01 Purpose: Simplify access to complexity schema features #> [CmdletBinding()] param( [Parameter(Mandatory = $true)] [ValidateSet('Basic', 'Standard', 'Advanced')] [string]$Complexity, [Parameter(Mandatory = $true)] [ValidateSet('Function', 'Script', 'Module')] [string]$Type ) begin { Write-Debug "Begin '$($MyInvocation.MyCommand.Name)' at '$(Get-Date)'" } process { try { $schema = Get-PstComplexitySchema -Complexity $Complexity -Type $Type if (-not $schema) { throw "Schema not found for Complexity: $Complexity, Type: $Type" } Write-Verbose "Retrieved features for $Complexity $Type" return $schema } catch { Write-Error "Failed to get complexity features: $($_.Exception.Message)" $PSCmdlet.ThrowTerminatingError($_) } } end { Write-Debug "End '$($MyInvocation.MyCommand.Name)' at '$(Get-Date)'" } } |