header image

Scripting Games–major dislike #2

Posted by: | May 6, 2013 | No Comment |

I’ve already blogged about incorrect use of backticks.  Here is another example of un-necessary use of backticks

$Files= Get-ChildItem `
        -Path $Path `
        -include $Type `
        -Recurse `
        -File |
Where-Object {$_.LastWriteTime -lt (get-date).AddDays(-$OlderThan) }

Spreading out one parameter per line like this doesn’t add anything to the script and makes working on the get-childitem cmdlet code harder if you want to change it.

Don’t do this

under: PowerShell original, Scripting Games