-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfinalz.psm1
More file actions
48 lines (29 loc) · 1.1 KB
/
finalz.psm1
File metadata and controls
48 lines (29 loc) · 1.1 KB
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
function finalz{
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force
$wshell = New-Object -com WScript.Shell
Add-Type -AssemblyName Microsoft.VisualBasic
Add-Type -AssemblyName System.Windows.Forms
###### basic check folders ######
if($PSScriptRoot.length -eq 0){
$scriptRoot="C:\testing_AI\modules\"
}
else{
$scriptRoot=$PSScriptRoot
}
#$daver_path=(Split-Path -Parent $scriptRoot)+"\logs\basic\"
#if(-not(test-path $daver_path)){new-item -ItemType directory $daver_path |Out-Null }
########## save log ########
$action="finalization"
$tcpath=(Split-Path -Parent $scriptRoot)+"\currentjob\TC.txt"
$tcnumber=((get-content $tcpath).split(","))[0]
$tcstep=((get-content $tcpath).split(","))[1]
$index="-"
$results="OK"
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 finalz