# HG changeset patch # User sr # Date 1573736599 -3600 # Node ID 77318c4b1205984e6c0d8b5f2bf13eb09ca21ab8 # Parent 737da1130d4c69e21cc855bde6a4a56e51163228 #FEATURE by Stefan Reise added: #executePowershellCommands:outputTo: comment/format in: #executePowershellCommands: diff -r 737da1130d4c -r 77318c4b1205 Win32OperatingSystem.st --- 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"