mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-10-08 14:36:48 +00:00
Credit to @jmolinap2 for their work in #643, which was used as inspiration.
26 lines
1.3 KiB
PowerShell
26 lines
1.3 KiB
PowerShell
BeforeAll {
|
|
$friendlyTargetScriptPath = Join-Path $PSScriptRoot '..\Scripts\Helpers\Get-FriendlyRegistryBackupTarget.ps1'
|
|
. $friendlyTargetScriptPath
|
|
. (Join-Path $PSScriptRoot '..\Scripts\FileIO\Import-JsonFile.ps1')
|
|
. (Join-Path $PSScriptRoot '..\Scripts\FileIO\Import-LanguageFile.ps1')
|
|
$script:LanguagesPath = Join-Path $PSScriptRoot '..\Config\Languages'
|
|
$script:Lang = Import-LanguageFile -LanguageCode 'en-US'
|
|
}
|
|
|
|
Describe 'Get-FriendlyRegistryBackupTarget' {
|
|
It 'formats <Case> as <Expected>' -ForEach @(
|
|
@{ Case = 'a null target'; Target = $null; Expected = 'Unknown' }
|
|
@{ Case = 'the default profile'; Target = 'DefaultUserProfile'; Expected = 'Default user profile' }
|
|
@{ Case = 'the current-user marker'; Target = 'CurrentUser'; Expected = 'Current user' }
|
|
@{ Case = 'the all-users marker'; Target = 'AllUsers'; Expected = 'All users' }
|
|
@{ Case = 'a named current user'; Target = 'CurrentUser:Alice'; Expected = 'Current user (Alice)' }
|
|
@{ Case = 'a named target user'; Target = 'User:Bob'; Expected = 'User (Bob)' }
|
|
) {
|
|
Get-FriendlyRegistryBackupTarget -Target $Target | Should -Be $Expected
|
|
}
|
|
|
|
It 'keeps unrecognized target text visible to the user' {
|
|
Get-FriendlyRegistryBackupTarget -Target 'Custom:Value' | Should -Be 'Custom:Value'
|
|
}
|
|
}
|