PowerWF News, Tutorials, and more...

Get the latest tips and tricks directly from the PowerWF development team. Find out about new releases and upcoming features.


Seamless Automation

From the Desktop to the Data Center

The PowerWF family of products are easy enough for desktop and departmental automation, yet powerful and scalable enough for the Data Center. PowerWF compliments Opalis and other RBA solutions, lets you leverage your workforce and preserves your investment as your automation needs grow.


Special - 20% Discount


In conjunction with our recently announced Silver Award from Windows IT Magazine we would like to offer our customers an opportunity to save 20% off any Devfarm product purchase through the end of the year. This includes all PowerWF products as well as Devfarm's new PowerVI product!

PowerVI

vSphere Automation fueled by PowerShell


Designed for the VMware Administrator, PowerVI eases the automation of vSphere infrastructures. PowerVI includes over 100 PowerShell automation scripts that simplify everyday VMware administration tasks and PowerVI makes it easy to author new scripts.
November 19, 2009

Tutorial: Deploying Workflows to PowerShell

The previous tutorials have focused on creating workflows in PowerWF that leverage PowerShell, but haven’t talked about how to use those workflows in PowerShell. This tutorial will discuss how to create a PowerShell CMDLET and Modules from a PowerWF workflow.

Topics Discussed

  • Deploying workflows as Cmdlets
  • Deploying workflows as PowerShell Modules

Procedure

  1. Open the speakToMe workflow created in the previous tutorial.
  2. On the Deploy tab, click the “Cmdlet” button.

  3. PowerWF will automatically set the Name, Vendor, and Output directory, but these can be changed if desired.
  4. Standard PowerShell commands consist of a verb, then a noun. PowerWF includes the standard list of verbs. From the Communication group, double-click the verb “Send” to select it.

  5. The command now appears as “Send-speakToMe”. Change the noun to “Words” to change the command to “Send-Words”.

  6. Ensure that the “Launch PowerShell after build” is checked and then click the Build button.



  7. PowerWF will launch a PowerShell console so the cmdlet can be tested. Type “send-words” to say the default phrase, or use get-help to see the syntax for a custom phrase.



    Custom phrase sample:

    send-words -inputWords “wow! it works in powershell.”

  8. Creating a PowerShell module is almost as simple as creating a cmdlet. On the Deploy tab, click the “Module” button.


  9. Set the Module Name to “Speech”, then select the speakToMe Workflow and click the edit button.



  10. As with the cmdlet, set the verb to “Send” and the noun to “Words”. Do not check the box to make the workflow a private member of the module, or it will not be directly accessible to PowerShell.

  11. Click the Build button and PowerWF will launch a PowerShell console with the Speech module installed. As with the cmdlet example, test the module by typing:

    send-words -inputWords “wow! it works in powershell.”



Usage Notes

  • The true value of deploying modules can be seen when multiple workflows are combined in a single module. The Module Deploy automatically includes all open workflows in the module.
  • If workflows are named with a standard PowerShell verb, PowerWF will automatically parse the verb-noun syntax.
  • The Modules and Cmdlets built with PowerWF currently support x86 PowerShell, not 64 bit PowerShell.
  • Use “install-module Speech” to install the module in other PowerShell consoles.

Summary

This tutorial showed how to deploy workflows as PowerShell cmdlets and modules. Setting the verb and noun for the cmdlets using standard PowerShell verbs was discussed. PowerWF contains the complete list of standard PowerShell verbs available for selection. If the workflow name begins with a standard PowerShell verb, PowerWF will automatically parse the verb-noun syntax for the module creation.



blog comments powered by Disqus