#FEATURE by Stefan Reise
added: #executePowershellCommands:outputTo:
comment/format in: #executePowershellCommands:
--- a/Win32OperatingSystem.st Mon Nov 11 20:51:07 2019 +0100
+++ b/Win32OperatingSystem.st Thu Nov 14 14:03:19 2019 +0100
@@ -8148,6 +8148,39 @@
"Modified: / 21-11-2012 / 12:14:06 / anwild"
!
+executePowershellCommands:someCommands
+ outputTo:output
+
+ "
+ |output|
+
+ output := '' writeStream.
+
+ self
+ executePowershellCommands:(Array with:'dir')
+ outputTo:output.
+
+ output contents inspect.
+ "
+
+ |input|
+
+ input := '' writeStream.
+ input nextPutAll:'powershell -noprofile -noninteractive "'.
+
+ someCommands do:[:eachCommand |
+ input nextPutAll:((eachCommand subStrings:$") asStringWith:'\"').
+ ].
+
+ input nextPutAll:'"'.
+
+ OperatingSystem
+ executeCommand:input contents
+ outputTo:output.
+
+ "Created: / 14-11-2019 / 13:31:43 / Stefan Reise"
+!
+
getAllProcesses
"answer a sequence of OSProcess, all processes running in system"