title: Connecting to OPC server with PowerShell
body: <p>I’m trying to use PowerShell to read values from an OPC server. I have been doing some research but I can’t see any reference or similar case.</p>
  
  <p>I installed the Matrikon OPC Simulation server and tried loading OPCdotNETLib.dll assembly. The assembly is loaded successfully. I can see intellisense when operating with the objects. I’m not getting any error now but I don’t think is connecting successfully.</p>
  
  <pre><code>$Path = "C:\OPCdotNETLib.dll"
  Add-Type -Path $Path
  [System.Reflection.Assembly]::LoadWithPartialName('System.Runtime.InteropServices') 
  
  $OPCServer = New-Object OPC.Data.OpcServer
  $OPCServer = [OPC.Data.OPCServer]::new()
  $OPCServerName = "Matrikon.OPC.Simulation.1"
  $OPCServer.Connect($OPCServerName) 
  </code></pre>
  
  <p>Would you have any clue or help reference?</p>