Search for a file
Mit diesem Skript suchen und finden wir Dateien.
Powershell File – Suche nach Dateien
# Jörn Walter 2017 # www.der-windows-papst.de "`n" write-Host "---------------------------------------------" -ForegroundColor Yellow $filePath = Read-Host "Bitte den Pfad eingeben" write-Host "---------------------------------------------" -ForegroundColor Gray $fileName = Read-Host "Bitte den Dateinamen angeben" write-Host "---------------------------------------------" -ForegroundColor Yellow "`n" if (Test-Path $filePath) { Get-ChildItem -Recurse -Force $filePath -ErrorAction SilentlyContinue | Where-Object { ($_.PSIsContainer -eq $false) -and ( $_.Name -like "*$fileName*") } | Select-Object Name,FullName,CreationTime,LastWriteTime,LastAccessTime | format-Table * -AutoSize write-Host "------------Ergebnis Ende--------------------" -ForegroundColor Green } else { write-warning -Message "--------Pfad existiert nicht ----------------" }