Skip to content

Instantly share code, notes, and snippets.

@adbertram
Created June 9, 2024 12:23
Show Gist options
  • Save adbertram/d6e55de2b2d9c35a4bfbe75debc23355 to your computer and use it in GitHub Desktop.
Save adbertram/d6e55de2b2d9c35a4bfbe75debc23355 to your computer and use it in GitHub Desktop.
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