The Log Reader provides a Snap-In to extend Windows PowerShell sets of commands with the Log Reader commands. For more information, see Log Reader Command-Line Interface Commands.
To use a Snap-In, you must add the Snap-In to the PowerShell console for every Windows PowerShell session, or you can start PowerShell from a previously created configuration file so that sessions will already include the Snap-In.
TIPS:
You can see the current PowerShell version using the PowerShell console. Command: $PSVersionTable.PSVersion.
To register your dll, the Powershell should be run with the“Run as Administrator” option (for Vista and later).
To run individual versions of the console, register the PowerShell (x86) 32-bit or the 64-bit version. If you want to work with both the 32-bit and the 64-bit version of PowerShell, run the registration for each one.
To register the Log Reader Snap-In
Run the following command(s).
For PowerShell 64-bit (easy method):
LogReader.SqlServer.register.ps1
This script is located in C:\Program Files\Quest Software\LiteSpeed\SQL Server
The script automatically finds the LiteSpeed installation folder and calls installutil for LogReader.SqlServer.PSSnapIn.dll.
For PowerShell 64-bit (original method):
set-alias installutil $env:windir\Microsoft.NET\Framework64\v4.0.30319\installutil.exe
installutil "LRInstallationDirectory\LogReader.SqlServer.PSSnapIn.dll"
where
LRInstallationDirectory is a full path to the Log Reader installation directory (usually, C:\Program Files\Quest Software\LiteSpeed\SQL Server
For PowerShell (x86) 32-bit:
set-alias installutil $env:windir\Microsoft.NET\Framework\v4.0.30319\installutil.exe
installutil "LRInstallationDirectory\LogReader.SqlServer.PSSnapIn.dll"
where
LRInstallationDirectory is a full path to the Log Reader installation directory (usually, C:\Program Files\Quest Software\LiteSpeed\SQL Server
To add the Log Reader Snap-In to the PowerShell console
Verify that the Log Reader Snap-In is registered by running the following command:
Get-PSSnapIn -registered
Windows PowerShell displays Snap-Ins that are available in the session.
Run the following command:
add-pssnapin LogReader.SqlServer
(First use only) You may need to register the data formatting file using the following command:
Update-FormatData -AppendPath "LRInstallationDirectory\LogReader.SqlServer.Format.ps1xml"
where
LRInstallationDirectory is a full path to the Log Reader installation directory (usually, C:\Program Files\Quest Software\LiteSpeed\SQL Server
To save PowerShell console configuration
Run the following command:
export-console MyCustomShell
where
MyCustomShell is the name of a console file where to save configuration.
Windows PowerShell creates a MyCustomShell.psc1 console file in the current directory that identifies the Snap-In to load when the shell starts.
To start PowerShell from a saved configuration
Run the following command:
%ProgramFiles%\Command Shell> PS - PSConsoleFile MyCustomShell.psc1
where
%ProgramFiles% is an environment variable with the path to your Program Files directory (usually, C:\Program Files), and
MyCustomShell.psc1 is a PowerShell console configuration file.
About Using the Log Reader Command-Line Interface
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center