Michael B.

Results 10 comments of Michael B.

Because more cmdlets don't follow the (good, IMO) example of Get-Command, this has become my scripting pattern: ``` try { $result = Get-Something -EA 0 if( $? ) { if(...

You left the style necessary for complex cases. For example ``` switch( $condition ) { { $_ -eq 'a' -or $_ -eq 'b' } { Statement1 } { $_ -gt...

We also have unary "-" and unary "++". I use "!" far more often than I use "-not". And outside of the unary space, we have ternary and null-coalescing operators....

> On the other hand all boolean operators are "named" so it makes sense to me that way. Either way, you should be able to enforce consistent operator usage. Nothing...

> Maybe I'm just weird but I don't like using `-Not` because it's the only "named" operator you place at the start of a statement instead of the middle or...

The whole point behind PSScriptAnalyzer is to indicate parts of scripts which do not follow best practices. Which is why we are having the discussion as to whether your suggestion...

Does this need an RFC as @JamesWTruher sort-of suggested?

Wirth taught me 35 years ago that "best" was the death of progress. That's why he kept designing new languages. :-) That's why I suggested what I thought would be...

Dave Wyatt wrote a using-object in 2014. I still use it heavily: https://davewyatt.wordpress.com/2014/04/11/using-object-powershell-version-of-cs-using-statement/ - but yes, it suffers from some of the challenges you mention and isn't as flexible. I...