Hi, I'm new to both PowerShell and PowerCLI. I took a 3-day MS Powershell class and didn't see the '@' construct. I saw this on the getting-started page:
Get-VM | Get-FloppyDrive | select @{'n' = 'Name'; 'e' = { $_.Parent.Name} }, @{'n' = 'IsConnected'; 'e' = {$_.ConnectionState.Connected}}
Thanks,
Doug
In this case the @ is used to specify a calculated property.
You specify a name (N) and an expression (E) for the property.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
This link might provide a more detail explanation of splatting
http://technet.microsoft.com/en-us/magazine/gg675931.aspx
Thanks, Luc and Martin. That article at MS had a good explanation. Although, when I think of 'splatting' normally paint comes to mind! 🙂
I don't think that the Select-Object with a calculated property is splatting.
It is an interesting feature in PowerShell, but the example above is not splatting, I'm afraid.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference