Powershell and System.IO.FileSystemWatcher

前端 未结 2 872
清酒与你
清酒与你 2021-01-01 02:05

I am new to PowerShell and I am trying to use the System.IO.FileSystemWatcher to monitor the presence of a file in a specified folder. However, as soon as the file is detec

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-01 02:24

    Unregister-Event $created.Id
    

    This will unregister the event. You will probably want to add this to the $action.

    Do note that if there are events in the queue they will still be fired.

    This might help too.

提交回复
热议问题