Powershell e System.IO.FileSystemWatcher

Eu sou novo no PowerShell e estou tentando usar o System.IO.FileSystemWatcher para monitorar a presença de um arquivo em uma pasta especificada. No entanto, assim que o arquivo for detectado, desejo interromper o monitoramento desta pasta imediatamente e interromper o FileSystemWatcher. O plano é incorporar o script do PowerShell em um SQL Agent para permitir que os usuários restaurem seus próprios bancos de dados. Basicamente, preciso conhecer o comando para impedir o FileSystemWatcher de monitorar assim que um arquivo for encontrado. Aqui está o script até agora.

### SET FOLDER TO WATCH + FILES TO WATCH + SUBFOLDERS YES/NO
    $watcher = New-Object System.IO.FileSystemWatcher
    $watcher.Path = "C:\TriggerBatch"
    $watcher.Filter = "*.*"
    $watcher.IncludeSubdirectories = $true
    $watcher.EnableRaisingEvents = $true  

### DEFINE ACTIONS AFTER A EVENT IS DETECTED
    $action = { $path = $Event.SourceEventArgs.FullPath
                $changeType = $Event.SourceEventArgs.ChangeType
                $logline = "$(Get-Date), $changeType, $path"
                Add-content "C:\log2.txt" -value $logline              
              }    

### DECIDE WHICH EVENTS SHOULD BE WATCHED + SET CHECK FREQUENCY  
    $created = Register-ObjectEvent $watcher Created -Action $action

while ($true) {sleep 1} 

## Unregister-Event Created ??
##Stop-ScheduledTask ??

questionAnswers(2)

yourAnswerToTheQuestion