I am very happy to announce that I’ve taken a new job with Splunk! I’m going to be a Solutions Architect working in their Business Development Partner Application Development team for my buddy Brandon Shell. As a part of my new role, I will be using Python (and PowerShell wherever I can fit it in) to help to create solutions around our areas of focus. There will be VMware stuff for sure, and some other cool technologies as well that I’m very interested in. More news as I figure out what they are. ![]()
The job is 100% working from home, which is awesome. I’m glad to get back to that after several years of braving Atlanta traffic. (I had worked for HP from home for a while.) You know what else is great about this new job? I won’t be on call 24×7! Very glad to ditch the pager! (Not to say that I won’t return your calls, Brandon.
, just not while I am asleep.)
I’m all set to start Feb 13th!
A workflow is a sequence of automated steps or activities that execute tasks on or retrieve data from one or more managed nodes (computers or devices). These activities can include individual commands or scripts. Windows PowerShell Workflow enables, IT pros and developers alike, to author sequences of multi-computer management activities — that are either long-running, repeatable, frequent, parallelizable, interruptible, stoppable, or restartable — as workflows. By design, workflows can be resumed from an intentional or accidental suspension or interruption, such as a network outage, a reboot or power loss.
I just had to paste this paragraph. It comes from the recently published “Getting Started with PowerShell Workflow” as announced in this post on the PowerShell team blog. You can grab the PDF from the WMF3 CTP2 download page.
Hot stuff! Go grab the 14 page doc so you can be ready for when v3 ships! There are a ton of examples so that you get started quickly.
Disclaimer: this is pre-release code and will definitely change
So I’m sitting here building a bunch of virtual machines using PowerCLI. I decided to start with a spreadsheet into which I’ve collected many of the important things about a virtual machine:

Since I don’t actually build VMs every day, and I haven’t focused on a build process (like I should, I know!) yet, this spreadsheet was a first draft of a build process and it was made for humans, not machines. What does this mean? Well, obviously, by looking at the Memory column, any of you would guess that the unit of measurement is gigabytes. However, VMware happens to measure memory in megabytes.
Long story short, I wrote a quick one-liner in PowerShell to “spec out” the newly-cloned virtual machines using this spreadsheet. As I said, it’s not a build process yet, but it will be when I’m done. Baby steps. The one-liner looks like this ($t is the variable that holds the data obtained from the spreadsheet, using a simple Import-Csv cmdlet):
1: $t | % { Set-VM -VM $_.name -NumCpu $_.cpu -MemoryMB $_.Memory }
Once I started that running, I quickly realized that 8MB VMs would do me no good.
So, I amended my script to this:
1: $t | % { Set-VM -VM $_.name -NumCpu $_.cpu -MemoryMB ( $_.Memory * 1024 ) }
That’s when I got a really weird error:
Set-VM : Cannot bind parameter ‘MemoryMB’. Cannot convert value "888888888888888888888888888888888888888888888888888888
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
888888888888888888" to type "System.Int64". Error: "Value was either too large or too small for an Int64."
Yuck! That one threw me for a loop for a moment until I realized the important lesson of the day. When you use a technique like Import-Csv, the resulting object is a bunch of strings! What happens when you multiply a string by a number in PowerShell? Yes, it’s effectively a concatenation. So in my case, the number 8 followed by one-thousand-and-twenty-three of the same. Nice, when that’s what you intended. That was not my intent this time!
So to round this post out with a fix, here’s the right way to get the intended result, which was to turn “8” into “8192”:
1: $t | % { Set-VM -VM $_.name -NumCpu $_.cpu -MemoryMB ( [int]$_.Memory * 1024 ) }
Note the “[int]” there before the $_. That will convert the resulting property to an integer BEFORE performing the multiplication. That’s the key here, it has to happen before (in the order of precedence), otherwise I end up with a bunch of 8’s. Now, I happen to know the order of operator precedence in PowerShell well enough to know that the above would work without any doubt, but if you aren’t sure about a particular piece of code, you can always surround a portion of a statement with parentheses in order to ensure that you get the order that you need.
Run, don’t walk to vmware.com/go/powercli to grab the latest version of the world’s best PowerShell snapin. That’s right, v5 is out and you can grab it now! And the coolest part is that while nobody will have vSphere 5 in production on day one (ok, there’s a couple of you out there), PowerCLI v5 is a client-based tool with no dependencies, and it’s downwards-compatible! There is literally no reason for you not to upgrade right this instant! I am using exclamations here, people!
I’ve had beta builds installed for some time, but I didn’t want to do blog posts based on pre-release builds for fear that things would change. Now that it’s out, I’ll start pushing out some posts about what’s new and all that, so stay tuned. For now, some quick stats and info:
There are now FOUR VMware snap-ins installed with PowerCLI v5:
PowerCLI U:\> Get-PSSnapin vmware*
Name : VMware.VimAutomation.Core
PSVersion : 2.0
Description : This Windows PowerShell snap-in contains Windows PowerShell cmdlets for managing vSphere.Name : VMware.VimAutomation.License
PSVersion : 2.0
Description : This Windows Powershell snap-in contains cmdlets for managing License components.Name : VMware.DeployAutomation
PSVersion : 2.0
Description : Cmdlets for Rule-Based-DeploymentName : VMware.ImageBuilder
PSVersion : 2.0
Description : This Windows PowerShell snap-in contains VMware ESXi Image Builder cmdlets used to generate custom images.
There are 293 cmdlets in total across these snap-ins. Here they are, grouped by Noun and Verb:
PowerCLI U:\> $c = Get-Command -Module vmware*
PowerCLI U:\> $c.Length
293
PowerCLI U:\> $c | group verbCount Name Group
—– —- —–
6 Add {Add-DeployRule, Add-EsxSoftwareDepot, Add-E…
3 Apply {Apply-DrsRecommendation, Apply-ESXImageProf…
1 Compare {Compare-EsxImageProfile}
1 Connect {Connect-VIServer}
4 Copy {Copy-DatastoreItem, Copy-DeployRule, Copy-H…
1 Disconnect {Disconnect-VIServer}
1 Dismount {Dismount-Tools}
3 Export {Export-EsxImageProfile, Export-VApp, Export…
1 Format {Format-VMHostDiskPartition}
95 Get {Get-AdvancedSetting, Get-AlarmAction, Get-A…
2 Import {Import-VApp, Import-VMHostProfile}
1 Install {Install-VMHostPatch}
1 Invoke {Invoke-VMScript}
1 Mount {Mount-Tools}
9 Move {Move-Cluster, Move-Datacenter, Move-Folder,…
37 New {New-AdvancedSetting, New-AlarmAction, New-A…
42 Remove {Remove-AdvancedSetting, Remove-AlarmAction,…
2 Repair {Repair-DeployImageCache, Repair-DeployRuleS…
4 Restart {Restart-VM, Restart-VMGuest, Restart-VMHost…
58 Set {Set-AdvancedSetting, Set-AlarmDefinition, S…
1 Shutdown {Shutdown-VMGuest}
4 Start {Start-VApp, Start-VM, Start-VMHost, Start-V…
5 Stop {Stop-Task, Stop-VApp, Stop-VM, Stop-VMHost…}
3 Suspend {Suspend-VM, Suspend-VMGuest, Suspend-VMHost}
1 Switch {Switch-ActiveDeployRuleSet}
3 Test {Test-DeployRuleSetCompliance, Test-VMHostPr…
1 Update {Update-Tools}
2 Wait {Wait-Task, Wait-Tools}PowerCLI U:\> $c | group noun
Count Name Group
—– —- —–
6 DeployRule {Add-DeployRule, Copy-DeployRule, Get-Deploy…
2 EsxSoftwareDepot {Add-EsxSoftwareDepot, Remove-EsxSoftwareDepot}
3 EsxSoftwarePackage {Add-EsxSoftwarePackage, Get-EsxSoftwarePack…
3 PassthroughDevice {Add-PassthroughDevice, Get-PassthroughDevic…
9 VMHost {Add-VMHost, Get-VMHost, Move-VMHost, Remove…
3 VmHostNtpServer {Add-VmHostNtpServer, Get-VMHostNtpServer, R…
2 DrsRecommendation {Apply-DrsRecommendation, Get-DrsRecommendat…
6 ESXImageProfile {Apply-ESXImageProfile, Compare-EsxImageProf…
7 VMHostProfile {Apply-VMHostProfile, Export-VMHostProfile, …
2 VIServer {Connect-VIServer, Disconnect-VIServer}
1 DatastoreItem {Copy-DatastoreItem}
5 HardDisk {Copy-HardDisk, Get-HardDisk, New-HardDisk, …
1 VMGuestFile {Copy-VMGuestFile}
4 Tools {Dismount-Tools, Mount-Tools, Update-Tools, …
9 VApp {Export-VApp, Get-VApp, Import-VApp, Move-VA…
2 VMHostDiskPartition {Format-VMHostDiskPartition, Get-VMHostDiskP…
4 AdvancedSetting {Get-AdvancedSetting, New-AdvancedSetting, R…
3 AlarmAction {Get-AlarmAction, New-AlarmAction, Remove-Al…
3 AlarmActionTrigger {Get-AlarmActionTrigger, New-AlarmActionTrig…
2 AlarmDefinition {Get-AlarmDefinition, Set-AlarmDefinition}
2 Annotation {Get-Annotation, Set-Annotation}
4 CDDrive {Get-CDDrive, New-CDDrive, Remove-CDDrive, S…
5 Cluster {Get-Cluster, Move-Cluster, New-Cluster, Rem…
4 CustomAttribute {Get-CustomAttribute, New-CustomAttribute, R…
5 Datacenter {Get-Datacenter, Move-Datacenter, New-Datace…
4 Datastore {Get-Datastore, New-Datastore, Remove-Datast…
1 DatastoreCluster {Get-DatastoreCluster}
2 DeployRuleSet {Get-DeployRuleSet, Set-DeployRuleSet}
4 DrsRule {Get-DrsRule, New-DrsRule, Remove-DrsRule, S…
1 ErrorReport {Get-ErrorReport}
1 EsxCli {Get-EsxCli}
1 EsxSoftwareChannel {Get-EsxSoftwareChannel}
1 EsxTop {Get-EsxTop}
4 FloppyDrive {Get-FloppyDrive, New-FloppyDrive, Remove-Fl…
5 Folder {Get-Folder, Move-Folder, New-Folder, Remove…
1 HAPrimaryVMHost {Get-HAPrimaryVMHost}
3 Inventory {Get-Inventory, Move-Inventory, Remove-Inven…
4 IScsiHbaTarget {Get-IScsiHbaTarget, New-IScsiHbaTarget, Rem…
1 LicenseDataManager {Get-LicenseDataManager}
1 Log {Get-Log}
1 LogType {Get-LogType}
4 NetworkAdapter {Get-NetworkAdapter, New-NetworkAdapter, Rem…
2 NicTeamingPolicy {Get-NicTeamingPolicy, Set-NicTeamingPolicy}
4 OSCustomizationNicMapping {Get-OSCustomizationNicMapping, New-OSCustom…
4 OSCustomizationSpec {Get-OSCustomizationSpec, New-OSCustomizatio…
2 PowerCLIConfiguration {Get-PowerCLIConfiguration, Set-PowerCLIConf…
1 PowerCLIVersion {Get-PowerCLIVersion}
5 ResourcePool {Get-ResourcePool, Move-ResourcePool, New-Re…
3 ScsiController {Get-ScsiController, New-ScsiController, Set…
2 ScsiLun {Get-ScsiLun, Set-ScsiLun}
2 ScsiLunPath {Get-ScsiLunPath, Set-ScsiLunPath}
4 Snapshot {Get-Snapshot, New-Snapshot, Remove-Snapshot…
1 Stat {Get-Stat}
4 StatInterval {Get-StatInterval, New-StatInterval, Remove-…
1 StatType {Get-StatType}
3 Task {Get-Task, Stop-Task, Wait-Task}
5 Template {Get-Template, Move-Template, New-Template, …
2 UsbDevice {Get-UsbDevice, Remove-UsbDevice}
1 VIAccount {Get-VIAccount}
3 VICredentialStoreItem {Get-VICredentialStoreItem, New-VICredential…
1 VIEvent {Get-VIEvent}
1 View {Get-View}
1 VIObjectByVIView {Get-VIObjectByVIView}
4 VIPermission {Get-VIPermission, New-VIPermission, Remove-…
1 VIPrivilege {Get-VIPrivilege}
3 VIProperty {Get-VIProperty, New-VIProperty, Remove-VIPr…
4 VIRole {Get-VIRole, New-VIRole, Remove-VIRole, Set-…
4 VirtualPortGroup {Get-VirtualPortGroup, New-VirtualPortGroup,…
4 VirtualSwitch {Get-VirtualSwitch, New-VirtualSwitch, Remov…
9 VM {Get-VM, Move-VM, New-VM, Remove-VM…}
4 VMGuest {Get-VMGuest, Restart-VMGuest, Shutdown-VMGu…
2 VMGuestNetworkInterface {Get-VMGuestNetworkInterface, Set-VMGuestNet…
3 VMGuestRoute {Get-VMGuestRoute, New-VMGuestRoute, Remove-…
4 VMHostAccount {Get-VMHostAccount, New-VMHostAccount, Remov…
2 VMHostAdvancedConfigur… {Get-VMHostAdvancedConfiguration, Set-VMHost…
1 VMHostAttributes {Get-VMHostAttributes}
2 VMHostAuthentication {Get-VMHostAuthentication, Set-VMHostAuthent…
1 VMHostAvailableTimeZone {Get-VMHostAvailableTimeZone}
2 VMHostDiagnosticPartition {Get-VMHostDiagnosticPartition, Set-VMHostDi…
1 VMHostDisk {Get-VMHostDisk}
2 VMHostFirewallDefaultP… {Get-VMHostFirewallDefaultPolicy, Set-VMHost…
2 VMHostFirewallException {Get-VMHostFirewallException, Set-VMHostFire…
2 VMHostFirmware {Get-VMHostFirmware, Set-VMHostFirmware}
2 VMHostHba {Get-VMHostHba, Set-VMHostHba}
1 VMHostImageProfile {Get-VMHostImageProfile}
1 VMHostMatchingRules {Get-VMHostMatchingRules}
2 VMHostModule {Get-VMHostModule, Set-VMHostModule}
2 VMHostNetwork {Get-VMHostNetwork, Set-VMHostNetwork}
4 VMHostNetworkAdapter {Get-VMHostNetworkAdapter, New-VMHostNetwork…
2 VMHostPatch {Get-VMHostPatch, Install-VMHostPatch}
1 VMHostProfileRequiredI… {Get-VMHostProfileRequiredInput}
4 VMHostRoute {Get-VMHostRoute, New-VMHostRoute, Remove-VM…
5 VMHostService {Get-VMHostService, Restart-VMHostService, S…
3 VMHostSnmp {Get-VMHostSnmp, Set-VMHostSnmp, Test-VMHost…
2 VMHostStartPolicy {Get-VMHostStartPolicy, Set-VMHostStartPolicy}
2 VMHostStorage {Get-VMHostStorage, Set-VMHostStorage}
2 VMHostSysLogServer {Get-VMHostSysLogServer, Set-VMHostSysLogSer…
2 VMQuestion {Get-VMQuestion, Set-VMQuestion}
2 VMResourceConfiguration {Get-VMResourceConfiguration, Set-VMResource…
2 VMStartPolicy {Get-VMStartPolicy, Set-VMStartPolicy}
1 VMScript {Invoke-VMScript}
3 CustomField {New-CustomField, Remove-CustomField, Set-Cu…
1 DeployImageCache {Repair-DeployImageCache}
2 DeployRuleSetCompliance {Repair-DeployRuleSetCompliance, Test-Deploy…
1 ActiveDeployRuleSet {Switch-ActiveDeployRuleSet}
1 VMHostProfileCompliance {Test-VMHostProfileCompliance}
The Atlanta VMUG is gearing up for its huge annual event at the Georgia World Congress Center this October 24th! You can register for the one-day event at myvmug.org. They have not yet posted the agenda, but one thing that I know they will be have there is me talking about PowerCLI.
I haven’t yet come up with a topic, but you can assume that:
- I’ll talk about PowerCLI
- I won’t bore you
Beyond that is anyone’s guess, but suggestions are welcome. Leave your ideas in the comments below! I’m sure I’ll have a copy or two of some books or training videos to give away, so if nothing else, just show up for a chance at that. ![]()
But seriously folks—this will be a huge event. The VMUG leaders are telling me to expect more than 1,000 attendees. Don’t miss it, register now!
Been using this for work email for over a week and I still really like it. Has a couple minor bugs, is missing a few features that I had in Touchdown. But overall, it is really very good. It is much better than the stock Android Exchange client, that is clear. It does folder management better than TD, and its GUI is a little more pleasing to my eyes. Does not do notes sync, and the task sync seems totally broken for me right now. But email is solid, or I never would have considered using a beta so long. Highly recommended, especially if you never shelled out $ for Touchdown and are only using a stock Froyo/Gingerbread or HTC Exchange client on your Android device.
Here’s a quick bit of code to change the color of PowerShell ISE’s output pane to match the colors used in the powershell.exe console:
$psise.Options.OutputPaneBackgroundColor = "#012456" $psise.Options.OutputPaneTextBackgroundColor = "#012456" $psise.Options.OutputPaneForegroundColor = "#eeedf0"
You can paste these lines into the editor pane and click the run botton to see how it looks. If you like it, add these lines to your ISE profile (notepad $profile) and restart ISE to save the changes.
Just wanted to vent a bit of frustration with System Center Operations Manager this morning. As you can see from the task manager shot below, SCOM (showing its Microsoft Operations Manager roots with the process name) likes to eat memory. I left it running over the weekend on my work PC. Bad idea.
![]()
P.S. Mom, this has nothing to do with you, I promise!
If you have a server that needs to have the same Windows Server features and roles as another system, here’s an easy way to quickly get that done using PowerShell. I did this logged into each server locally, but you could easily use PowerShell remoting to do the same thing.
Step 1: Run PowerShell with ServerManager module:
Step 2: Export list of currently installed features to XML
Get-WindowsFeature | ? { $_.installed } | Export-Clixml \\server\share\features.xml
Step 3: On second server, run PowerShell and import XML
$f = Import-Clixml \\server\share\features.xml
Step 4: Pipe that bad boy into Add-WindowsFeature!
$f | Add-WindowsFeature
Step 5: Restart, if needed
Restart-Computer
That’s it!
I was only able to attend one full day of the show, but it was a pretty productive day for me. I gave a “birds of a feather” session to a packed room on Tuesday that was really well received. That was followed up with meeting with folks from Train Signal, Sapien, Cisco, amd several others. Then, I hung out at the Powershell and Scripting Guys booths for a while. After lunch with Jason Shirk from the Powershell team, I met with Kirk Munro to get the skinny on PowerGUI Pro 3.0. I did record it for the podcast, so look for that to be published to the site very soon.
Speaking of the podcast, I was able to meet some very interesting people who have committed to coming on the show to talk about what they are doing with Powershell! As always, follow our website for show news about upcoming guests.
While taking a break in the Connect Zone, I met up with my MVP lead. Garth put up a short video where we talked about TechEd. I hope you find it interesting, or at least good fodder for making fun of me.
Man, I need to blog more. Spoiled by Twitter!
