Reminders

  • % => alias for foreach-object
  • $_ in a foreach-object is current item
  • get-member => object introspection
  • String interpolation:

    • "blaaa $myvar", "blaaaa$($myobjVar.name)"
    • No string expansion: '$blaaa'

Common batch operations

  • Get all items in a directory: Get-ChildItem *
  • Get all subdirectories: Get-ChildItem -Attributes Directory -Recurse
  • Operate foreach files in directory: Get-ChildItem *.docx | % Name