Category: PowerShell

  • PowerShell: When iterating directories, PowerShell skips directories with brackets in name

    While writing a short script to find empty directories in my Music folder, PowerShell was skipping directories with brackets ([,]) in the name. Here’s the contents of the directory: E:\TEMP\PsExample> Get-ChildItem Directory: E:\TEMP\PsExample Mode LastWriteTime Length Name —- ————- —— —- d—- 10/31/2021 9:22 AM [bracketempty] d—- 10/31/2021 9:07 AM [brackets] d—- 10/31/2021 9:22 AM…

  • Article on PowerShell Parameter Sets

    Jeff Brown Tech has a nice tutorial on using Parameter Sets in PowerShell. Parameter Sets let you define separate groups of parameters for your functions or cmdlets. How to Write Awesome Functions with PowerShell Parameter Sets Jeff Brown Tech