$folderPath = "S:\GDT-PhysioPort"
$fileName = "epat.gdt"
$newFileName = "vitaepat.gdt"
while ($true) {
# Check if the file exists in the specified folder
if (Test-Path (Join-Path $folderPath $fileName)) {
# Rename the file
Rename-Item (Join-Path $folderPath $fileName) (Join-Path $folderPath $newFileName)
Write-Host "File '$fileName' found and renamed to '$newFileName'."
}
# Wait for 5 seconds before checking again
Start-Sleep -Seconds 5
}