«

»

Jul 16

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 *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>