Pergunta

I have a PowerShell script that runs for long periods of time, as scheduled by Task Scheduler. Since this is initiated by Task Scheduler, I cannot see the console or what is being output.

Since Task Scheduler is running it using my account, it appears in Task Manager as a process being run by me. Is it possible to "connect" to this PowerShell process so I can view/interact with it?

Foi útil?

Solução

No, or at least not by default. It may be possible to create a custom host that you can reach into externally but it's not something native to PowerShell. In the not too distant future you'll be able to break into debug mode on demand with long running scripts but that's a Version 5 feature and doesn't totally meet your needs.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top