Pipeline sequence in PowerShell

Here’s an example of a pipeline sequence in PowerShell — a simple but powerful concept.
Imagine you forgot to clean up your old log files. Or, as I had to do today, you open the dreaded folder 'inetpub/mailroot/Badmail' on a dev server and see thousands of files.
Let’s fix that:
# Get all files in the current directory
Get-ChildItem -File
# or in the specific path Get-ChildItem -File -Path 'C:\logs'
Add condition. Only files older than 30 days
Get-ChildItem -File | Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-30) }
Add action. Remove these files
Get-ChildItem -File | Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-30) } | Remove-item -force