Nservicebus-using PowerShell to manage Nservicebus

Source: Internet
Author: User
Tags msmq

Manage Nservicebus with PowerShell

Powershell,commandlets, installation

Nservicebus provides a set of software that PowerShell Commandlets is easy to manage and run. The initial focus was on providing support when Nservicebus was ready to use the machine. Additional features of the pipeline.

Before installing Nservicebus, make sure that PowerShell 2.0 + exists on the target machine.

Installed in V4.0 Nservicebus commandlets

These can be conveniently NServiceBus.Powershell.dll.

You can use the SDK installer (it will install all you need to run your development environment).

You can use NuGet:

Create a new Class library project and go to Package Manager Console

Type Install-Package NServiceBus.PowerShell

Upon completion you will have a folder in your package in your NServiceBus.Powershell.dll solution directory

Using Visual Studio in a timely manner, you can do

PM> Import-Module .\packages\NServiceBus.PowerShell.<4.x.x your version>\lib\net40\NServiceBus.PowerShell.dll

Then use the cmdlet you want.

There will be less feedback if you run the script inside the cmdlet Visual Studio. If you get a warning it might be a good idea to run the cmdlet from the PowerShell console.

Or you can follow the instructions to load them into PowerShell using the Import-module cmdlet:

PS> Import-Module .\NServiceBus.Powershell.dll

Or you can follow the instructions to load them into your PowerShell profile.

If you use the NuGet package, the commandlets is available in the automatic NuGet console. If you use the MSI installation Nservicebus you can add the Import module declaration

For a detailed description of all of our commandlets, use the Get help command:

PM> get-help about_NServiceBus

Nservicebus PowerShell can be conveniently renamed so that they do not conflict with the existing version 3.0 to facilitate:

Install-nservicebusmsmq

On the machine where MSMQ is installed.

Test-nservicebusmsmqinstallation

Verify that MSMQ is properly installed on the machine.

Install-nservicebusdtc

The DTC is installed on the machine.

Test-nservicebusdtcinstallation

Verify if the DTC is installed and running on the machine.

Install-nservicebusravendb

Install the RAVENDB on the machine.

Test-nservicebusravendbinstallation

Make sure the RAVENDB is installed on this machine. Port 8080 is used to check that the RAVENDB is already installed on the machine. If RAVENDB is installed on a different port, the test may display an error.

Install-nservicebusperformancecounters

The Nservicebus performance counter is installed on the machine.

Test-nservicebusperformancecountersinstallation

Verify that the Nservicebus performance counters are properly installed on the machine.

Nservicebus 4.5 Install-nservicebuslicense (OBSOLETE)

Install the HKLM Nservicebus license file. All endpoints can be set up extensively using this machine without specifying the license file in this folder or in the app. Config file.

For instructions on how to install the license Nservicebus 4.5 and above please refer to how do I install your license file?

Set-nservicebuslocalmachinesettings

Allows you to specify a default error and approval queue. Set the error in the registry, Audit queue wide settings in the HKLM machine. You no longer need to specify these settings in the App. Config file on the machine for each endpoint

Get-nservicebuslocalmachinesettings

The default error and approval queues are displayed.

Nservicebus 4.5 get-nservicebusversion (OBSOLETE)

Displays the Nservicebus installation version.

Nservicebus 4.5 get-nservicebusmsmqmessage (OBSOLETE)

Displays all messages in the queue.

NServiceBus.HostNo longer supported /installinfrastructure . PowerShell is easy to use.

Installing Nservicebus commandlets V3.0

The ability to easily load into PowerShell using the Import-module cmdlet:

PM> Import-Module .\NServiceBus.Core.dll

The core depends on NServiceBus.dll and log4net.dll so ensure that all are in the same directory.

If you use the NuGet package, the commandlets is available in the automatic NuGet console. If you use the MSI installation Nservicebus you can add an import module to declare a PowerShell profile.

For a detailed description of all of our commandlets, use the Get help command:

PM> get-help about_NServiceBus
Infrastructure Commandlets

The following are the available infrastructure to facilitate:

Install-dtc

Set the MSDTC Nservicebus. -WhatIfno modifications were made using the verify current state.

Install-msmq

Set the MSMQ Nservicebus. -WhatIfno modifications were made using the verify current state. If you need to reinstall MSMQ, rerun the command to force the switch.

Install-ravendb

Set Ravendb Nservicebus. -WhatIfno modifications were made using the verify current state.

Install-performancecounters

Install the Nservicebus performance counter. -WhatIfno modifications were made using the verify current state.

Get-nservicebusversion

Current version of Nservicebus (Semver).

Install-license

Install a Nservicebus license file to the registry.

Known Issues

If you get the following error:

Import-Module : Could not load file or assembly‘file:///C:\\Program Files (x86)\\Particular Software\\NServiceBus\\v4.0\\NServiceBus\\Binaries\\NServiceBus.PowerShell.dll‘ or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

Although you can change the existing version Powershell.exe.config load. NET 4.0 Framework, the preferred method is to install PowerShell 3 than to change the configuration file. Forcing PowerShell 2 to use. NET 4 can break PS SnapIns from other suppliers. PowerShell 3 provides a command-line option to switch versions of PS and. If necessary net.

Nservicebus-using PowerShell to manage Nservicebus

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.