Contents tagged with PowerShell cmdlet

  • Some power shell notes

    Hello everybody,

    today I want to share few words about powershell usage. 

    So, recently I've got some tasks which is related to usage of powershell scripts in order to automate some execution.

    One of discoveries in PowerShell for me was pipelining with usage of Where-Object. Consider following example:

    Get-ChildItem | Where-Object {$_.Name.Length -gt 10 }

    It has two parts: Get-ChildItem and Where-Object.

    Get-ChildItem will get all items in directory, and pipeline them into WhereObject, which in turn will produce as output those, which has Name longer then 10 characters. 

    Another interesting part of pipelines is that you can pipeline objects from one to another. Consider code … more