I have been using Powershell for a day now and I need to return the file name for each file in a folder using a loop. Here is what I currently have:
$filePath = 'C:\Users\alibh\Desktop\Test Folder' #the path to the folder
cd $filePath
Get-ChildItem $filePath |
ForEach-Object{
$fileName = "here is where I return the name of each file so I can edit it
later on"
}
I want to compare the names of the different files in the folder and edit or delete files later on; but before I can get to that, I first need to be able to get the name of each file one after another.
Edit: thanks a lot guys