Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Install-NvidiaApp.ps1

This script automates the detection of an NVIDIA GPU, retrieves the latest NVIDIA App installer (either Enterprise or Public edition), and facilitates its download and installation with customizable parameters.

Usage

.\Install-NvidiaApp.ps1 [options]

Options

  • -Verbose: Enables verbose logging for detailed output.
  • -DryRun: Executes the script in a dry run mode to check and extract information without downloading or installing the package.
  • -Force: Forces the installation of the NVIDIA App even if the same version is already installed or if no NVIDIA GPU is detected. Note that the NVIDIA App installer has an internal check for the GPU, so if it's not recognized, the NVIDIA App will not be installed.
  • -Edition: Specifies the edition of the NVIDIA App to install. Valid values are "Enterprise" and "Public". Default is "Public".

Running the Script from the Internet:

Use Invoke-RestMethod to download and execute the script. Here is how you can do it:

# Using Invoke-RestMethod
irm https://github.com/emilwojcik93/Install-NvidiaApp/releases/latest/download/Install-NvidiaApp.ps1 | iex

Note

If it doesn't work, then try to Set-ExecutionPolicy via PowerShell (Admin)

Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force; irm https://github.com/emilwojcik93/Install-NvidiaApp/releases/latest/download/Install-NvidiaApp.ps1 | iex

Note

To execute the script from the Internet with additional parameters, please run

&([ScriptBlock]::Create((irm https://github.com/emilwojcik93/Install-NvidiaApp/releases/latest/download/Install-NvidiaApp.ps1))) -DryRun

Fetching Properties from Remote Endpoints

You can fetch properties from the script execution by storing the output in a variable. Here is an example:

$nvidaParams = &([ScriptBlock]::Create((irm https://github.com/emilwojcik93/Install-NvidiaApp/releases/latest/download/Install-NvidiaApp.ps1))) -DryRun -Force
$nvidaParams.URL

Hiding Warning Messages

To hide warning messages during script execution, you can redirect the warning stream to $null. Here is an example:

$nvidaParams = (&([ScriptBlock]::Create((irm https://github.com/emilwojcik93/Install-NvidiaApp/releases/latest/download/Install-NvidiaApp.ps1))) -DryRun -Force) 3>$null

Listing All Properties

You can list all available properties from the script execution by accessing the properties of the output object. Here are examples:

$nvidaParams = (&([ScriptBlock]::Create((irm https://github.com/emilwojcik93/Install-NvidiaApp/releases/latest/download/Install-NvidiaApp.ps1))) -DryRun -Force) 3>$null
$nvidaParams.GPUModel
$nvidaParams.URL
$nvidaParams.Filename
$nvidaParams.SizeOfPackage
$nvidaParams.Version
$nvidaParams.InstallCommand

You can also list all properties at once using Select-Object and wildcard:

$nvidaParams = (&([ScriptBlock]::Create((irm https://github.com/emilwojcik93/Install-NvidiaApp/releases/latest/download/Install-NvidiaApp.ps1))) -DryRun -Force) 3>$null
$nvidaParams | Format-List *

Available Properties

  • GPUModel: The model of the detected NVIDIA GPU.
  • URL: The download link for the NVIDIA App installer.
  • Filename: The name of the installer file.
  • SizeOfPackage: The size of the installer package.
  • Version: The version of the NVIDIA App.
  • InstallCommand: The command used to install the NVIDIA App.

Example of execution

PS > &([ScriptBlock]::Create((irm https://github.com/emilwojcik93/Install-NvidiaApp/releases/latest/download/Install-NvidiaApp.ps1))) -DryRun
Dry run mode: Skipping download and installation.
GPU Model: NVIDIA GeForce MX450
URL: https://us.download.nvidia.com/nvapp/client/11.0.2.341/NVIDIA_app_v11.0.2.341.exe
Filename: NVIDIA_app_v11.0.2.341.exe
Size of package: 155022288 bytes (147.84 MiB)
Version: 11.0.2.341
Install command: Start-Process -FilePath "C:\Users\6125750\AppData\Local\Temp\NVIDIA_app_v11.0.2.341.exe" -ArgumentList "-s -noreboot -noeula -nofinish -nosplash" -Wait

About

This PowerShell script detects an NVIDIA GPU, retrieves the latest NVIDIA App installer (Enterprise or Public edition), and facilitates its download and installation with customizable parameters. It supports a dry run mode, verifies GPU presence, and allows forced installation even if no GPU is detected or the same version is already installed.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages