Quoter Application 4

At my current project we are almost finished with the application migration. But as always that is usually the time the strangest applications pop-up. And again this was the case.

I was asked to publish an application called Quoter. After some analysis the application Quoter seemed to be a single executable called QUOTER.EXE so I published the application in RES Workspace Manager and made it available to my test account on a test server.

Lo and behold the application wouldn’t start. Fortunate for me during my technical test of the application a technical application manager walked in that knew the true function of the executable.  It turns out the application needs to be run with parameters to add quotation marks to the beginning and end off every line in a certain file. He also told me that the executable would only function on a 32-bit platform. The customers new environment is a 64-bit platform.

That was the moment to send Jeff Wouters, I worked with him on a project once, a direct message on Twitter if he knew of a PowerShell one-liner to do what the Quoter application was supposed to do. Within 5 minutes (thanks again Jeff!) I received the following PowerShell one-liner:

Get-content test.csv | foreach {” `”$_`”” | Out-File test2.csv -Append}

I replaced the test.csv with the full path of the input file which I got from the technical application manager and changed test2.csv to the full path of the output file which I also got from the technical application manager. I saved this one-liner as quoter.ps1 and altered my Quoter application publication in RES Workspace Manager to start the PowerShell executable with the full path of quoter.ps1 as the parameter.

Again the application wouldn’t start. I did a quick Google search and added the parameters -executionpolicy bypass -file <full path to quoter.ps1> in RES Workspace Manager. After that the Quoter application (PowerShell script) worked as QUOTER.EXE was intended. The only thing that I needed to adjust was removing a space in the one-liner supplied by Jeff Wouters which resulted in every converted line to start with a space.

So the final version of the one-liner is:

Get-content <path>\pctmutr | foreach {“`”$_`”” | Out-File <path>\output -Append}



4 thoughts on “Quoter Application

  1. Reply Jeff Wouters Mar 22,2013 13:11

    Happy I was able to help 🙂 Good luck with your new website/blog, looks very stylish 🙂

  2. Reply gerben Mar 22,2013 13:59

    Why bypass executionpolicy beter sign the code

  3. Reply alex Mar 22,2013 14:06

    gerben: Last day of the project and the project manager wanted a quick solution to get it working as soon as possible. I agree that signing the code would have been an even better solution. Seeing that I am staying at this customer for one month longer as a technical application manager I can still carry out that better solution. Only on someone else’s budget…

  4. Reply gerben Mar 22,2013 14:32

    most production environments only allow signed ps scripts if they allow them at all. so signing is always the better option. did you know you can compile powershell script to an executable also maybe worth investigating.


Leave a Reply