protected override void ProcessRecord() { if (ShouldProcess(Environment.MachineName)) { var msmqIsGood = MsmqSetup.StartMsmqIfNecessary(); if (!msmqIsGood) { WriteWarning("Msmq may need to be reinstalled manually. Please ensure MSMQ is running properly."); } } }
protected override void ProcessRecord() { if (ShouldProcess(Environment.MachineName)) { bool msmqIsGood = MsmqSetup.StartMsmqIfNecessary(Force); if (!msmqIsGood && !Force) { WriteWarning( "Msmq needs to be reinstalled. Please re-run the command with -Force set. NOTE: This will remove all local queues!"); } } }
protected override void Process() { bool msmqIsGood; if (!ShouldProcess(Environment.MachineName)) { msmqIsGood = MsmqSetup.IsInstallationGood(); Host.UI.WriteLine(msmqIsGood ? "Msmq is installed and setup for use with NServiceBus" : "Msmq is not installed"); WriteObject(msmqIsGood); return; } msmqIsGood = MsmqSetup.StartMsmqIfNecessary(Force); if (!msmqIsGood && !Force) { WriteWarning("Msmq needs to reinstalled, Please rerun the command with -Force set. NOTE: This will remove all local queues!"); } WriteObject(msmqIsGood); }