jmckune Posted April 2, 2018 Report Share Posted April 2, 2018 I have a PowerShell script that creates a text file, that I will subsequently email via MEP. I want to kick the PowerShell script silently from MEP. I have read that I cannot embed PowerShell scripts in MEP, but does anyone know how to silently kick-off a PowerShell script from MEP? Quote Link to comment Share on other sites More sharing options...
Samrae Posted April 2, 2018 Report Share Posted April 2, 2018 You could put the commands to run the PowerShell script into a batch file and run it from Macro Express Pro using the Program Launch command. A quick Google search turned up this example of how to run a PowerShell script in a batch file: Powershell.exe -executionpolicy remotesigned -File C:\Users\SE\Desktop\ps.ps1 Quote Link to comment Share on other sites More sharing options...
Cory Posted April 2, 2018 Report Share Posted April 2, 2018 Good trick Samrae! Quote Link to comment Share on other sites More sharing options...
rberq Posted April 2, 2018 Report Share Posted April 2, 2018 From Samrae's example -- would this work, to launch it directly from ME without a batch file? Program Launch: "Powershell.exe" Quote Link to comment Share on other sites More sharing options...
Cory Posted April 3, 2018 Report Share Posted April 3, 2018 It probably isn't relative but one thing to bear in mind is that PS is by default, Unicode and MEP is ASCII/ANSI. I remember I was doing something in PS with MEP and I found a workaround by reading every other character. Unicode is 16bit so as long as the characters were still in the ACSII set, this trick worked. Someone once suggested that PS file encoding output could be modified to be ASCII. Set-Content cmdlet with '-Encoding ASCII' it might have been. But that was long ago. Quote Link to comment Share on other sites More sharing options...
Cory Posted April 3, 2018 Report Share Posted April 3, 2018 Consider using the Windows Task Scheduler. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.