Customize welcome text from room and OU
This commit is contained in:
@@ -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.'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user