Unregister a registered filewatcher event does not work

╄→гoц情女王★ 提交于 2019-12-05 13:29:55

Ok, looking at what your trying to achieve... to answer your original question, you need to do the following to unregistered the event.

Get-EventSubscriber -SourceIdentifier "filechanged" | Unregister-Event

I have to ask why are you having to make 1000 adjustments to the code. If you are trying to register 1000 different events to be monitored it would make more sense to loop and increment a variable using the ++ modifier.

I have achieved this already if this is what your tying to accomplish and can share some code if you need it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!