I am trying to run a powershell command to get the system date. In a windows command line you type this:
powershell -command (date).ToString('yyyyMMddhhmmss')
It outputs the current time in the required format. However stashing this into ruby code filter after escaping the single-quote causes error.
ruby {
code => 'event.set("ctime", `powershell -command (date).ToString(\'yyyyMMddhhss\')`)'
}
I get the following error:
