if($Session-eq$null){Write-Error"Session variable is not available"}else{$bytes=$nullif($Session.TryGetValue($Key,[ref]$bytes)){[System.Text.Encoding]::UTF8.GetString($bytes)}}}functionWrite-UDLog{param([Parameter(Mandatory=$true,Position=0)][String]$Message,[Parameter()][ValidateSet("Debug","Info","Warning","Error")][String]$Level="Info",[Parameter()][String]$LoggerName="Endpoint")