[{"id":"b632128e.f06da","type":"tab","label":"Flow 4","disabled":false,"info":""},{"id":"c0046030.63221","type":"function","z":"b632128e.f06da","name":"Powershell E-Mail Versand","func":"var input= msg.payload;\n\n\n\nvar send='param($To = \"chris71@test.com\",$Subject =\"Test Node Red\",$Importance=\"1\")' + \"\\n\" + \n'$htmlBody = \"<h5>'+ input +'Hello\"' + \"\\n\" +\n'Function Send-Mail($Importance, $Subject, $Body, $To, $CC, $Source, $BoolAttachments, [Array]$Dateien) ' + \"\\n\" + \n'{' + \"\\n\" + \n'Try {'+ \"\\n\" +\n'$o = New-Object -ComObject Outlook.Application' + \"\\n\" + \n\n '$mail = $o.CreateItem(0)'+ \"\\n\" + \n '$mail.importance = \"$Importance\"' + \"\\n\" + \n '$mail.subject = \"$Subject\"' + \"\\n\" + \n '$mail.HTMLbody = \"$Body\"'+ \"\\n\" + \n '$mail.To = \"$To\"' + \"\\n\" + \n '$mail.CC = \"$CC\"' + \"\\n\" + \n '$mail.Send()' + \"\\n\" + \n'Start-Sleep 5'+ \"\\n\" + \n'$o.Quit()'+ \"\\n\" + \n'}'+ \"\\n\" +\n'catch {'+ \"\\n\" +\n'$temp = $_.Exception'+ \"\\n\" +\n'$invocationInfo = $_.InvocationInfo.PositionMessage'+ \"\\n\" +\n'if ($_.InvocationInfo -ne $null) {'+ \"\\n\" +\n'write-host $temp'+ \"\\n\" +\n'}}}'+ \"\\n\"+\n\n'function GetFiles( $files )'+ \"\\n\" +\n'{'+ \"\\n\" +\n '$outfileName = $files[$i].Name'+ \"\\n\" +\n '$outfileNameFullname = $files[$i].FullName'+ \"\\n\" +\n '$outfileNameExtension = $files[$i].Extension'+ \"\\n\" +\n \n 'Foreach ( $f in $Dateien) {'+ \"\\n\" +\n 'if($outfileName -eq $f)'+ \"\\n\" +\n '{'+ \"\\n\" +\n '$mail.Attachments.Add($outfileNameFullname);'+ \"\\n\" +\n '}}}'+ \"\\n\" +\n \n'Send-Mail -Importance $Importance `'+ \"\\n\" +\n '-Subject $Subject `'+ \"\\n\" +\n '-Body $htmlBody `'+ \"\\n\" +\n '-To $To `'+ \"\\n\" +\n '-CC $cc `'+ \"\\n\" +\n '-Source $FilePath `'+ \"\\n\" +\n '-BoolAttachments $BoolAttachments `'+ \"\\n\" +\n '-Dateien @($Files)'+ \"\\n\" \n\n\n\n\n\nmsg.payload=send;\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":620,"y":460,"wires":[["ae95f9c5.4e7348"]]},{"id":"ae95f9c5.4e7348","type":"file","z":"b632128e.f06da","name":"","filename":"E:\\WebexBot\\Mehrfach\\MehrfachLack3.ps1","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":950,"y":400,"wires":[[]]},{"id":"11e26c2b.cfb3b4","type":"exec","z":"b632128e.f06da","command":"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -executionpolicy bypass \"C:\\Users\\weblack\\Desktop\\MehrfachLack3.ps1\"","addpay":false,"append":"","useSpawn":"true","timer":"","oldrc":false,"name":"","x":640,"y":260,"wires":[["40db19e1.b24408"],["40db19e1.b24408"],["40db19e1.b24408"]]},{"id":"547f44df.602bdc","type":"inject","z":"b632128e.f06da","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"732946G","payloadType":"str","x":260,"y":480,"wires":[["c0046030.63221"]]},{"id":"9bfdd37.b0ec63","type":"inject","z":"b632128e.f06da","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":180,"wires":[["11e26c2b.cfb3b4"]]},{"id":"40db19e1.b24408","type":"debug","z":"b632128e.f06da","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1170,"y":100,"wires":[]}]