4 ms·
Point being that it's easy to write a script that works fine on v3/4 but fails when run on v2, without doing something incredibly obvious like using cmdlets or
by tbyehl 12y ago
Point being that it's easy to write a script that works fine on v3/4 but fails when run on v2, without doing something incredibly obvious like using cmdlets or modules that didn't ship with v2. Here is a by-no-means-comprehensive list of potential gotchas:
• Operation Statements vs Script Blocks
• Several new operators
• Changes to $PSScriptRoot and $MyInvocation
• Stop parsing symbol --%
• Ordered dictionaries
• New redirection operators
• Count and Length properties added to "arrays" of zero or one
• Retrieving a property from a collection that only exists in the individual items returns the value from all items.
• BadNumericConstant