When can I use a PowerShell workflow?

Source: Internet
Author: User

Workflow is a notable new feature of Windows PowerShell 3.0. It is available in Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows 8, and Windows Server 2012. In this case, the concept, function, and usage of workflows are still vague.

When should I use a PowerShell workflow?

A PowerShell workflow is similar to an enhanced PowerShell function. Enter the command into the workflow and tell PowerShell to start running the workflow. The "enhancement" of a workflow supports features not available in PowerShell, such as running multiple tasks in parallel. It also lacks existing functions in PowerShell, such as supporting Switch construction.

In fact, the additional features of these PowerShell workflows are not running in PowerShell. On the contrary, it is a part of Windows workflow basic (WWF), which was first found in. NET Framework 3.5.

Although PowerShell syntax is used, WWF rules must be followed, so the learning curve is steep. The data transmission methods between available variables, commands, and commands have changed.

However, this learning curve is very valuable. The built-in functionality of PowerShell workflow allows multiple target remote machines to work in parallel, provided that PowerShell is installed on these machines and remote functions are available. In Windows Server 2012, these are default values.

There are some great built-in parameters in the workflow. The workflow can be interrupted and restarted to adapt to power outages, network faults, and other temporary faults.

Of course, a workflow is not the only way to implement the above functions. For example, sending a script to multiple parallel remote machines requires additional work, while Invoke-Command does a good job in this regard. Using the "normal" PowerShell script can avoid learning all WWF rules and regulations.

The only truly unique feature of a PowerShell workflow is its ability to interrupt and restart-there are many rules and precautions. In some cases, you may not even be allowed to interrupt/restore the workflow in PowerShell.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.