forked from LeDragoX/Win-Debloat-Tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-drivers-updaters.ps1
63 lines (53 loc) · 2.73 KB
/
install-drivers-updaters.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"get-os-info.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"show-message-box.psm1"
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
function Install-DriversUpdaters() {
$Ask = "Do you plan to play games on this PC?
All the following Driver Updaters will be installed:
- $CPU driver updater (if found)
- $GPU driver updater (if found)"
switch (Show-Question -Title "Warning" -Message $Ask) {
'Yes' {
# Check for CPU drivers
If ($CPU.contains("AMD")) {
Write-Section -Text "Installing AMD $CPU chipset drivers updaters!"
Write-Warning "Search for $CPU chipset driver on the AMD website."
Write-Warning "This will only download an updater if AMD makes one."
}
ElseIf ($CPU.contains("Intel")) {
Write-Section -Text "Installing Intel $CPU chipset drivers updaters!"
Write-Caption -Text "Installing: intel-dsa"
winget install --silent --source "winget" --id "Intel.IntelDriverAndSupportAssistant" | Out-Host # Intel® Driver & Support Assistant (Intel® DSA)
}
# Check for GPU drivers then
If ($GPU.contains("AMD") -or $GPU.contains("Radeon")) {
Write-Title -Text "AMD $GPU GPU, you will have to install Manually!"
Write-Warning "Search for $GPU Graphics driver on the AMD website."
Write-Warning "This will only download an updater if AMD makes one."
}
If ($GPU.contains("Intel")) {
Write-Section -Text "Intel $GPU Graphics driver updater already included!"
Write-Caption -Text "Installing: intel-dsa"
winget install --silent --source "winget" --id "Intel.IntelDriverAndSupportAssistant" | Out-Host # Intel® Driver & Support Assistant (Intel® DSA)
}
If ($GPU.contains("NVIDIA")) {
Write-Section -Text "NVIDIA $GPU Graphics driver updater!"
Write-Caption -Text "Installing: Nvidia.GeForceExperience"
winget install --silent --source "winget" --id "Nvidia.GeForceExperience" | Out-Host # GeForce Experience (latest)
}
}
'No' {
Write-Host "You choose No. (No = Cancel)"
}
'Cancel' {
# With Yes, No and Cancel, the user can press Esc to exit
Write-Host "You choose Cancel. (Cancel = No)"
}
}
}
function Main() {
$CPU = Get-CPU # Detects the current CPU
$GPU = Get-GPU # Detects the current GPU
Install-DriversUpdaters # Install CPU & GPU Drivers (If applicable)
}
Main