Customize welcome text from room and OU

This commit is contained in:
2026-09-17 11:46:33 -06:00
parent 6c52a9546c
commit 2de1105ecd
3 changed files with 28 additions and 8 deletions
+15 -3
View File
@@ -12,15 +12,20 @@ $lookup = $ast.Find({
}, $true)
function Invoke-WelcomeFixture {
param($DirectoryGender, [string]$ExplicitGender)
param(
$DirectoryGender,
[string]$ExplicitGender,
[string]$DirectoryLocation = 'Sala de pruebas',
[string]$DirectoryOu = 'Laboratorio'
)
# Replace only the external directory lookup. Execute the actual script,
# including its validated parameters, metadata assignment and JPEG renderer.
$fixtureJson = [pscustomobject]@{
DisplayName = 'Usuario de prueba'
Gender = $DirectoryGender
Location = 'Sala de pruebas'
OrganizationalUnit = 'Laboratorio'
Location = $DirectoryLocation
OrganizationalUnit = $DirectoryOu
} | ConvertTo-Json -Compress
$fixtureFunction = 'function Get-DirectoryWelcomeMetadata { param($UserName, $MachineName); ConvertFrom-Json ''' +
$fixtureJson.Replace("'", "''") + ''' }'
@@ -69,4 +74,11 @@ Describe 'Welcome wallpaper with AD metadata' {
It 'honors an explicit gender over directory metadata' {
(Invoke-WelcomeFixture -DirectoryGender 'Female' -ExplicitGender 'Male').WelcomeHeading | Should Be 'Bienvenido,'
}
It 'renders the flexible classroom and immediate OU as an access label' {
$result = Invoke-WelcomeFixture -DirectoryGender $null `
-DirectoryLocation 'Aula Flexible' `
-DirectoryOu 'Centro de Experiencia Digital'
$result.LocationText | Should Be 'Acceso al Aula Flexible del Centro de Experiencia Digital.'
}
}