mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-07-02 22:58:34 +00:00
Guard against loading, saving & executing undefined features (#665)
This commit is contained in:
@@ -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 = @()
|
||||
|
||||
Reference in New Issue
Block a user