Search This Blog

Google Analytics

Friday, November 07, 2025

Recursively List All Files with PowerShell

If you are working with PowerShell and need a fast way to list all files in a directory, including those buried in subfolders, this one-liner will work:
Get-ChildItem -Path . -Recurse -File | Select-Object FullName
This script performs a recursive search starting from the current directory (.), finds all files (excluding folders), and outputs their full paths.

Tuesday, October 14, 2025

PowerShell Tip: Bulk Appending File Extensions with One-Liner Magic

Ever found yourself staring at a folder full of files and wishing you could batch append them all with a .txt suffix? PowerShell makes this delightfully simple with a one-liner:
Get-ChildItem -File | Rename-Item -NewName {$_.Name + '.txt'}
To expand further to include files in all sub folders, use below instead.
Get-ChildItem -File -Recurse | Rename-Item -NewName { $_.Name + '.txt' }
If you wish to rollback what you just did, use the following:
Get-ChildItem -Path . -Recurse -File -Filter "*.txt" | ForEach-Object {
    $newName = [System.IO.Path]::GetFileNameWithoutExtension($_.Name)
    Rename-Item -Path $_.FullName -NewName $newName
}
Feel free to replace the txt with a different one based on your needs!

Sunday, March 02, 2025

LTA's Official MRT Map Feb 2025 - With Hume Station

Singapore's Land Transport Authority has just released an updated official MRT map including one additional station on the Downtown Line i.e. Hume Station.

Wednesday, January 08, 2025

Copy directories recursively from source to destination

Robocopy, short for "Robust File Copy" is an advanced command-line utility included in Windows. It's designed to copy files and directories with more features and control than the basic copy commands. If you need to efficiently and reliably replicate a large number of files and folders, Robocopy is your go-to tool.
robocopy source dest /s /e

Popular Posts