$fileEntries = [IO.Directory]::GetFiles("C:\Users\U0146121\Desktop\Example Data"); #where the file is located.
foreach($fileName in $fileEntries)
{
#write the file name to a text file.
}
ループ内でファイル名をテキスト ファイルに書き込む必要がありますが、その方法がわかりません。
最終的には、テキスト ファイルを読み取り、Excel でファイル名を検索します。しかし今のところ、最初に .txt ファイルを作成する必要があります。