I have been using this toolkit for a while now and this is really handy to create a SCCM deployment packages. For the first time I’m facing a requirement very similar to below.
The standard output from a command-line has to be captured. where as -passthru
only allow to display\log only few lines. Example below
PS C:> Execute-Process -Path “$envSystem32Directory\cscript.exe” -Parameters “$envSystem32Directory\slmgr.vbs /dlv” -PassThru
[02-19-2020 01:46:29.764] [Initialization] [Execute-Process] :: [C:\WINDOWS\system32\cscript.exe] is a valid fully qualified path, continue.
[02-19-2020 01:46:29.784] [Initialization] [Execute-Process] :: Working Directory is [C:\WINDOWS\system32].
[02-19-2020 01:46:29.798] [Initialization] [Execute-Process] :: Executing [C:\WINDOWS\system32\cscript.exe C:\WINDOWS\sy
[02-19-2020 01:46:33.109] [Initialization] [Execute-Process] :: Execution completed with exit code .
Microsoft ® Windows Script Host Version 5.8…
Actual standard output can be tested with the below command in cmd.
command: Cscript.exe slmgr.vbs /dlv.
Is there any thing that i could do. !? am I missing anything.!?
your thoughts and suggestions would be much helpfull.