Skip to content

Commit 181986c

Browse files
committed
Added extra checks for Windows version
1 parent 91dfd4a commit 181986c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

internal/scripts/preimport.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@ $osDetails = Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Desc
1818

1919
# Check which version of windows we're dealing with
2020
if ($osDetails.Caption -notin $supportedVersions ) {
21-
if ($osDetails.Caption -like '*Windows 10*') {
21+
if($osDetails.Caption -like '*Windows 7*'){
22+
Stop-PSFFunction -Message "Module can not work on Windows 7" -Target $OSDetails -FunctionName 'Pre Import'
23+
}
24+
elseif ($osDetails.Caption -like '*Windows 10*') {
2225
Stop-PSFFunction -Message "Module can only work on Windows 10 Pro, Enterprise or Education" -Target $OSDetails -FunctionName 'Pre Import'
2326
}
2427
elseif ($osDetails.Caption -like '*Windows Server*') {
2528
Stop-PSFFunction -Message "Module can only work on Windows Server 2012 R2 and up, Enterprise or Education" -Target $OSDetails -FunctionName 'Pre Import'
2629
}
30+
else{
31+
Stop-PSFFunction -Message "Unsupported version of Windows." -Target $OSDetails -FunctionName 'Pre Import'
32+
}
2733
}
2834

2935

0 commit comments

Comments
 (0)