initialer commit mit kleinem prototype
This commit is contained in:
18
LogFramework.psm1
Normal file
18
LogFramework.psm1
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
function Write-LFLog {
|
||||||
|
param(
|
||||||
|
[string]$Message,
|
||||||
|
[ValidateSet("low","mid","high","critical")]
|
||||||
|
[string]$Severity = "low"
|
||||||
|
)
|
||||||
|
|
||||||
|
switch ($Severity) {
|
||||||
|
"low" { $color = "Gray" }
|
||||||
|
"mid" { $color = "Cyan" }
|
||||||
|
"high" { $color = "Yellow" }
|
||||||
|
"critical" { $color = "Red" }
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "[$Severity] $Message" -ForegroundColor $color
|
||||||
|
}
|
||||||
|
|
||||||
|
Export-ModuleMember -Function Write-LFLog
|
||||||
8
main.ps1
Normal file
8
main.ps1
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# import von log-framework
|
||||||
|
Import-Module .\LogFramework.psm1
|
||||||
|
|
||||||
|
# ausführen von verschiedenen testcases
|
||||||
|
Write-LFLog "Testnachricht" "low"
|
||||||
|
Write-LFLog "Testnachricht" "mid"
|
||||||
|
Write-LFLog "Testnachricht" "high"
|
||||||
|
Write-LFLog "Testnachricht" "critical"
|
||||||
Reference in New Issue
Block a user