commit 89b8072e0158c7166779062f4e4f9acc4b374a8f Author: maxxi Date: Tue Mar 24 18:21:50 2026 +0100 initialer commit mit kleinem prototype diff --git a/LogFramework.psm1 b/LogFramework.psm1 new file mode 100644 index 0000000..7da1083 --- /dev/null +++ b/LogFramework.psm1 @@ -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 \ No newline at end of file diff --git a/main.ps1 b/main.ps1 new file mode 100644 index 0000000..e4ec2bb --- /dev/null +++ b/main.ps1 @@ -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" \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..778008a --- /dev/null +++ b/readme.md @@ -0,0 +1,3 @@ +# PowerShell Log Framework + +A small PowerShell Log Framework will be created here \ No newline at end of file