Some time back, in his blog post, Jeffrey Snover introduced one of the new Windows PowerShell 3.0 feature – Windows PowerShell Workflow. In that post, you saw a glimpse of how to author workflows using PowerShell syntax. This post dives into more details of authoring workflows using PowerShell syntax and various extensions to it.
We’ve already discussed the biggest new PowerShell language feature – workflows – in a previous post. In this post, I’m going to describe a number of small changes we’ve made to the language. Most of the changes described here don’t introduce any new syntax,
There are many ways to set a variable’s value.
I just learnt one more yesterday. If you have others, please add comments
# Simple# $ gets the variable, and = will assign it$a = 1
# With Variable Scope# The prepend is the scope,
A while back, Jeffrey posted an article on how to use string expansion and XML casts to build XML documents in-line in a PowerShell script:
The overall feel of the approach that Jeffrey described is very much like that of ASP,
Well folks, at long last, my book is almost done 🙂
Before it goes out for print, you can get electronic copies through Manning’s early access program:
The early access program is a chance for readers to provide feedback on a book so the author can fix things.
Joel Spolsky of Joel-On-Software fame, just posted a blog, “Can Your Programming Language Do This?” http://www.joelonsoftware.com/items/2006/08/01.html
In this article, he drives home the point that when it comes to code: Maintainability, Readability, Abstraction == Good! He then points out how languages can help or hinder this and goes on to articulate the things a language should do to help.
REI recently posted some comments/requests about Windows PowerShell syntax at:
Let’s go through a few of the points.
…the syntax was just way too cryptic and unintuitive. Often it’s even dangerous. Like this:
#PowerShell’s syntax causes dangerous problems generating incorrect results and no error for seemingly innocent expressions: function Pow($var,
PSMDTAG:FAQ: Can I specify a methodname using a variable? e.g. $x.$y()
PSMDTAG:FAQ: Why do I get METHOD metadata when I specify a method without providing parentheses?
One of the great things about Windows PowerShell is that it is a latebound language which allows you to do all sorts of incredibly powerful operations.
PSMDTAG:FAQ: What is a TYPE SHORTCUT?PSMDTAG:FAQ: What are the TYPE SHORTCUTS?
Type shortcuts are a Windows PowerShell feature that allows you to reduce the amount of typing you have to do when specifying a type.
For example, the following 2 statements produce the same result: