forked from vipmike007/whql_powershell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLibrary_WHQL_ENV_Parsing.ps1
79 lines (69 loc) · 2.03 KB
/
Library_WHQL_ENV_Parsing.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
##/***************************************
## Copyright (c) All rights reserved
##
## File: Library_WHQL_ENV_Parsing.ps1
##
## Authors (s)
##
## Mike Cao <[email protected]>
##
## File name:
## Library_WHQL_ENV_Parsing.ps1
##
## This file is used parsing XML File
##
## This work is licensed under the terms of the GNU GPL,Version 2.
##
##****************************************/
function global:GetXMLValues
{
$global:XML = [XML](GetXML "WHQL_env.xml")
$global:ControllerName = GetValue $XML "Controller"
$global:Driver = GetValue $XML "Driver"
$global:Driver_Version = GetValue $XML "Driver_Version"
$global:ProjectName = "virtio-win-prewhql-"+$Driver_Version+"-"+$Driver
$global:OSPlatform = GetValue $XML "OSPlatform"
$global:GroupName = GetValue $XML "GroupName"
$global:SavePath = GetValue $XML "SavePath"
Write-host $Controllername is $ProjectName
Write-host in private:Test $Controllername is $ProjectName
Write-host in groupname is $GroupName
}
function GetKitValues
{
#Debug Line
#$Controllername = "unused"
#connect to the controller
$global:Manager = ConnectDataBaseManager $Controllername
$global:RootPool = GetRootMachinePool $Manager
$global:DefaultPool = GetDefaultMachinePool $RootPool
}
function local:GetXML($XML_Name)
{
get-content $XML_Name
}
##Get Values
function local:GetValue ($XML_Name, $Name)
{
Isnull $XML_Name.Config.$Name
return $XML_Name.Config.$Name
}
## check whether the value if null
function local:Isnull ($Parameter)
{
if ($Parameter -eq $null -OR $Parameter -eq "")
{
Write-Host :the value of $Name parameter is null ,pls add it in configuration file
exit
}
}
function private:Test
{
$XML = [XML](GetXML "WHQL_env.xml")
# Write-host aaaa $XML.Config.Driver
$ControllerName = GetValue $XML "Controller"
$Driver = GetValue $XML "Driver"
$Driver_version = GetValue $XML "Driver_version"
$projectname = "virtio-win-prewhql-"+$Driver_version+"-"+$Driver
Write-host $Controllername is $projectname
}