Repository navigation
Expand file tree
/
Copy pathPSFolderReport.psm1
More file actions
42 lines (38 loc) · 1.47 KB
/
Copy pathPSFolderReport.psm1
File metadata and controls
42 lines (38 loc) · 1.47 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
#Requires -Version 5.1
<#
.SYNOPSIS
PSFolderReport - PowerShell-Modul zur Speicherplatzanalyse.
.DESCRIPTION
Laedt alle Public- und Private-Funktionen per Dot-Sourcing.
Public-Funktionen werden exportiert; Private-Funktionen sind
nur modulintern sichtbar.
Keine Seiteneffekte beim Import: kein Output, kein Scan, keine GUI.
#>
# --- WinForms Assemblies laden (benoetigt fuer GUI-Cmdlets) -------------------
Add-Type -AssemblyName System.Windows.Forms -ErrorAction SilentlyContinue
Add-Type -AssemblyName System.Drawing -ErrorAction SilentlyContinue
Add-Type -AssemblyName System.Web -ErrorAction SilentlyContinue
# --- Private Funktionen laden (nicht exportieren) -----------------------------
$privateFunctions = Get-ChildItem -Path "$PSScriptRoot\Private\*.ps1" -ErrorAction SilentlyContinue
foreach ($file in $privateFunctions) {
try {
. $file.FullName
}
catch {
Write-Error "Fehler beim Laden von '$($file.FullName)': $_"
}
}
# --- Public Funktionen laden und exportieren ----------------------------------
$publicFunctions = Get-ChildItem -Path "$PSScriptRoot\Public\*.ps1" -ErrorAction SilentlyContinue
foreach ($file in $publicFunctions) {
try {
. $file.FullName
}
catch {
Write-Error "Fehler beim Laden von '$($file.FullName)': $_"
}
}
# Nur Public-Funktionen exportieren (Dateiname = Funktionsname)
if ($publicFunctions) {
Export-ModuleMember -Function $publicFunctions.BaseName
}