Hello, I have been running powershell commands through cmd
For example: cmd /C powershell Get-AppPackage
But I have noticed that it takes a lot more time to execute as compared to running the command in powershell itself
So I am wondering if there is a way to run commands in powershell directly to reduce the time it takes to execute
#Running commands in powershell
17 messages · Page 1 of 1 (latest)
PowerShell Start-Process -FilePath <path-to-executable>
I want to run powershell commands though just like in example
Start-Process is a powershell command
just replace it with Get-AppPackage for your example
It does take a few seconds before executing the command
This could be a problem with windows trying to launch powershell maybe
That's why I was thinking why can't we run the commands directly in powershell(through the code)
yeah, but it's powershell itself taking so long to start, not the shell (what i meant in my message) or cmd.exe (from your initial message)
though tbf, cmd.exe tends to be slower to start powershell then starting powershell directly
but since powershell is so slow it's probably not noticable
you could also try the -NoProfile flag to check if your user profile slows it down (mine slows it down quite a lot because i run a few scripts)