mirror of
https://github.com/SpotX-Official/SpotX.git
synced 2026-04-23 03:20:20 +10:00
10
Install.ps1
10
Install.ps1
@@ -254,11 +254,15 @@ $start_menu = "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Spotify.lnk"
|
|||||||
$upgrade_client = $false
|
$upgrade_client = $false
|
||||||
|
|
||||||
# Check version Windows
|
# Check version Windows
|
||||||
$os = Get-CimInstance -ClassName Win32_OperatingSystem
|
$os = Get-CimInstance -ClassName "Win32_OperatingSystem" -ErrorAction SilentlyContinue
|
||||||
$osCaption = $os.Caption
|
if ($os) {
|
||||||
|
$osCaption = $os.Caption
|
||||||
|
} else {
|
||||||
|
$osCaption = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ProductName).ProductName
|
||||||
|
}
|
||||||
$pattern = "\bWindows (7|8(\.1)?|10|11|12)\b"
|
$pattern = "\bWindows (7|8(\.1)?|10|11|12)\b"
|
||||||
$reg = [regex]::Matches($osCaption, $pattern)
|
$reg = [regex]::Matches($osCaption, $pattern)
|
||||||
$win_os = $reg.value
|
$win_os = $reg.Value
|
||||||
|
|
||||||
$win12 = $win_os -match "\windows 12\b"
|
$win12 = $win_os -match "\windows 12\b"
|
||||||
$win11 = $win_os -match "\windows 11\b"
|
$win11 = $win_os -match "\windows 11\b"
|
||||||
|
|||||||
Reference in New Issue
Block a user