-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgfx_install.psm1
577 lines (437 loc) · 17.2 KB
/
gfx_install.psm1
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
function gfx_install ([string]$para1,[string]$para2,[string]$para3,[string]$para4){
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force;
$wshell=New-Object -ComObject wscript.shell
$shell=New-Object -ComObject shell.application
Add-Type -AssemblyName Microsoft.VisualBasic
Add-Type -AssemblyName System.Windows.Forms,System.Drawing
#region functions
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public class Window {
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
}
public class Win32 {
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
}
public struct RECT {
public int Left;
public int Top;
public int Right;
public int Bottom;
}
"@
$cSource = @'
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
public class Clicker
{
//https://msdn.microsoft.com/en-us/library/windows/desktop/ms646270(v=vs.85).aspx
[StructLayout(LayoutKind.Sequential)]
struct INPUT
{
public int type; // 0 = INPUT_MOUSE,
// 1 = INPUT_KEYBOARD
// 2 = INPUT_HARDWARE
public MOUSEINPUT mi;
}
//https://msdn.microsoft.com/en-us/library/windows/desktop/ms646273(v=vs.85).aspx
[StructLayout(LayoutKind.Sequential)]
struct MOUSEINPUT
{
public int dx ;
public int dy ;
public int mouseData ;
public int dwFlags;
public int time;
public IntPtr dwExtraInfo;
}
//This covers most use cases although complex mice may have additional buttons
//There are additional constants you can use for those cases, see the msdn page
const int MOUSEEVENTF_MOVED = 0x0001 ;
const int MOUSEEVENTF_LEFTDOWN = 0x0002 ;
const int MOUSEEVENTF_LEFTUP = 0x0004 ;
const int MOUSEEVENTF_RIGHTDOWN = 0x0008 ;
const int MOUSEEVENTF_RIGHTUP = 0x0010 ;
const int MOUSEEVENTF_MIDDLEDOWN = 0x0020 ;
const int MOUSEEVENTF_MIDDLEUP = 0x0040 ;
const int MOUSEEVENTF_WHEEL = 0x0080 ;
const int MOUSEEVENTF_XDOWN = 0x0100 ;
const int MOUSEEVENTF_XUP = 0x0200 ;
const int MOUSEEVENTF_ABSOLUTE = 0x8000 ;
const int screen_length = 0x10000 ;
//https://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx
[System.Runtime.InteropServices.DllImport("user32.dll")]
extern static uint SendInput(uint nInputs, INPUT[] pInputs, int cbSize);
public static void LeftClickAtPoint(int x, int y)
{
//Move the mouse
INPUT[] input = new INPUT[3];
input[0].mi.dx = x*(65535/System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width);
input[0].mi.dy = y*(65535/System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height);
input[0].mi.dwFlags = MOUSEEVENTF_MOVED | MOUSEEVENTF_ABSOLUTE;
//Left mouse button down
input[1].mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
//Left mouse button up
input[2].mi.dwFlags = MOUSEEVENTF_LEFTUP;
SendInput(3, input, Marshal.SizeOf(input[0]));
}
}
'@
Add-Type -TypeDefinition $cSource -ReferencedAssemblies System.Windows.Forms,System.Drawing
#endregion
if($PSScriptRoot.length -eq 0){
$scriptRoot="C:\testing_AI\modules"
}
else{
$scriptRoot=$PSScriptRoot
}
if($para1.length -eq 0){
$para1="N"
}
if($para2.length -eq 0){
$para2=""
}
if($para3.length -eq 0){
$para3=""
}
$nn1=$para1
$attachedmode=$para2
$actiontype=$para3
$nonlogflag=$para4
$tcpath=(Split-Path -Parent $scriptRoot)+"\currentjob\TC.txt"
$tcnumber=((get-content $tcpath).split(","))[0]
$tcstep=((get-content $tcpath).split(","))[1]
$action=((get-content $tcpath).split(","))[2]
$picpath=(Split-Path -Parent $scriptRoot)+"\logs\$($tcnumber)\"
if(-not(test-path $picpath)){new-item -ItemType directory -path $picpath |out-null}
$actioncp="copyingfiles"
Get-Module -name $actioncp|remove-module
$mdpath=(Get-ChildItem -path $scriptRoot -r -file |Where-object{$_.name -match "^$actioncp\b" -and $_.name -match "psm1"}).fullname
Import-Module $mdpath -WarningAction SilentlyContinue -Global
$actioncmd="cmdline"
Get-Module -name $actioncmd|remove-module
$mdpath=(Get-ChildItem -path $scriptRoot -r -file |Where-object{$_.name -match "^$actioncmd\b" -and $_.name -match "psm1"}).fullname
Import-Module $mdpath -WarningAction SilentlyContinue -Global
$actiondup="dup_install"
Get-Module -name $actiondup|remove-module
$mdpath=(Get-ChildItem -path $scriptRoot -r -file |Where-object{$_.name -match "^$actiondup\b" -and $_.name -match "psm1"}).fullname
Import-Module $mdpath -WarningAction SilentlyContinue -Global
$actionexp="filexplorer"
Get-Module -name $actionexp|remove-module
$mdpath=(Get-ChildItem -path $scriptRoot -r -file |Where-object{$_.name -match "^$actionexp\b" -and $_.name -match "psm1"}).fullname
Import-Module $mdpath -WarningAction SilentlyContinue -Global
$actionamdins="amdinstall"
Get-Module -name $actionamdins|remove-module
$mdpath=(Get-ChildItem -path $scriptRoot -r -file |Where-object{$_.name -match "^$actionamdins\b" -and $_.name -match "psm1"}).fullname
Import-Module $mdpath -WarningAction SilentlyContinue -Global
$actionss="screenshot"
Get-Module -name $actionss|remove-module
$mdpath=(Get-ChildItem -path $scriptRoot -r -file |Where-object{$_.name -match "^$actionss\b" -and $_.name -match "psm1"}).fullname
Import-Module $mdpath -WarningAction SilentlyContinue -Global
$inidrv=(Get-ChildItem "C:\testing_AI\logs\ini*\*" -r -Filter "*DriverVersion.csv"|Sort-Object lastwritetime|Select-Object -last 1).FullName
$checktype=(import-csv $inidrv|Where-object{$_.DeviceClass -match "DISPLAY"}).devicename
if($inidrv -and $checktype){
if($checktype -match "NVIDIA"){
$drvtype2="NV_general"
if($checktype -match "ada"){
$drvtype2="NV_A6000ada"
}
write-host "The Display Driver is $($drvtype2)"
}
if($checktype -match "AMD"){
$chekdrv=$checktype -match "[a-zA-Z]\d{4}"
if(!$chekdrv){$checktype -match "\d{4}"}
$drvtype2="AMD_"+$matches[0]
write-host "The Display Driver is $($drvtype2)"
}
## check if folder exist
$drvfd="$scriptRoot\driver\GFX\$($drvtype2)\$($nn1)"
## if no exist, copy it from server
if(!(test-path $drvfd )){
&$actioncp -para1 "\\192.168.2.249\srvprj\Inventec\Dell\Matagorda\07.Tool\_AutoTool\driver\GFX" -para2 "$scriptRoot\driver" -para3 nolog
}
## after copy
if(test-path $drvfd){
$subf=@("$($drvfd)\")
## start install driver #
if($checktype -match "NVIDIA"){
$subf=@("$($drvfd)\driver","$($drvfd)\app","$($drvfd)\ControlPanel")
}
foreach($insfd in $subf){
$sub=(($insfd.replace($drvfd,"")).replace("\","")).trim()
$timenow=get-date -format "yyMMdd_HHmmss"
$logpath=(Split-Path -Parent $scriptRoot)+"\logs\$($tcnumber)\$($timenow)_step$($tcstep)_DUPinstall.txt"
$logpath_extract=(Split-Path -Parent $scriptRoot)+"\logs\$($tcnumber)\$($timenow)_step$($tcstep)_DUPextract.txt"
$extractpath=(Split-Path -Parent $scriptRoot)+"\logs\$($tcnumber)\$($timenow)_step$($tcstep)_DUPextract\"
$extractfaillog=(Split-Path -Parent $scriptRoot)+"\logs\$($tcnumber)\$($timenow)_step$($tcstep)_DUPextract_fail.txt"
$zipdes=(Split-Path -Parent $scriptRoot)+"\logs\$($tcnumber)\$($timenow)_step$($tcstep)_MUPextract\"
$logpath3=(Split-Path -Parent $scriptRoot)+"\logs\$($tcnumber)\$($timenow)_step$($tcstep)_MUPinstall.txt"
$dupnamepic1="DUP"
$dupnamepic="MUP"
$errorlevelp=(Split-Path -Parent $scriptRoot)+"\logs\$($tcnumber)\$($timenow)_step$($tcstep)_errorlevel_pass.txt"
$errorlevelf=(Split-Path -Parent $scriptRoot)+"\logs\$($tcnumber)\$($timenow)_step$($tcstep)_errorlevel_fail.txt"
$results="OK"
$results_ng="NG"
$index="check data after reboot"
$index_nofile="no DUP(exe) or MUP(zip) files"
if($sub.length -gt 0){
$logpath=(Split-Path -Parent $scriptRoot)+"\logs\$($tcnumber)\$($timenow)_step$($tcstep)_$($sub)_DUPinstall.txt"
$logpath_extract=(Split-Path -Parent $scriptRoot)+"\logs\$($tcnumber)\$($timenow)_step$($tcstep)_$($sub)_DUPextract.txt"
$extractpath=(Split-Path -Parent $scriptRoot)+"\logs\$($tcnumber)\$($timenow)_step$($tcstep)_$($sub)_DUPextract\"
$extractfaillog=(Split-Path -Parent $scriptRoot)+"\logs\$($tcnumber)\$($timenow)_step$($tcstep)_$($sub)_DUPextract_fail.txt"
$zipdes=(Split-Path -Parent $scriptRoot)+"\logs\$($tcnumber)\$($timenow)_step$($tcstep)_$($sub)_MUPextract\"
$logpath3=(Split-Path -Parent $scriptRoot)+"\logs\$($tcnumber)\$($timenow)_step$($tcstep)_$($sub)_MUPinstall.txt"
$dupnamepic1="DUP_$($sub)"
$dupnamepic="MUP_$($sub)"
$results="OK($($sub))"
$results_ng="NG($($sub))"
$index_nofile="$($sub) folder no DUP(exe) or MUP(zip) files"
}
$exefile=Get-ChildItem $insfd\*.exe -ea SilentlyContinue|sort lastwritetime|select -last 1
### DUP ##
if($exefile){
$runfile=$exefile.FullName
$runfilename=$exefile.basename
$runfilename2=$exefile.name
### DUP unattached mode ##
if($attachedmode.length -eq 0){
if($actiontype.Length -eq 0 -or $actiontype -match "extract"){
if(!(test-path $extractpath)){
new-item -ItemType directory -Path $extractpath|out-null
}
&$runfile /s /e=$extractpath /l=$logpath_extract
$exeresult=$?
if($exeresult -eq $true){
set-content -path $errorlevelp -Value "success" -Force
}
else{
set-content -path $errorlevelf -Value "fail" -Force
}
do{
start-sleep -s 5
}until(!(get-process -name $runfilename -ErrorAction SilentlyContinue))
$extractcheck=(Get-ChildItem -path $extractpath -file -Recurse).count
if($extractcheck -gt 0){
&$actionexp -para1 $extractpath -para2 nonlog
$picfile=Get-ChildItem -path $picpath -r |Where-object{$_.Name -match "gfx_install_file_explore.jpg"}|sort lastwritetime|select -Last 1
$picfilename=($picfile.fullname).replace("gfx_install_file_explore.jpg","gfx_extract_file_explore.jpg")
if($sub.length -gt 0){
$picfilename=($picfile.fullname).replace("gfx_install_file_explore.jpg","gfx_$($sub)_extract_file_explore.jpg")
}
Rename-Item ($picfile.fullname) -NewName $picfilename
}
else{
set-content -path $extractfaillog -Value "extract fail, no extract files exists"
}
}
if($actiontype.Length -eq 0 -or $actiontype -match "install"){
$cmdbf=(get-process -name cmd -ea SilentlyContinue).Id
&$runfile /s /l=$logpath
$exeresult=$?
if($exeresult -eq $true){
set-content -path $errorlevelp -Value "success"
}
else{
set-content -path $errorlevelf -Value "fail"
}
start-sleep -s 10
$cmdaf=(get-process -name cmd -ea SilentlyContinue).Id|Where-object{$_ -notin $cmdbf}
if($cmdaf.count -gt 0){
$actionss="screenshot"
Get-Module -name $actionss|remove-module
$mdpath=(Get-ChildItem -path $scriptRoot -r -file |Where-object{$_.name -match "^$actionss\b" -and $_.name -match "psm1"}).fullname
Import-Module $mdpath -WarningAction SilentlyContinue -Global
&$actionss -para3 nonlog -para5 "$($dupnamepic1)_cmdwindow"
stop-process -Id $cmdaf -Force
}
do{
start-sleep -s 5
$checksec=get-process * |Where-object{$_.MainWindowTitle -eq "windows security"}
if($checksec){
write-host "security screen pop up"
&$actionss -para3 nonlog -para5 "popup_securitycheck"
$dll=get-process -name rundll32 -ErrorAction SilentlyContinue
$wintitle=$dll.MainWindowTitle
$windowHandle2 =$dll.MainWindowHandle
$windowRect2 = New-Object RECT
[Win32]::GetWindowRect($windowHandle2, [ref]$windowRect2)
$left2 = $windowRect2.Left
$top2 = $windowRect2.Top
Start-Sleep -s 2
[Clicker]::LeftClickAtPoint($left2+100,$top2+20)
Start-Sleep -s 5
[System.Windows.Forms.SendKeys]::SendWait("+{tab}")
Start-Sleep -s 2
[System.Windows.Forms.SendKeys]::SendWait("{enter}")
Start-Sleep -s 2
}
}until(!(get-process -name $runfilename -ErrorAction SilentlyContinue))
}
}
### DUP attached mode install##
else{
if($actiontype.Length -eq 0 -or $actiontype -match "extract"){
&$actiondup -para1 $runfilename2 -para2 extract -para3 nolog
}
if($actiontype.Length -eq 0 -or $actiontype -match "install"){
&$actiondup -para1 $runfilename2 -para2 install -para3 nolog
}
}
}
#### MUP ##
else{
$zipfile=Get-ChildItem $insfd\*.zip|sort lastwritetime|select -last 1
$zipfilebname=$zipfile.BaseName
if($zipfile){
Expand-Archive $zipfile.FullName -DestinationPath $zipdes -Force
if($actiontype.Length -eq 0 -or $actiontype -match "extract"){
&$actionexp -para1 $zipdes -para2 nonlog
}
#### MUP only support install ##
if($actiontype.Length -eq 0 -or $actiontype -match "install"){
if($checktype -match "AMD"){
$runfiles=(Get-ChildItem -path $zipdes -Recurse |Where-object{$_.name -match "ATISetup\.exe" })
$runfiles_att=((Get-ChildItem -path $zipdes -Recurse |Where-object{$_.name -match "^Setup\.exe"|sort {($_.fullname).length}}|select -First 1).FullName).replace("$zipdes",".\")
$apprunfiles2=((Get-ChildItem -path $zipdes -Recurse |Where-object{$_.name -match "_License"}).FullName).replace("$zipdes",".\")
$apprunfiles1=((Get-ChildItem -path $zipdes -Recurse |Where-object{$_.name -match (($apprunfiles2.split("\\"))[-1].split("_"))[0]+"\.appx" }).FullName ).replace("$zipdes",".\")
$apprunfiles3=((Get-ChildItem -path $zipdes -Recurse |Where-object{$_.name -match "\.appx" -and $_.name -match "x64" }).FullName ).replace("$zipdes",".\")
}
if($checktype -match "NVIDIA"){
$runfiles=Get-ChildItem -path $zipdes -Recurse |Where-object{$_.name -match "installapp\.bat" -or $_.name -match "NVMUP\.exe"}
}
foreach($runfile in $runfiles){
$runfilefull=$runfile.fullname
$runfilebase=$runfile.basename
if($checktype -match "AMD"){
### MUP unattached mode ##
if($attachedmode.length -eq 0 -and $runfile -match "ATISetup\.exe"){
##AMD MUP Driver install
$installcmd=$runfilefull+" -install all -log $logpath3"
&$actioncmd -para1 $installcmd -para3 cmd -para5 nonlog
##AMD MUP APP install##
if($apprunfiles1 -and $apprunfiles2 -and $apprunfiles3){
$hsacmd="DISM /Online /Add-ProvisionedAppxPackage /PackagePath:""$apprunfiles1"""+`
" /LicensePath:""$apprunfiles2"""+`
" /DependencyPackagePath:""$apprunfiles3"""
&$actioncmd -para1 $hsacmd -para2 $zipdes -para3 cmd -para5 nonlog
}
else{
write-host "Error: lack DISM conditions"
}
}
###AMD MUP attached mode ##
if($attachedmode.length -gt 0 -and $runfiles_att -match "^Setup\.exe"){
&$actionamdins -para1 $runfiles_att -para2 "nonlog"
}
}
if($checktype -match "NVIDIA"){
if($runfilefull -match "NVMUP\.exe"){
###NV MUP unattached mode install (Driver/APP)##
if($attachedmode.length -eq 0){
&$runfilefull /s /v "LOGFILE=\""$($logpath3)"""
do{
start-sleep -s 5
}until(!(get-process -name $runfilebase -ErrorAction SilentlyContinue))
}
###NV MUP attached mode install (Driver/APP)##
if($attachedmode.length -ne 0){
## call again ## module lost by unknow reason
$actionss="screenshot"
Get-Module -name $actionss|remove-module
$mdpath=(Get-ChildItem -path $scriptRoot -r -file |Where-object{$_.name -match "^$actionss\b" -and $_.name -match "psm1"}).fullname
Import-Module $mdpath -WarningAction SilentlyContinue -Global
##>
&$runfilefull
$timestart=Get-Date
do{
Start-Sleep -s 10
$timetill=Get-Date
$nvmup=get-process -name NVMUP -ErrorAction SilentlyContinue
$timegap=(New-TimeSpan -start $timestart -End $timetill).TotalSeconds
}until ($timegap -gt 60 -or $nvmup) ##expect DUP call MUP within 60sec
if($nvmup){
Start-Sleep -s 10
$nvmup=get-process -name NVMUP -ErrorAction SilentlyContinue
$wintitle=$nvmup.MainWindowTitle
$windowHandle2 =$nvmup.MainWindowHandle
$windowRect2 = New-Object RECT
[Win32]::GetWindowRect($windowHandle2, [ref]$windowRect2)
$left2 = $windowRect2.Left
$top2 = $windowRect2.Top
[Microsoft.VisualBasic.interaction]::AppActivate($wintitle)|out-null
Start-Sleep -s 2
[Clicker]::LeftClickAtPoint($left2+20,$top2+20)
Start-Sleep -s 2
[System.Windows.Forms.SendKeys]::SendWait("a")
Start-Sleep -s 5
&$actionss -para3 nonlog -para5 "$($dupnamepic)_step1"
[System.Windows.Forms.SendKeys]::SendWait("n")
&$actionss -para3 nonlog -para5 "$($dupnamepic)_step2"
$ctn=0
do{
$ctn++
Start-Sleep -s 60
&$actionss -para3 nonlog -para5 "$($dupnamepic)_step3_$($ctn)"
[System.Windows.Forms.SendKeys]::SendWait(" ")
Start-Sleep -s 10
$nvmup=get-process -name NVMUP -ErrorAction SilentlyContinue
}until(!$nvmup)
}
}
}
###NV MUP install withour NVMUP.exe (ControlPanel) ##
if($runfile -match "installapp\.bat"){
$cmdbf=(get-process -name cmd -ea SilentlyContinue).Id
&$actioncmd -para1 $runfile -para3 cmd -para5 nonlog
start-sleep -s 10
$cmdaf=(get-process -name cmd -ea SilentlyContinue).Id|Where-object{$_ -notin $cmdbf}
if($cmdaf.count -gt 0){
&$actionss -para3 nonlog -para5 "$($runfilename)_cmdwindow"
stop-process -Id $cmdaf -Force
}
}
}
}
}
}
}
if(!$zipfile -and !$exefile){
$results=$results_ng
$index=$index_nofile
}
$resultsall=$resultsall+@($results)
$indexall=$indexall+@($index)
}
$results=$resultsall|Out-String
$index=$indexall|Out-String
}
else{
$results="NG"
$index="copy driver file fail"
}
}
else{
$results="NG"
$index="cannot find initial driver infomation"
}
write-host "$results,$index"
######### write log #######
if( $nonlogflag.Length -eq 0){
Get-Module -name "outlog"|remove-module
$mdpath=(Get-ChildItem -path "C:\testing_AI\modules\" -r -file |Where-object{$_.name -match "outlog" -and $_.name -match "psm1"}).fullname
Import-Module $mdpath -WarningAction SilentlyContinue -Global
#write-host "Do $action!"
outlog $action $results $tcnumber $tcstep $index
}
}
export-modulemember -Function gfx_install