This code should go though all top level directories in the current directory, executing a temp file check and if none exist it moves the directory.

```
$processDirectories = {
    foreach ($childDirectory in Get-ChildItem -Force -Directory) {
        test-path "$childDirectory\*.tmp"
        move-item -LiteralPath "$childDirectory" -Destination "d:\"
    }
}

```

I don't know how to stop running the code for directories where `*.tmp` is found. Plus this method only checks the root of each subdir for `*.tmp` and not the entire tree within.