-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgentags.ps1
More file actions
26 lines (24 loc) · 834 Bytes
/
gentags.ps1
File metadata and controls
26 lines (24 loc) · 834 Bytes
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
Function Parse-Tags {
param(
[string]$drivername
)
Get-ChildItem ("./src/" + $drivername) | Foreach-Object {
$file = $_.Name
Get-Content $_.FullName | ForEach {
if ($_.Contains("TAG") -And $_.Contains("#define")) {
$vals = $_.Split(' ', 3)
$name = $vals[1].Trim()
$tags = $vals[2].Trim().Trim("'").PadRight(4)
Write-Host "TAG:" $name "=" $tags
$driver = ($drivername + ".sys").PadRight(16)
($tags + " - " + $driver + " - XEN " + $drivername + "\" + $file + " " + $name) | Add-Content "./pooltag.txt"
}
}
}
}
if (Test-Path "./pooltag.txt") {
Remove-Item "./pooltag.txt"
}
Get-ChildItem "./src" | ?{$_.PSIsContainer} | ForEach-Object {
Parse-Tags $_.Name
}