Get-ChildItem Only Basename

Sometimes you may need to get a list from a folder to a text file but you do not want to include extensions. Here’s a way to do it.

########################################

get-childitem “C:\Temp” | foreach basename | out-file c:\temp\file.txt

########################################

Leave a Reply

Your email address will not be published. Required fields are marked *