PowerShell
john at mcngroup.net
john at mcngroup.net
Fri Sep 30 14:49:59 PDT 2022
John
Thanks for your email.
That sounds like the same thing I have been working on.
We have a script that runs fine on the command prompt but it won't attach
files yet.
So we designed a script that works from PowerShell and attaches the file but
I cannot pass that through windows.
I assumed that I needed to send a system command through filepro
System "PowerShell" to open it then follow it up with the string script
Did not work so I tested it with a simple command that should run
System "PowerShell" {"dir > \testlib.txt" to create a directory list.
That does not pass through filepro either.
I have no problem paying Jason or you to get a sample.
Would that be possible?
John McNaughton
MCN Group, Inc
Pres/Broker/LCAM
1400 22nd Ave North
St Petersburg FL 33704
727-321-6783 Office
727-656-6507 Cell
-----Original Message-----
From: john at timescape.com <john at timescape.com>
Sent: Friday, September 30, 2022 3:12 PM
To: john at mcngroup.net; filepro-list at lists.celestial.com
Subject: RE: powershell
Yes, a powershell script can be run using the SYSTEM command. Jason Garner
wrote me a great PS script that would take passed parameters from my
processing table and run them within the PS script. I pass the info for a
complete mail message (To:, From:, Subject:, Body:, etc.) and his script
sends it to an smpt server. It works great...
Passing the parameters from filePro takes a considerable amount of time to
do correctly. As always, the syntax is very, if not extremely picky! You
must get the apostrophes, quotes, parentheses and all that exactly right or
you will go crazy for a long while. Eventually, I made a one field filePro
file with the field being about 500 characters long. Then I ckept
generating the SYSTEM command into a free record in this file, so I could
look at *exactly* what filePro would be handing to Powershell. You need to
look up some parameters for PS itself like -executionpolicy and bypass, some
others that will make is so powershell will actually run the script you are
intending to run.
It certainly does work, but the first one you do... well it will take some
frustrating testing to pass exactly what is required.
JJE
P.S. Incidentally, I actually run the whole Powershell script thing from a
SYSTEM command running on SCO OS5, and more recently CENTOS7. Since people
are logged in through a terminal emulator to the *nix server, I must use a
terminal ESCAPE to send the actual full SYSTEM command to the Windows
environment running the terminal emulator. Probably not a lot of call for
this, but in case anyone wants to get Windows to do lots of things from
within a filePro .prc table, it's as easy as ever with Powershell.... which
by the way is a fantastic hybrid of mostly pure UNIX and very little Windows
Batch scripting. You will feel like you are writing a *nix shell script!
Good luck.
-----Original Message-----
From: Filepro-list
<filepro-list-bounces+john=timescape.com at lists.celestial.com> On Behalf Of
JohnMac via Filepro-list
Sent: Friday, September 30, 2022 6:14 AM
To: filepro-list at lists.celestial.com
Subject: powershell
Have a script that needs to run from powershell
Is there a way to use the system command or other process to access and run
it from powershell?
John McNaughton
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mailman.celestial.com/pipermail/filepro-list/attachments/20220930/34
c1cb48/attachment.html>
_______________________________________________
Filepro-list mailing list
Filepro-list at lists.celestial.com
Subscribe/Unsubscribe/Subscription Changes
http://mailman.celestial.com/mailman/listinfo/filepro-list
More information about the Filepro-list
mailing list