atfrys
Hot Shot
Hot Shot

Closing powershell connections after a script is ran

Jump to solution

I have a job that runs a workflow that opens up a powershell connection, queries a SQL table, if nothing to do, closes the powershell session and again waits one minute and starts again.  My issue is I keep seeing the memory of my powershell host go up and up.  Not sure why the close session is not killing my winRM session.  The powershell script exits properly, but each time the workflow runs it creates a new WinRM plugin process eating up all the memory.  I also noticed I am re-using the same powershell ID for each iteration.  Is this a bug or a feature?

Thank you

-Stephen

0 Kudos
1 Solution

Accepted Solutions
Burke-
VMware Employee
VMware Employee

Why not just map the SQL table using the SQL plug-in and query there instead of going through PowerShell ???

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter

View solution in original post

0 Kudos
2 Replies
Burke-
VMware Employee
VMware Employee

Why not just map the SQL table using the SQL plug-in and query there instead of going through PowerShell ???

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
0 Kudos
atfrys
Hot Shot
Hot Shot

Thats what I ended up doing.  Turned out to be a lot less code 😉

0 Kudos