Forum Discussion
MP21260
May 19, 2022Copper Contributor
Data from Excel file to find specific files in folder
Hello, I'm trying to include data from specific ranges (contain files names) in a worksheet from Excel file in order to find this data in folders. After many searches, I couldn't get the way to ...
Alan2022
May 24, 2022Iron Contributor
HI MP21260
# Get the List of Files base on Location
$files = Get-ChildItem "$($env:USERPROFILE)\Desktop\Test Files"
# Loop each files
foreach($file in $files){
# Get File Fullname location & name
$file.Fullname
}
References: https://shellgeek.com/powershell-search-for-files/
MP21260
Jun 02, 2022Copper Contributor
Hi Alan2022,
thank you for replying but I couldn't understand.
How can I put these command lines into the initial script ?
Thank you again.
Math
thank you for replying but I couldn't understand.
How can I put these command lines into the initial script ?
Thank you again.
Math
- Alan2022Jun 02, 2022Iron Contributor
MP21260
Can you explain more what you really want to do?
Get List of Data via Columns in Excel.# Install-Module -Name ImportExcel -Scope CurrentUser # Get Data from Excel column Header FileName $datas = Import-Excel "C:\...\TestFile.xlsx" foreach($data in $datas){ $data.FileName }
# List all the files within a folder
$files = Get-ChildItem "C:\...\Folder" # Loop each files foreach($file in $files){ # Get List of Files $file.Fullname }
With this you can now compare the list of filename from excel & folder list.