@@ -6,44 +6,58 @@ if (-not (Get-Module -Name Pester -ListAvailable)) {
66Describe " DeployWorkstation Prerequisites" {
77 Context " System Requirements" {
88 It " Should be running on Windows 10 or 11" {
9+ if (-not $IsWindows ) {
10+ Set-ItResult - Skipped - Because " Windows-only deployment validation"
11+ return
12+ }
13+
914 $osVersion = [System.Environment ]::OSVersion.Version
1015 $osVersion.Major | Should - BeGreaterOrEqual 10
1116 }
12-
17+
1318 It " Should have PowerShell 5.1 or later" {
1419 $PSVersionTable.PSVersion.Major | Should - BeGreaterOrEqual 5
1520 }
16-
21+
1722 It " Should have internet connectivity" {
23+ if (-not $IsWindows ) {
24+ Set-ItResult - Skipped - Because " Windows-only deployment validation"
25+ return
26+ }
27+
1828 Test-NetConnection - ComputerName " 8.8.8.8" - Port 53 - InformationLevel Quiet | Should - Be $true
1929 }
2030 }
21-
31+
2232 Context " File Structure" {
2333 It " Should have main script file" {
2434 Test-Path " .\DeployWorkstation.ps1" | Should - Be $true
2535 }
26-
36+
2737 It " Should have launcher script" {
38+ Test-Path " .\DeployWorkstation.bat" | Should - Be $true
39+ }
40+
41+ It " Should have compatibility launcher script" {
2842 Test-Path " .\DeployWorkstation.cmd" | Should - Be $true
2943 }
30-
44+
3145 It " Should have configuration directory" {
32- Test-Path " .\Config " | Should - Be $true
46+ Test-Path " .\config " | Should - Be $true
3347 }
3448 }
3549}
3650
3751Describe " Configuration Validation" {
3852 Context " JSON Configuration Files" {
39- $configFiles = Get-ChildItem " .\Config \Examples\*.json" - ErrorAction SilentlyContinue
40-
53+ $configFiles = Get-ChildItem " .\config \Examples\*.json" - ErrorAction SilentlyContinue
54+
4155 foreach ($file in $configFiles ) {
4256 It " Should have valid JSON format: $ ( $file.Name ) " {
4357 { Get-Content $file.FullName | ConvertFrom-Json } | Should -Not - Throw
4458 }
4559 }
46-
60+
4761 It " Should have at least one example configuration" {
4862 $configFiles.Count | Should - BeGreaterThan 0
4963 }
@@ -53,10 +67,20 @@ Describe "Configuration Validation" {
5367Describe " WinGet Availability" {
5468 Context " Package Manager" {
5569 It " Should have WinGet available" {
70+ if (-not $IsWindows ) {
71+ Set-ItResult - Skipped - Because " Windows-only deployment validation"
72+ return
73+ }
74+
5675 { winget -- version } | Should -Not - Throw
5776 }
58-
77+
5978 It " Should be able to search for packages" {
79+ if (-not $IsWindows ) {
80+ Set-ItResult - Skipped - Because " Windows-only deployment validation"
81+ return
82+ }
83+
6084 $result = winget search " Google.Chrome" -- exact
6185 $result | Should -Not - BeNullOrEmpty
6286 }
0 commit comments