PowerShell for Windows Admins

May 6 2013   9:27AM GMT

Scripting Games–major dislike #2

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

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

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: