extract powershell commandline arguments from C#


hello there,

i have list of powershell commandline executions windows log events such this:

powershell.exe -command "scrip instructions.."-mta -noexit .....

i have script via regex extracts each pair of arguments each script:

  • command = "stuf..."
  • mta = true
  • noexit = true

it applies machine learning find odd powershell executions.

now have realized there several different ways provide arguments or without quotes, shortened vs unshortened regex starting fail , picking spurious data.

i wondering if there class in language automation namespace argument extraction before passing in powershell pipeline can re-use use case.

let me know !

since talking custom application posting in wrong forum.  forum powershell scripts. not development forum.  post your  issues in more appropriate forum better answer.


\_(ツ)_/



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

Failed to delete the test record dcdiag-test-record in zone test.com

Azure MFA with Azure AD and RDS