$cleanRet=$false#Auf True setzen, wenn die Textdatei jedesmal gelöscht werden soll$searchGo=$true$searchpath=""#Hier den Suchpfad angebenif(!(Test-Path.\Filelist.txt)){Write-Host"Dateiliste nicht gefunden"$searchGo=$false}if(!(Test-Path$searchpath)){Write-Host"Suchpfad nicht verfügbar"$searchGo=$false}if($cleanRet){Remove-Item.\return.txt}if($searchGo){if(!(Test-Path.\return.txt)){New-Item-Name"return.txt"-Path.\-ItemTypeFile}$list=Get-Content.\Filelist.txt#ATM liegt die Filelist im gleichen Ordner, wie das Skriptforeach($itemin$list){$name=$item.Split(".")$name=$name[0]$file=Get-ChildItem-Recurse-Path$searchpath|where{$_.Name-like"$name*"-and!$_.PSIsContainer}Add-Content-Path.\return.txt-Value$file.FullName}}
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.