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.
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!
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.
A quick look at the easiest way to create PowerShell modules. PowerWF (http://www.powerwf.com) is used to create a PowerShell module that allows you to use the Speech API (SAPI) and create message boxes from within PowerShell.
At the end of the tutorial on creating PowerShell modules, I briefly touched on the importance of naming your workflows using standard powershell verbs, but wanted to go into a little more detail.
If you name your workflows using standard PowerShell verbs, when you deploy the workflows as PowerShell modules, PowerWF will automatically parse the workflow names for you.
For example, if I had 5 open workflows, named “sendFlowers”, “getLunch”, “usePowerWF”, “watchVideos”, and “speakToMe”, PowerWF would be able to select the correct verb for the first 4 workflows, but not “speakToMe” since “speak” is not a standard PowerShell verb.
PowerWF currently supports the following list of standard PowerShell Verbs (by category):
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.
PowerWF will automatically set the Name, Vendor, and Output directory, but these can be changed if desired.
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.
The command now appears as “Send-speakToMe”. Change the noun to “Words” to change the command to “Send-Words”.
Ensure that the “Launch PowerShell after build” is checked and then click the Build button.
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.”
Creating a PowerShell module is almost as simple as creating a cmdlet. On the Deploy tab, click the “Module” button.
One of the unique features of PowerWF is the ability for users to extend it by adding their own toolbox activities. This tutorial will create a workflow that uses SAPI to speak whatever text is passed to it. This workflow will then be converted into a toolbox activity which can be dropped into other workflows
Topics Discussed
Naming Activities
Combining PowerShell and COM
Using Input Parameters
Creating Toolbox activities
Using custom toolbox activities
Using the ExecScript activity.
Using the FormatString activity.
Using the ForEach activity.
Using the GetProperty activity.
Procedure
Create a new workflow project called “speakToMe”
This workflow will utilize the Speech API (SAPI) by using the ExecScript activity from the PowerShell V2 toolbox. Drop an ExecScript activity onto the canvas and set the script to:
$sapi = new-object -com SAPI.SpVoice
This command creates the SAPI object for later use.
To make the workflow more readable, set the Name of ExecScript1 to “Create SAPI”
Drop a second ExecScript activity onto the canvas and set the script to: $sapi.speak(“I hunger”);$sapi.waitUntilDone(10000);
The speak command tells the speech API to say, “I Hunger”. To work properly, the speech API requires that an option be set to wait until the Speak activity is done before proceeding, unless it takes longer than 10 seconds.
For readability, set the Name of ExecScript2 to “SayWords”
Although PowerWF scripts will run in their own run-space and clean up automatically on shutdown, one more ExecScript activity can be added to clean up the SAPI object. Drop another ExecScript activity on the canvas and set the script to:
PowerWF Studio™ is a visual scripting tool that combines Microsoft PowerShell and Windows Workflow Foundation. The visual development environment eliminates the need to write scripts by hand, yet lets you leverage scripts that you have already written. PowerWF provides a central environment for building, debugging, and deploying your scripts and workflows. It includes a wide array of pre-packaged activities that support standard industry platforms but is extensible so that you can create your own activities. Using PowerWF™, administrators can quickly and easily automate their daily repetitive tasks.
PowerWF Studio’s appearance and directories can be changed by clicking the PowerWF icon and selecting the Settings button.
General Settings
The General Settings are used to set basic user information like name, company name, and email address, but is also used to set some of the basic visualization options. “Animation” and “Auto Resize Icons” are self explanatory and a matter of preference.
“Right to Left Rendering” would most likely only be used in countries where the reading order is right to left, but is also a matter of preference.
The “Show commands in Property Grid” allows for some commands, such as promoting bindable properties to be exposed to the user. Most users will not want or need to do these actions, or when they do need them, PowerWF has provided a more user friendly way of doing the command. Advanced users may decide to bypass having PowerWF walk them through these commands and therefore decide to have them accessible in the property control.
Theme Application Settings
The application settings under the theme options allow for fine-tuning the appearance of PowerWF Studio. The Font drop-down allows the font-size for menu items, properties, toolbar items, etc. to be set to the system settings or to a specific value (Normal, Large, or Extra Large).
The Docking Window Theme affects the appearance for all dockable windows, including the ToolBox, Property, and Output Windows. The Caption for these docking windows can be turned off if desired or can be rotated a specific direction via the Captions position drop down. Available options are Horizontal, Vertical, Auto by Size, or Auto by Position.
The Toolbox Theme specifies both how the toolbox looks and acts. The Theme and Behavior effect both scrolling and how many toolboxes can be opened simultaneously.
Alan suggests that learning PowerShell is as easy as doing a Google search on “Powershell basics”. PowerCLI requires a bit more effort, but Alan’s post will get you well on your way:
Well first on the list would have to be the book ‘Managing VMware Infrastructure with Windows PowerShell’ by Hal Rottenberg. Its a great book with loads of examples and Hal has a great way of writing where it keeps you amused whilst still learning.
Secondly there is my blog post which takes it right back to basics and tells you how to install PowerCLI.
Thirdly, there are a number of great PDF files which you can read to help you along your journey, starting from the basics up to the more interesting ones …read the rest of Alan’s post…
Despite the fanfare when PowerShell V2 was released, some effort was required to actually find links to download it. Thankfully John Cook at “The Endeavor” did the work of tracking down all the possible downloads.
PowerWF Studio allows multiple workflows to be open at one time to allow easy copy and paste between workflows. The easiest way to work with multiple workflows is to create multiple tab groups. This is done by clicking and dragging the workflow tab to the edge of the canvas.
Dragging the workflow to the right edge tells PowerWF that a new vertical tab group should be created. Once multiple tab groups are opened, activities can be moved from one workflow to another by selecting and dragging. To copy activities, hold down the CTRL key while dragging the activities.
PowerWF Studio supports standard features, such as SHIFT – CLICK or CTRL – CLICK to multi-select workflow activities. Holding down SHIFT while pressing down the left mouse button and then dragging allows the rubber-banding of multiple activities.
Right-click on an activity or group of activities to Cut, Copy, Paste, or Delete those activities. Activities can be copied from one workflow to another or within the same workflow.