Is there a way to get chef to reuse a powershell session or at least decrease the launch time of a new process? A run is spending 2 seconds performing not_if and only_if checks that use powershell (even if the PS code itself is instantaneous). It would be nice to improve this.
Asked
Active
Viewed 42 times
1 Answers
0
Not that I know of, what you see is what you get. If you're interested in working on it, a GitHub issue or pull request would be the right place to discuss.

coderanger
- 52,400
- 4
- 52
- 75
-
I am. Any suggestions on a safe way to do this? Can you point me to the source for powershell_script? – Jeff Jul 08 '16 at 14:45
-
The provider code is in https://github.com/chef/chef/blob/master/lib/chef/provider/powershell_script.rb but you'll want to check out a bunch of other referenced stuffs, like a lot of the logic is in base classes and mixins. As for how to do this, I can't think of anything. You would probably have to run some kind of powershell daemon and reuse it across multiple execution. This sounds like a bad idea so you'll have to go pretty far to show it is safe. – coderanger Jul 08 '16 at 19:12