Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

get-childitem

Get-ChildItem and non-breaking space

December 17, 2023 by Tarik

As mentioned in the comment, you found an actual error that will hopefully soon being fixed. However, there is a very acceptable workaround that you can apply with minimal effort while continuing to use Get-ChildItem without the need to exclude your folder. The Unicode version of Get-ChildItem does not suffer from this problem. (Tested on … Read more

Categories powershell Tags get-childitem, powershell Leave a comment

How can Get-ChildItem be tested for no results (zero files)?

November 26, 2023 by Tarik

Try wrapping in @(..). It creates always an array: $Files = @(Get-ChildItem $BackupPath_Root -include *.bak -recurse | where {$_.CreationTime -le $DelDate_Backup }) if ($Files.length -eq 0) { write-host ” no files to delete.” } else { .. }

Categories powershell Tags get-childitem, powershell Leave a comment

Use PowerShell to generate a list of files and directories

August 7, 2023 by Tarik

In your particular case what you want is Tree /f. You have a comment asking how to strip out the part at the front talking about the volume, serial number, and drive letter. That is possible filtering the output before you send it to file. $Path = “C:\temp” Tree $Path /F | Select-Object -Skip 2 … Read more

Categories powershell Tags get-childitem, powershell, powershell-2.0 Leave a comment

Limiting Powershell Get-ChildItem by File Creation Date Range

June 2, 2023 by Tarik

Use Where-Object and test the $_.CreationTime: Get-ChildItem ‘PATH’ -recurse -include @(“*.tif*”,”*.jp2″,”*.pdf”) | Where-Object { $_.CreationTime -ge “03/01/2013” -and $_.CreationTime -le “03/31/2013” }

Categories powershell Tags get-childitem, powershell Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa