Guard against loading, saving & executing undefined features (#665)

This commit is contained in:
Jeffrey
2026-06-23 00:41:33 +02:00
committed by GitHub
parent d1fe541b62
commit 5ebc50d36a
11 changed files with 209 additions and 84 deletions

View File

@@ -1,17 +1,10 @@
function Get-FeatureId {
param(
[Parameter(Mandatory)]
$Feature
)
$featureId = [string]$Feature.FeatureId
if ([string]::IsNullOrWhiteSpace($featureId)) {
throw 'Selected feature is missing required FeatureId.'
}
return $featureId
}
<#
.SYNOPSIS
Filters a list of features to those that have a non-empty RegistryKey.
.PARAMETER Features
An array of feature objects to filter.
#>
function Get-RegistryBackedFeatures {
param(
[object[]]$Features = @()