1: # My first PowerShell haiku
2: $herestring = @”
3: This is the best way
4: when you want to span across
5: multiple lines, dude.
6: “@
Hope this helps.
WordPress database error: [Table 'halr_pmachine.wp_categories' doesn't exist]
SELECT cat_id, cat_name FROM wp_categories WHERE link_count > 0
1: # My first PowerShell haiku
2: $herestring = @”
3: This is the best way
4: when you want to span across
5: multiple lines, dude.
6: “@
Hope this helps.
I just have trouble believing that a currently developed OS (NetBSD for the record) still has this kind of opaqueness. This is a problem I will never have again when working in PowerShell!

On PowerShell all cmdlets have built-in help which can be accessed a variety of ways, the simplest of which is:
cmdlet-name -?
The more verbose versions include “help <cmdlet-name>”, and “get-help <cmdlet-name>” with increasingly higher levels of detail obtained by supplying parameters to Get-Help such as “-example”, “-detailed”, and “full”.
Line continuation (and termination for that matter) characters are not required that often.
So you can do this without a single line-continuation character (a trailing back-tick ` )
function test {
param (
$firstname,
$lastname
)
(get-process) [
1
]
write-host "$firstname
$lastname" # don't do this, or kittens will die
}
At long last, VMware has released their PowerShell toolkit to the public. You can grab it at this convenient URL (love it when companies do that):
http://vmware.com/go/powershell
There is already an official forum online for the toolkit which those in the closed beta were already participating. That means there’s already some content in there for new users. It’s a great place to ask questions.
The toolkit is still beta, and the documentation is unfinished. But what’s in there now is really cool and very stable. I believe it is covered by VMware Support already so you can actually open a support case if you run into trouble, if you have a support contract. Below is a list of the scope of the cmdlets included. Instead of waste 102 lines of text I’ve grouped them by verb and noun for clarity.
1: 76# Get-Command -PSSnapin v* | group verb | ft count,name -auto
2:
3: Count Name
4: —– —-
5: 1 Add
6: 1 Dismount
7: 2 Find
8: 28 Get
9: 1 Load
10: 1 Mount
11: 7 Move
12: 16 New
13: 17 Remove
14: 1 Restart
15: 1 Save
16: 18 Set
17: 1 Shutdown
18: 1 Start
19: 2 Stop
20: 2 Suspend
21: 1 Update
22: 1 Wait
23:
24: 77# Get-Command -PSSnapin v* | group noun | ft count,name -auto
25:
26: Count Name
27: —– —-
28: 5 VMHost
29: 3 Tools
30: 1 EntityView
31: 1 EntityViews
32: 4 CDDrive
33: 5 Cluster
34: 5 Datacenter
35: 4 Datastore
36: 1 Event
37: 4 FloppyDrive
38: 5 Folder
39: 3 HardDisk
40: 3 Inventory
41: 1 Log
42: 1 LogType
43: 4 NetworkAdapter
44: 4 OSCustomizationSpec
45: 5 ResourcePool
46: 4 Snapshot
47: 1 Stat
48: 3 Task
49: 4 Template
50: 1 View
51: 1 Views
52: 4 VirtualSwitch
53: 1 VIServer
54: 1 VIToolkitVersion
55: 8 VM
56: 4 VMGuest
57: 2 VMHostNetwork
58: 1 VMHostStorage
59: 2 Session
60: 3 CustomField
61: 3 VMHostNetworkAdapter
Supposedly there was going to be a PSDrive provider as well but I don’t see it anywhere. Maybe it’ll turn up.
No, seriously! I’ve never written anything longer than a lengthy blog post or maybe a two-page email. Now’s my chance to shatter that record. Anybody who knows me has heard me say before that I have zero creativity. Luckily, that’s not required when writing a technical manual. :D We’ll see how it goes.
Anyway, the book is to be published by Sapien Press. I’m not saying when the book will be ready at this point because I have no clue how these things work. I guess it is safe to say, “this year”. Hopefully, well inside of that time period.
If you read my blog, you probably know my current passions are PowerShell and VMware. Well, it should come as no surprise that the working book title is: Managing VMware Infrastructure with PowerShell: TFM. I’m really excited about the project and I hope it turns out well. And if nothing else it’ll be good fuel for a fire. Win-win for everyone!
Wish me luck, and may God grant my wife patience!
[20:06:34] <Twitter> cnnbrk: Barack Obama wins the Mississippi Democratic primary, CNN projects.
[20:18:06] <Twitter> cnnbrk: Correction: Exit polls show Obama leading Clinton in Mississippi. CNN has not projected this race.
Follow up!
[20:43:19] <Twitter> cnnbrk: CNN projects that Sen. Barack Obama will win the Mississippi Democratic primary
I guess they changed their minds back.
Very cool-looking tool! From the site:
What is Start++?
Start++ is an enhancement for the Start Menu in Windows Vista. It also extends the Run box and the command-line with customizable commands. For example, typing “w Windows Vista” will take you to the Windows Vista page on Wikipedia!
And now, some screenshots:
(thanks to Trent, a Lifehacker commenter)
NIN did a Radiohead the other day, releasing their album (well, the first 9 tracks) for free. When you go to the site and register, you receive an email with a download link. The link is to a zip file, and the archive contains 9 MP3s encoded at 320kbps bitrate (which is very high). In addition–and this is very cool–there is an extras folder which contains 11 large images suitable for desktop wallpaper. They are provided in normal 4;3 ratio and widescreen format. There’s also 22 images in various other sizes useful for putting on your website, like you see to the right.
If you click on the image, you’ll see the various options for ordering the album which include:
I really don’t think you can consider this an experiment anymore.
I’m listening to the tracks now. So far it’s instrumental. I’m not sure if there are any lyrics at all. Could be just the first volume (the 9 tracks) is all instrumental. I’ll probably grab the $5 version later.
My long reply to a long reply was getting a bit…long, so I thought I’d move it here. Much easier to do the editing in Live Writer anyhow.
You can find the original article and several comments from myself and the author at this blog post: Why PowerShell, Servermanagercmd and co. don’t really rock on the command prompt. I recommend you read the article, it’s a nicely-worded opinion piece. The article deals with the author’s frustrations with Server 2008 command-line utilities (which I agree with) but he then extends those opinions on to PowerShell. I’m making the point that PowerShell addresses most if not all of his frustrations. He also goes into reasons why he thinks the GUI is generally superior for any task, which I also disagree with. (Lots of dangling prepositions today.)
My reply continues below:
Well, the PowerShell rebuttal to ‘difficulty in memorizing commands’ is handled by a cmdlet called “get-command”, and the enforced (by Microsoft’s Common Engineering Criteria internally) consistent naming convention for cmdlets and other related interfaces such as PS Providers. For example, say you want to do something with a mailbox in exchange. You already know the noun you are dealing with–it’s a mailbox. So you type “get-command *mailbox” or “get-command -noun mailbox” and you’ll get several matches. To go a step higher, say you know you want to do something with VMware but you forgot how to connect to the auth server and you have no idea if the verb (the part before the dash) is even called ‘connect’. In a case like that you would use “get-command -pssnapin v*”. That will return all cmdlets which are contained within any snapin which starts with the letter V.
On top of all that, there’s some great IDEs and enhanced editors and graphical consoles whicih make all of this even easier. You can tet real visual studio-like Intellisense on filenames, cmdlets, parameters, .NET types, WMI classes…I certainly can’t memorize every WMI class, but I can type “get-wmiobject win32_net” and hit TAB and voila, there’s a dozen answers popped up in a listbox.
In answer to your point that “The number of software vendors offering tools for administrators has been growing dramatically in the last years.”: I would say YES–and PowerShell is/will be largely seen as responsible for accelerating that trend. VMware, Citrix, IBM and many more vendors are starting to provide PowerShell hooks.
And lastly, of course GUIs are more prone to mistake! How many times have people accidentally clicked on shutdown when they meant logoff (before the start menu was rearranged in what…2003)? I mean…seriously, I could go on and on. GUI accidents could be blamed for spyware installs, too.
If I’m about to make a change in a production environment which may have adverse affects, best practice wisdom would say (yeah, I know that’s like saying “they say” but hear me out) you should make a change plan and a backout plan. You are already doing things to a high level of detail, you might as well script the whole thing. This allows you to not only automate the change, but to validate the change, and if necessary, reverse it. This applies doubly so if you are not the person to make the change. Maybe you are the lead admin delegating a task off to a junior admin or an offshore resource. you tell them:
Run this script, wake me if stuff starts blowing up!
Head over to powerscripting.net to listen to our latest episode. This week’s show: