Showing posts with label Powershell. Show all posts
Showing posts with label Powershell. Show all posts

Wednesday, December 03, 2008

Scott's Powershell provider for Coral8

Scott posted this message on the Coral8 user's group on LinkedIn. Look at his stuff and give him some feedback.

Coral8 & PowerShell

If you use Coral8 on Windows, and you use Powershell for other development and admin tasks, you may be interested in the powershell navigation provider and cmdlets which I've uploaded to

http://code.google.com/p/coral8shell/

The nav provider supports basic cd and ls commands for workspaces, applications, and streams.

For admin tasks, the following cmdlets have been created

Get-C8Status, Get-C8App, Add-C8App, Remove-C8App, Start-C8App, Stop-C8App


©2008 Marc Adler - All Rights Reserved.
All opinions here are personal, and have no relation to my employer.

Sunday, June 08, 2008

Tibco EMS Powershell Cmdlet

A little Powershell cmdlet for finding out information about your Tibco EMS topics (or a specific topic).


using System;
using System.Management.Automation;
using TIBCO.EMS.ADMIN;

namespace MarcsPowershellCmdlets
{
[Cmdlet(VerbsCommon.Get, "TibcoTopics", SupportsShouldProcess = true)]
public class GetTibcoTopicsCmdlet : Cmdlet
{
#region Parameters
[Parameter(Position = 0,
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The URL of the Tibco EMS broker")]
[ValidateNotNullOrEmpty]
public string URL
{
get; set;
}

[Parameter(Position = 1,
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The UserName of the Tibco EMS broker")]
[ValidateNotNullOrEmpty]
public string User
{
get; set;
}

[Parameter(Position = 2,
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The Password of the Tibco EMS broker")]
[ValidateNotNullOrEmpty]
public string Password
{
get; set;
}

[Parameter(Position = 3,
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The name of the topic the look at")]
[ValidateNotNullOrEmpty]
public string Topic
{
get;
set;
}
#endregion

protected override void ProcessRecord()
{
try
{
if (string.IsNullOrEmpty(this.URL))
this.URL = "tcp://localhost:7222";
if (string.IsNullOrEmpty(this.User))
this.User = "admin";

Admin admin = new Admin(this.URL, this.User, this.Password);
TopicInfo[] topics = admin.Topics;

if (string.IsNullOrEmpty(this.Topic))
{
this.WriteObject(topics, true);
}
else
{
foreach (TopicInfo topic in topics)
{
if (topic.Name.Equals(this.Topic, StringComparison.InvariantCultureIgnoreCase))
{
this.WriteObject(topic);
break;
}
}
}

admin.Close();
}
catch (Exception)
{
Console.WriteLine("Cannot connect to the Tibco EMS broker");
}
}
}
}


©2008 Marc Adler - All Rights Reserved