function New-LevelSwitch {
        Creates instance of LoggingLevelSwitch at the initial minimum level
        Creates instance of LoggingLevelSwitch that dynamically controls logging level
    .PARAMETER MinimumLevel
        Sets current minimum level, below which no events should be generated
    .PARAMETER ToPreference
        Set to propagate desired minimum level to preference variables.
        None. You cannot pipe objects to New-LevelSwitch
        Instance of LoggingLevelSwitch with altered minumum logging level
        PS> $levelSwitch = New-LevelSwitch
        PS> $levelSwitch = New-LevelSwitch -MinimumLevel Verbose

        [Parameter(Mandatory = $false)]
        [Serilog.Events.LogEventLevel]$MinimumLevel = [Serilog.Events.LogEventLevel]::Information,
        [Parameter(Mandatory = $false)]

    $levelSwitch = [Serilog.Core.LoggingLevelSwitch]::new()
    $levelSwitch.MinimumLevel = $MinimumLevel
        Set-LogLevelToPreference -LogLevel $MinimumLevel