Powershell script runs slower in the workspace than in the shell

I have a PS script that I use to track my VMWare ESX servers. I need to run it as a service so that I will not be registered forever. Unfortunately, the script is slower if I use a space inside the service, and not just run the script through the powershell console. It takes 2-5 minutes to make calls to the VMWare web service, not a second or so.

Is there some kind of magic that I should use when I cause a space?

+3
source share
4 answers

You can run the script as a scheduled task.

+1
source

, , , :

  • , PowerShell ( PowerShell -noprofile)
  • , snapin , PowerShell.
  • ?

API 2.0 PowerShell PowerShell.Create() ?

, PowerShell, PoshConsole bgHost CodePlex... , , .

+1

, ? , - , , , script .

0

script , , , , ( runpace, script, ).

( , Set-ExecutionPolicy RemoteSigned ), , PowerShell Windows Services, , , - . - , DNS, ? , , ?

PS: , ServerFault?

0
source

Source: https://habr.com/ru/post/1712320/


All Articles