>

I'm finally beginning to understand why those guys with strange T-shirts love Linux/Unix:

the ability to script everything easily

Well for us windows boys scripting has been painful at best. That has all changed with Powershell. Here's the proof:

Consider the task of stopping and unenlisting Biztalk orchestrations. Before this required skills in black magic and a big portion of luck.

Here's the Powershell-script to do it:

function StopAndUnEnlist-Orchestration($orch)
{
     if ($orch.OrchestrationStatus -eq 4 )
       {
          write-host "Stopping orchestration:" $orch.Name
        $orch.Stop(2,2)
    }
    if ($orch.OrchestrationStatus -gt 2)
       {
          write-host "UnEnlisting orchestration:" $orch.Name
        $orch.UnEnlist(2)
    }
}

function Get-Orchestration($Name="%", $ComputerName =".")
{
    Get-WmiObject -ComputerName $ComputerName -class MSBTS_Orchestration -namespace 'root\MicrosoftBizTalkServer' -Filter "Name like '$Name'"
}

 

#stop orchestrations
Get-Orchestration("Contoso%") | %{ Stop-Orchestration($_) }

 

Conclusion: I love Powershell!!