Created
June 9, 2024 12:23
-
-
Save adbertram/d6e55de2b2d9c35a4bfbe75debc23355 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Set-LogLevel { | |
param ( | |
[ValidateSet("Debug", "Info", "Warning", "Error")] | |
[string]$Level | |
) | |
Write-Output "Log level set to $Level" | |
} | |
# Example usage: | |
Set-LogLevel -Level Debug # Valid input | |
# Set-LogLevel -Level Verbose # Invalid input, will result in an error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment