0% found this document useful (0 votes)
290 views1 page

copyDriverFiles v1.3

Uploaded by

nico.matiu.2013
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
290 views1 page

copyDriverFiles v1.3

Uploaded by

nico.matiu.2013
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

$vm = "Nombre-MV"

$systemPath = "C:\Windows\System32\"
$driverPath = "C:\Windows\System32\DriverStore\FileRepository\"

# check if script is admin


$currentPrincipal = New-Object
Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurren
t())
if( $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrat
or) ) {

# do we need guest vm privs? enable it


Get-VM -Name $vm | Get-VMIntegrationService | ? {-not($_.Enabled)} | Enable-
VMIntegrationService -Verbose

# aggregate and copy files to driverstore


$localDriverFolder = ""
Get-ChildItem $driverPath -recurse | Where-Object {$_.PSIsContainer -eq $true -
and $_.Name -match "nv_dispi.inf_amd64_*"} | Sort-Object -Descending -Property
LastWriteTime | select -First 1 |
ForEach-Object {
if ($localDriverFolder -eq "") {
$localDriverFolder = $_.Name
}
}

Write-Host $localDriverFolder

Get-ChildItem $driverPath$localDriverFolder -recurse | Where-Object


{$_.PSIsContainer -eq $false} |
Foreach-Object {
$sourcePath = $_.FullName
$destinationPath = $sourcePath -replace "^C\:\\Windows\\System32\\
DriverStore\\","C:\Temp\System32\HostDriverStore\"
Copy-VMFile $vm -SourcePath $sourcePath -DestinationPath $destinationPath -
Force -CreateFullPath -FileSource Host
}

# get all files related to NV*.* in system32


Get-ChildItem $systemPath | Where-Object {$_.Name -like "NV*"} |
ForEach-Object {
$sourcePath = $_.FullName
$destinationPath = $sourcePath -replace "^C\:\\Windows\\System32\\","C:\
Temp\System32\"
Copy-VMFile $vm -SourcePath $sourcePath -DestinationPath $destinationPath -
Force -CreateFullPath -FileSource Host
}

Write-Host "Success! Please go to C:\Temp and copy the files where they are
expected within the VM."

} else {
Write-Host "This PowerShell Script must be run with Administrative Privileges
or nothing will work."
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy