# Get-ChildItem (gci) is PowerShell's dir equivalent.# -File limits the output to files.# .BaseName extracts the file names without extension.(Get-ChildItem -File).BaseName | Out-File files.txt
# Set the output file path$outputFile = "filelist.txt"# Get the list of files$files = Get-ChildItem -Recurse -Force# Write the file names to the output file$files | ForEach-Object { Add-Content -Path $outputFile -Value $_.Name }