Skip to main content
The Virtual Display Driver includes a collection of PowerShell scripts that provide command-line automation for driver management and display configuration. These scripts are designed for advanced users who need scripting capabilities or automated workflows.

Overview

The Community Scripts collection offers PowerShell-based tools for:
  • Installing and managing the driver
  • Changing display settings on-the-fly
  • Toggling between display modes
  • Automating resolution and refresh rate changes
  • Enabling/disabling HDR
These scripts require administrator privileges and should be used by users comfortable with PowerShell. Always review scripts before execution.

Prerequisites

PowerShell Modules

Many scripts depend on external PowerShell modules:
  • DisplayConfig (v1.1.1) - Display configuration management
  • MonitorConfig (v1.0.3) - Monitor settings control
The set-dependencies.ps1 script automatically installs these modules from the PowerShell Gallery.

Installing Dependencies

Run the dependency installer before using most scripts:
.\set-dependencies.ps1
Or use the batch file for a more user-friendly experience:
modules_install.bat
This opens an elevated PowerShell session and installs required modules automatically.

Core Management Scripts

virtual-driver-manager.ps1

The comprehensive all-in-one management tool. This script handles the full driver lifecycle with automatic DevCon resolution and self-elevation.
# Interactive menu (prompts for action)
.\virtual-driver-manager.ps1

# Install the latest driver
.\virtual-driver-manager.ps1 -Action install

# Uninstall and close automatically
.\virtual-driver-manager.ps1 -Action uninstall -Silent

# Check driver status with JSON output
.\virtual-driver-manager.ps1 -Action status -Json

# Enable the driver
.\virtual-driver-manager.ps1 -Action enable

# Disable the driver
.\virtual-driver-manager.ps1 -Action disable

# Toggle driver state
.\virtual-driver-manager.ps1 -Action toggle
Use the -Silent flag in automation scenarios to prevent the script from pausing for user input.
See the full reference for all parameters and capabilities.

toggle-VDD.ps1

Quick enable/disable toggle. A lightweight script that enables or disables the Virtual Display Driver device.
.\toggle-VDD.ps1
  • Auto-elevates to administrator
  • Detects current driver state (enabled/disabled)
  • Toggles to opposite state
  • No parameters required

silent-install.ps1

Automated silent installation. Fetches the latest driver from GitHub and installs it silently using NefCon.
.\silent-install.ps1
This script:
  1. Downloads NefCon installer utility
  2. Downloads the latest VDD release
  3. Extracts and installs driver certificates
  4. Silently installs the driver
  5. Cleans up temporary files
You can customize the driver version by editing the $DriverURL parameter in the script.

Display Configuration Scripts

changeres-VDD.ps1

Change virtual display resolution. Hot-swaps the resolution of the virtual display.
# Change to 1920x1080
.\changeres-VDD.ps1 -xres 1920 -yres 1080

# Alternative parameter names
.\changeres-VDD.ps1 -X 2560 -Y 1440
.\changeres-VDD.ps1 -HorizontalResolution 3840 -VerticalResolution 2160
Parameters:
  • -xres, -X, -HorizontalResolution: Width in pixels
  • -yres, -Y, -VerticalResolution: Height in pixels
See changeres reference for details.

refreshrate-VDD.ps1

Change refresh rate. Sets the virtual display’s refresh rate to a validated value.
# Set to 144 Hz
.\refreshrate-VDD.ps1 -refreshrate 144
Valid refresh rates: 30, 60, 75, 90, 120, 144, 165, 240, 480, 500 Hz

rotate-VDD.ps1

Rotate display orientation. Rotates the virtual display to a specified angle.
# Rotate 90 degrees
.\rotate-VDD.ps1 -rotate 90

# Rotate 180 degrees
.\rotate-VDD.ps1 -rotate 180

# Rotate 270 degrees
.\rotate-VDD.ps1 -rotate 270
Valid angles: 90, 180, 270

scale-VDD.ps1

Adjust DPI scaling. Sets or resets the DPI scaling percentage for the virtual monitor.
# Set 150% scaling
.\scale-VDD.ps1 -scale 150

# Reset to recommended scaling
.\scale-VDD.ps1 -reset
Valid scale values: 100, 125, 150, 175, 200, 225, 250, 300, 350, 400, 450, 500 (%)
The script automatically validates that your chosen scale doesn’t exceed the display’s maximum supported scale.

primary-VDD.ps1

Set as primary display. Makes the virtual display the Windows primary display.
.\primary-VDD.ps1
Useful for:
  • Headless server setups
  • Remote desktop scenarios
  • Streaming configurations
See primary-display reference for details.

Display Mode Scripts

HDRswitch-VDD.ps1

Toggle HDR mode. Switches between SDR (8-bit) and HDR (10-bit) color modes.
.\HDRswitch-VDD.ps1
  • Automatically detects current color depth
  • Switches from 8-bit to 10-bit (HDR) or vice versa
  • Requires Windows 11 23H2+ for HDR support
This script may not work with the latest DisplayConfig module versions. Verify compatibility or check the script source for updates.
See hdr-switch reference for details.

winp-VDD.ps1

Toggle display projection mode. Switches Windows between Extend and Clone modes without touching the driver state.
.\winp-VDD.ps1
  • Detects current mode (Extend or Clone)
  • Toggles to opposite mode
  • Useful for presentation scenarios
  • Leaves virtual display enabled

Utility Scripts

get_disp_num.ps1

Get display adapter ID. Returns the numeric adapter ID for the VDD screen by scanning WMI for the custom monitor identifier.
.\get_disp_num.ps1
Outputs the display ID, which can be used in other scripts or tools.

set-dependencies.ps1

Install required PowerShell modules. Ensures DisplayConfig and MonitorConfig modules are installed and imported.
.\set-dependencies.ps1
This script:
  • Checks if PSGallery repository is available
  • Sets it as trusted
  • Installs DisplayConfig v1.1.1
  • Installs MonitorConfig v1.0.3
  • Imports both modules
  • Saves modules for offline use

Usage Best Practices

Self-Elevation

Most scripts automatically request administrator privileges if not already running elevated. You’ll see a UAC prompt when needed.

Automation and Scripting

For unattended automation:
# Use -Silent to suppress pause prompts
powershell.exe -ExecutionPolicy Bypass -File .\virtual-driver-manager.ps1 -Action install -Silent

# Use -Json for machine-readable output
powershell.exe -ExecutionPolicy Bypass -File .\virtual-driver-manager.ps1 -Action status -Json

Error Handling

Scripts exit with appropriate codes:
  • 0 = Success
  • 1 = Error or failure
Capture exit codes in your automation:
powershell.exe -File script.ps1
if %ERRORLEVEL% NEQ 0 (
    echo Script failed
)

Script Location

All community scripts are available in the GitHub repository:
https://github.com/VirtualDrivers/Virtual-Display-Driver/tree/master/Community%20Scripts
Download individual scripts or clone the entire repository to access them.

Customization

All scripts are open source and can be modified to fit your needs:
  • Edit resolution lists
  • Change default parameters
  • Add custom validation
  • Integrate with other tools
Contributions and improvements are welcome! Submit pull requests to the GitHub repository.

Troubleshooting

Execution Policy Errors

If PowerShell blocks script execution:
# Bypass execution policy for a single script
powershell.exe -ExecutionPolicy Bypass -File .\script.ps1

# Or set policy permanently (requires admin)
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

Module Import Failures

If modules fail to import:
  1. Run set-dependencies.ps1 to reinstall
  2. Check internet connectivity (modules download from PSGallery)
  3. Manually install modules:
Install-Module -Name DisplayConfig -RequiredVersion 1.1.1 -Force
Install-Module -Name MonitorConfig -RequiredVersion 1.0.3 -Force

Device Not Found

If scripts report “Device not found”:
  • Ensure the driver is installed
  • Verify the device name matches (“Virtual Display Driver” or “IddSampleDriver Device HDR”)
  • Check Device Manager for any error states

Next Steps

Script Reference

Detailed reference for each PowerShell script

Manual Configuration

Manage the driver through Device Manager

Settings Overview

Configure driver behavior via XML files

Common Issues

Troubleshoot installation and runtime problems

Build docs developers (and LLMs) love