Mark Minasi's Tech Forum
Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Pieter

Avatar / Picture

Senior Member
Registered:
Posts: 281
Reply with quote  #1 
Is there any way to do something like a preload of powershell.exe ?

I have a monitoring tool that launches PS1-scripts. For every script powershell.exe is started in a new process.
I guess it would work faster and be less RAM consuming if Powershell is already loaded in memory and that the scipts could run in that process.
Possible ?

__________________
Pieter Demeulemeester
0
cj_berlin

Avatar / Picture

Senior Member
Registered:
Posts: 376
Reply with quote  #2 
Hi,

probably not. If your monitoring solution expects an output from those scripts, it would have to invoke the PowerShell host that executed them. Some vendors have a PowerShell Service that always runs and communicates with the monitoring engine via proprietary means.

What you can do to speed up loading is reduce the number of modules that get enumerated on startup. How you would accomplish that will depend on many factors.

What monitoring system are we talking about? Are the scripts being run on some dedicated agent host or on the monitored nodes themselves?

__________________
Evgenij Smirnov

My personal blog (German): http://www.it-pro-berlin.de/
My stuff on PSGallery: https://www.powershellgallery.com/profiles/it-pro-berlin.de/
0
Pieter

Avatar / Picture

Senior Member
Registered:
Posts: 281
Reply with quote  #3 
Monitoring tool =Servers Alive - woodstone.nu, a small, cheap, Belgian (!), and very handy tool.

Many checks are built-in, like diskspace, service status,  etc...
But it is also possible to run a script (CMD, VBS, PS1) and capture the errorlevel that the script returns. The scripts run on the monitoring server.
Cmd.exe or powershell.exe is started for each script, so I end up with several cmd or powershell processes. :-(




__________________
Pieter Demeulemeester
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.