title: Hello World with SeriLog and PowerShell
body: <p>I'm trying to understand how to use SeriLog in PS.</p>
  <p>This is an example of code that works:</p>
  <pre><code>$SeriLog = Add-Type -Path &quot;C:\Program Files\PackageManagement\Serilog.2.10.0\lib\net46\Serilog.dll&quot; -PassThru 
  $SeriLog_Sink_Console = Add-Type -Path &quot;C:\Program Files\PackageManagement\Serilog.Sinks.Console.3.1.1\lib\net45\Serilog.Sinks.Console.dll&quot; -PassThru
  
  $SeriLog_Config = New-Object Serilog.LoggerConfiguration
  $SeriLog_Config = [Serilog.Configuration.LoggerSinkConfiguration]$SeriLog_Config_Sink = $SeriLog_Config.WriteTo
  [Serilog.Log]::Logger = [Serilog.ConsoleLoggerConfigurationExtensions]::Console($SeriLog_Config_Sink).CreateLogger()
  [Serilog.Log]::Information(&quot;Logging started&quot;)
  </code></pre>
  <p>Based on examples listed on SeriLogs site for dotnet, what i don't understand is why are all my sinks missing.</p>
  <p>Example:</p>
  <pre><code>$SeriLog = Add-Type -Path &quot;C:\Program Files\PackageManagement\Serilog.2.10.0\lib\net46\Serilog.dll&quot; -PassThru 
  $SeriLog_Sink_Console = Add-Type -Path &quot;C:\Program Files\PackageManagement\Serilog.Sinks.Console.3.1.1\lib\net45\Serilog.Sinks.Console.dll&quot; -PassThru
  
  $SeriLog_Config = New-Object Serilog.LoggerConfiguration
  $SeriLog_Config.WriteTo.Console()
  </code></pre>
  <p>There error i get is:</p>
  <blockquote>
  <p>InvalidOperation: Method invocation failed because [Serilog.Configuration.LoggerSinkConfiguration] does not contain a method named 'Console'.</p>
  </blockquote>
  <p>This makes sense to a degree in that I can see it's missing, but I don't understand why?  I've imported both DLL's.  I guess for me, I'm very much a newbie when it comes to understanding how to work with DLL's in PS.  I've had much better luck with and have a reliably working module with Log4Net, but I'm trying to migrate to something that's more modern and I'm pulling my hair out trying to understand how to integrate various sinks if the public examples for dotnet don't translate to PS.</p>
  <p>JFYI, I'm using PS 7.1 incase that matters.</p>