Unify Windows client bootstrap and discover network paths
This commit is contained in:
@@ -42,24 +42,34 @@ Describe 'SGU Windows client enrollment scripts' {
|
||||
$enrollmentTestSource | Should Not Match '\$standardLocalUser\.PasswordNeverExpires'
|
||||
}
|
||||
|
||||
It 'publishes separate legacy Windows 10 and modern Windows 11 artifacts' {
|
||||
$packageSource = Get-Content -LiteralPath $packageScriptPath -Raw
|
||||
$releaseSource = Get-Content -LiteralPath $releaseScriptPath -Raw
|
||||
$packageSource | Should Match 'sgu-windows10-legacy-client-bootstrap-\$Version'
|
||||
$packageSource | Should Match 'sgu-windows11-client-bootstrap-\$Version'
|
||||
$packageSource | Should Match '-CompatibilityProfile Windows10Legacy'
|
||||
$packageSource | Should Match '-CompatibilityProfile Windows11Modern'
|
||||
$releaseSource | Should Match 'sgu-windows10-legacy-client-bootstrap-\$Version\.zip'
|
||||
$releaseSource | Should Match 'sgu-windows11-client-bootstrap-\$Version\.zip'
|
||||
It 'preserves existing local credentials when enrollment is repeated under domain password policies' {
|
||||
$updates = $scriptAst.FindAll({
|
||||
param($node)
|
||||
$node -is [Management.Automation.Language.CommandAst] -and $node.GetCommandName() -eq 'Set-LocalUser'
|
||||
}, $true)
|
||||
$updates.Count | Should Be 1
|
||||
@($updates[0].CommandElements | Where-Object {
|
||||
$_ -is [Management.Automation.Language.CommandParameterAst] -and $_.ParameterName -eq 'Password'
|
||||
}).Count | Should Be 0
|
||||
}
|
||||
|
||||
It 'keeps Azure P2S in the modern Windows 11 artifact' {
|
||||
It 'publishes one Windows artifact with automatic compatibility' {
|
||||
$packageSource = Get-Content -LiteralPath $packageScriptPath -Raw
|
||||
$releaseSource = Get-Content -LiteralPath $releaseScriptPath -Raw
|
||||
$packageSource | Should Match 'sgu-windows-client-bootstrap-\$Version'
|
||||
$packageSource | Should Match '-CompatibilityProfile Auto'
|
||||
$packageSource | Should Not Match 'sgu-windows10-legacy|sgu-windows11-client'
|
||||
$releaseSource | Should Match 'sgu-windows-client-bootstrap-\$Version\.zip'
|
||||
$releaseSource | Should Not Match 'sgu-windows10-legacy|sgu-windows11-client'
|
||||
}
|
||||
|
||||
It 'includes Azure P2S in the shared Windows artifact' {
|
||||
$packageSource = Get-Content -LiteralPath $packageScriptPath -Raw
|
||||
$azureLauncher = Get-Content -LiteralPath $azureLauncherPath -Raw
|
||||
$packageSource.Contains("Join-Path `$windows11ClientRoot 'Start-SguAzureClientEnrollment.cmd'") |
|
||||
$packageSource.Contains("Join-Path `$clientRoot 'Start-SguAzureClientEnrollment.cmd'") |
|
||||
Should Be $true
|
||||
$packageSource.Contains("Join-Path `$clientRoot 'Install-SguAzureP2sClient.ps1'") |
|
||||
Should Be $true
|
||||
$packageSource.Contains("Join-Path `$windows10ClientRoot 'Start-SguAzureClientEnrollment.cmd'") |
|
||||
Should Be $false
|
||||
$azureLauncher | Should Match '-PauseOnError'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user