Automating the world one-liner at a time…
One of the cornerstone features of System Center Virtual Machine Manager (SCVMM) is PowerShell. They have built their entire GUI layered on top of PowerShell in the same way that Exchange 2007 did. A little while ago, I talked to Rakesh Malhotra (the Group Program Manager for SCVMM) about how things were going and he was very pleased with their bet on PowerShell. He talked about how their task-oriented Cmdlets provided a very user approachable scripting experience. I asked him for a few examples so he sent me a set of comparisons with VMWare's scripting experience (the VMWare script came from their website: http://www.vmware.com/community/thread.jspa?messageID=348638񕇞 ).
$vms = Get-VM | where {$_.VMState –eq 'Running'}$vms | Get-DVDDrive | Set-DVDDrive –NoMedia $vms | Get-FloppyDrive | Set-FloppyDrive –NoMedia
Take a minute and compare the 2 scripts and ask the following questions:
I think you'll find different answers for the different scripts.
Cheers!
Jeffrey Snover [MSFT]Windows PowerShell/Aspen ArchitectVisit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShellVisit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
1) Aliases can map to anything not just cmdlets that is why the parameter name is -VALUE
2) We should have REMOVE-ALIAS. Full stop. We prioritized other features. The way you do it is:
Remove-Item Alias:name
I'd appreciate the details for #4. V2 should run V1 scripts with perfect fidelity modulo bug fixes.
jps
Hi Jeffrey,
I installed SCVMM 2008 R2, but I couldn't find the cmdlet Get-DVDDrive as you used in your article. Can you please give me some pointers on how to use the powershell scripts shipped with SCVMM?
Thanks,
Weidong