mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-05-18 11:46:18 +00:00
23 lines
501 B
PowerShell
23 lines
501 B
PowerShell
|
|
function Get-FeatureId {
|
||
|
|
param(
|
||
|
|
[Parameter(Mandatory)]
|
||
|
|
$Feature
|
||
|
|
)
|
||
|
|
|
||
|
|
$featureId = [string]$Feature.FeatureId
|
||
|
|
if ([string]::IsNullOrWhiteSpace($featureId)) {
|
||
|
|
throw 'Selected feature is missing required FeatureId.'
|
||
|
|
}
|
||
|
|
|
||
|
|
return $featureId
|
||
|
|
}
|
||
|
|
|
||
|
|
function Get-RegistryBackedFeatures {
|
||
|
|
param(
|
||
|
|
[Parameter(Mandatory)]
|
||
|
|
[object[]]$Features
|
||
|
|
)
|
||
|
|
|
||
|
|
return @($Features | Where-Object { -not [string]::IsNullOrWhiteSpace([string]$_.RegistryKey) })
|
||
|
|
}
|