Particular / NServiceBus.PowerShell

Powershell extensions for NServiceBus
https://docs.particular.net/nservicebus/operations/management-using-powershell
Other
7 stars 7 forks source link

Octopus tentacles ready PowerShell scripts/cmdlet #36

Open mauroservienti opened 7 years ago

mauroservienti commented 7 years ago

At the moment NServiceBus PowerShell CmdLet need to be installed and imported on the target machine in order to be able to use them, with the following possible issue:

The installation adds the NServiceBus.PowerShell module location to the PSModulePath environment variable. If the module isn't available a restart the Windows session may be required for this change to to take effect.

The above process makes very hard, or impossbile in some scenarios, to use NServiceBus PowerShell CmdLet when installing endpoints via a Octopus Tentacle. Due to the way Tentacles behave some of the operation are hard to script.

In talking with the customer that raised this concern they expressed the need of pure PowerShell ps1 scripts that can be deployed to the destination node where the installation needs to be executed.

Are we missing something?

gbiellem commented 7 years ago

At the moment NServiceBus PowerShell CmdLet need to be installed and imported on the target machine in order to be able to use them

That's not strictly true. You can just ship the the NServiceBus.Powershell.DLL and reference it directly using a file path rather that doing a full install and referencing it via the powershell module name:

So use

Import-Module <path>NServiceBus.PowerShell.DLL

instead of

Import-Module NServiceBus.PowerShell

The supplied path doesn't have to be be fully qualified. I've done this is the past with octopus and it's a simply and easy way to get it running.

Are we missing something?

Yes, some doco on how to do this without running a full install. I'll rectify that.. It would be possible to do most or all of what the DLL does in newer versiona of PowerShell so I'll look into adding that to the doco as well. The DLL version would still be needed for older OSes/older version of powershell. I'm not sure we have a policy on how far back we go with OS support.