-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainappscen1.psm1
77 lines (68 loc) · 1.88 KB
/
mainappscen1.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
<#
#
# Main module used for calling other parts of the application.
#
# Includes utility classes with main functionality for scripts.
#
#>
Import-Module -Force '.\DirSize.psm1'
Import-Module -Force '.\OtherInfo.psm1'
Import-Module -Force '.\PartInf.psm1'
Import-Module -Force '.\ProceInf.psm1'
Class MainConfig {
$configuration;
$generatedhtml;
}
<# Retrieve content with basic configuration for reporting operations. #>
Class DirModule : MainConfig {
$exdirinfo;
}
Class ProgModule : MainConfig {
$exprograminfo;
}
Class PartModule : MainConfig {
$expartinfo;
}
Class ProcModule : MainConfig {
$exprocessinfo;
}
[PSCustomObject[]]$importedInfo = @(
<# Retrieve content for basic directories. #>
[DirModule]@{
configuration = $Script:DirSize.validateCfg()
exdirinfo = $Script:DirSize.exportDirInfo()
generatedhtml = $Script:DirSize.genContentWithTitle()
},
<# Retrieve content for local installs. #>
[ProgModule]@{
configuration = $Script:OtherInfo.getCfg();
exprograminfo = $Script:OtherInfo.exportOtherInfo();
generatedhtml = $Script:OtherInfo.genContentWithTitle();
},
<# Retrieve content of local disk partitions. #>
[PartModule]@{
configuration = $Script:PartInf.validateCfg();
expartinfo = $Script:PartInf.exportPartInfo();
generatedhtml = $Script:PartInf.genContentWithTitle();
},
<# Retrieve content of system processes. #>
[ProcModule]@{
configuration = $Script:ProceInf.validateCfg();
exprocessinfo = $Script:ProceInf.exportProceInf();
generatedhtml = $Script:ProceInf.genContentWithTitle();
}
);
function getDirectorySizes() {
$($importedInfo[0]);
}
function getOtherSizes() {
$($importedInfo[1]);
}
function getPartitionSizes() {
$($importedInfo[2]);
}
function getProcessSizes() {
$($importedInfo[3]);
}
Export-ModuleMember -Function '*'
Export-ModuleMember -Variable '*'