In an attempt to clear my coding style, I played with splatting (knowing how much backtick I don't like), so we get something like this
$splat = @{
"ResourceGroupName" = $ResourceGroupName
"Location" = $location
"WhatIf" = $true
"ErrorVariable" = "err"
"ErrorAction" = "SilentlyContinue"
}
New-ResourceGroup @splat
What always seemed unnatural to me, I don't like the options in front of the cmdlet. It annoys me!
So I'm curious why this can't / doesn't work. (and can this be done)
New-ResourceGroup @{
"ResourceGroupName" = $ResourceGroupName
"Location" = $location
"WhatIf" = $true
"ErrorVariable" = "err"
"ErrorAction" = "SilentlyContinue"
}
Which seems a lot more natural to me. Is there any way to do this? or am I forever doomed to put a cart before a horse ...
edited to add
If there is no answer to this question, I posted a Uservoice proposal - feel free to go and vote for it,
source
share