Apr 20 2022 02:50 AM
I want to use the following command:
Call PowerShell script through CMD
C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe /c D:\\test.ps1 -test
But I ran into a very strange problem. I have two windows hosts I run it on my test machine and it takes only a few hundred milliseconds, but I deploy it on another host with the same configuration and performance, and it takes three seconds to execute!!!!!!!!
As far as I can see, on windows where I deploy the service, every time I start PowerShell, the CPU will be 80-100%.
My system is windows server 2016.
My PowerShell version is 5.1
I hope the great God can answer. Thank you very much.
God is with you.
Apr 21 2022 06:13 AM
@hexler Ok, let's try and zoom in to the real problem ;) If you start PowerShell on the server, just start it without loading a script. How long does that take? What does the script do? And when you already have PowerShell running, it is faster if you start the script? (Should be faster because already in memory)
Apr 24 2022 10:20 AM - edited May 03 2022 10:47 AM
Do you have some more information regarding your issue?
May 14 2022 03:18 AM
May 23 2022 01:04 AM