I am trying to load SQL Analysis Server trace file to database using PowerShell.
[void][reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfoExtended")
[void][reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo")
[void][reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo")
$TraceFileReader = New-Object Microsoft.SqlServer.Management.Trace.TraceFile
$TraceFileReader.InitializeAsReader($TraceFile)
This gives below exception. Microsoft.SqlServer.Management.Trace.SqlTraceException: Failed to initialize object as reader. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.Instapi, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
I am run SQL Server 2014 on Windows 2012 R2. How to load the assembly to PowerShell?