forked from edk2-porting/WOA-Drivers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extract.ps1
40 lines (39 loc) · 1020 Bytes
/
extract.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
Param([Parameter(Mandatory=$true)][String]$CodeName)
Set-Location -Path (Split-Path -Parent $MyInvocation.MyCommand.Definition)
$Configs="definitions"
$DefConfig="sdm845-generic"
$Config=Join-Path `
-Path $Configs `
-ChildPath (-Join ($CodeName,".txt"))
If( -Not (Test-Path -Path $Config)){
Write-Output "ERROR: your model has no definition file, please check"
exit 1
}
If(Test-Path -Path output){
Remove-Item `
-Recurse `
-Force `
-Path output
}
Write-Output "copying drivers..."
$Output=New-Item `
-ItemType Directory `
-Path output
Get-Content `
-Path $Config | `
Copy-Item `
-Force `
-Recurse `
-Path { "."+$_ } `
-Destination $Output
Write-Output "rename drivers..."
Get-ChildItem `
-Recurse `
-Path $Output `
-Filter *.inf_ | `
Rename-Item `
-NewName { `
$_.FullName `
-Replace '\.inf_','.inf' `
}
Write-Output "done"