Skip to content

Add opt-in virtual machine driver package support - #1

Merged
vartaxe merged 4 commits into
masterfrom
copilot/is-it-true-debug-mode
Aug 31, 2026
Merged

vartaxe merged 4 commits into
masterfrom
copilot/is-it-true-debug-mode

Conversation

Copilot AI commented Aug 31, 2026

Copy link
Copy Markdown

ModernDriverManagement previously rejected virtual machines outside DebugMode, preventing normal package download and application. The change adds safe, explicit VM support while preserving existing physical-device defaults and keeping catalog acquisition/package creation outside this repository.

  • VM execution

    • Add -AllowVirtualMachine for BareMetal, OSUpgrade, DriverUpdate, PreCache, XMLPackage, and Debug modes.
    • Detect and log supported VM platforms.
    • Keep DebugMode detection-only.
  • Safe package matching

    • Restrict VM and fallback selection to packages explicitly labelled for virtual hardware.
    • Prevent physical OEM packages from being selected on VMs.
    • Centralize VM platform identifiers and package-matching rules.
  • Scope documentation

    • Document that OEM catalog providers, validation, package generation, Microsoft Update/WSUS, and approved SDIO imports belong in DriverAutomationTool or a controlled content-management process.
    • Define separate OEM, component, WinPE, and offline/recovery package profiles.
.\Invoke-CMApplyDriverPackage.ps1 `
    -BareMetal `
    -AllowVirtualMachine `
    -Endpoint 'CM01.domain.com' `
    -TargetOSName 'Windows 11' `
    -TargetOSVersion '25H2'

Copilot AI and others added 4 commits August 31, 2026 15:40
Co-authored-by: vartaxe <11176349+vartaxe@users.noreply.github.com>
Co-authored-by: vartaxe <11176349+vartaxe@users.noreply.github.com>
Co-authored-by: vartaxe <11176349+vartaxe@users.noreply.github.com>
Co-authored-by: vartaxe <11176349+vartaxe@users.noreply.github.com>
@vartaxe
vartaxe marked this pull request as ready for review August 31, 2026 17:11
Copilot AI lite review requested due to automatic review settings August 31, 2026 17:11
@vartaxe
vartaxe merged commit 716ec2b into master Aug 31, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

There are correctness and clarity issues in the VM support implementation (notably detection/matching inconsistencies and misleading debug logging) that should be resolved before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds opt-in virtual-machine (VM) support to ModernDriverManagement while preserving the existing default behavior of refusing to run on VMs unless explicitly allowed, and documents scope boundaries around catalog acquisition/package creation.

Changes:

  • Added -AllowVirtualMachine switch across deployment modes and implemented VM detection + logging.
  • Enforced VM-safe package selection by filtering to packages explicitly labeled for virtual hardware (including fallback matching).
  • Expanded README scope documentation to clarify content-management responsibilities and VM behavior.
File summaries
File Description
README.md Documents scope boundaries and clarifies opt-in VM behavior and DebugMode limitations.
Invoke-CMApplyDriverPackage.ps1 Adds -AllowVirtualMachine, VM detection state, and VM-only package filtering rules for primary and fallback package selection.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

- Switched exact comparisons (OS name, architecture, OS version, computer model) from -like to -eq to avoid wildcard misinterpretation of values containing bracket characters
4.2.8 - (2026-08-05) - Documented the Get-ComputerData default branch with a placeholder/template describing how to add support for custom/unlisted manufacturers (WMI/CIM property sources, the Manufacturer-match requirement in Confirm-DriverPackage, and the -Manufacturer debug ValidateSet).
- Logging improvements for troubleshooting: Invoke-Executable launch failures are now written to the log file (Severity 3) instead of only Write-Warning, and return -1 rather than silently continuing; Get-ComputerData wraps manufacturer detection in try/catch that logs the manufacturer context on failure and degrades gracefully; the unlisted-manufacturer default branch now logs a warning; and a script version + key parameter banner is written at startup.
4.2.9 - (2026-08-31) - Added opt-in virtual-machine support with explicit virtual-package matching. DebugMode remains detection-only.
Comment on lines +378 to +379
$Script:VirtualMachineModels = @("Virtual Machine", "VMware Virtual Platform", "VirtualBox", "HVM domU", "KVM", "VMware7,1")
$Script:VirtualMachinePackagePattern = "\b(virtual machine|vmware|vmxnet|pvscsi|hyper[- ]?v|parallels|virtualbox|virtio|kvm|xen)\b"
Comment on lines +1366 to 1371
if ($AllowVirtualMachine) {
Write-CMLogEntry -Value " - Virtual machine platform detected: '$($ComputerSystemType)'. Execution explicitly allowed by -AllowVirtualMachine; only virtual-machine driver packages will be eligible" -Severity 2
}
elseif ($Script:PSCmdlet.ParameterSetName -like "Debug") {
Write-CMLogEntry -Value " - Virtual machine platform detected: '$($ComputerSystemType)'. DebugMode permits detection only; package download and installation remain disabled" -Severity 2
}
@vartaxe

vartaxe commented Aug 31, 2026

Copy link
Copy Markdown
Owner

@copilot Fix the code for all comments in this review thread.

When a review comment includes a suggested change, apply the suggestion exactly.

Do not make changes beyond what is described in the linked review thread.

@vartaxe
vartaxe deleted the copilot/is-it-true-debug-mode branch September 12, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants