Anyone using PowerShell on Windows 10 out there? Maybe you can help me figure 
this out.

I am upgrading an old v13 database to v17. My ultimate goal is to have 
everything run-in 64bit.

The database talks to QuickBooks on a Windows 10 machine using an XML stream in 
a Powershell script file executed with PowerShell by LEP.

 I have successfully upgraded all of 4D to run successfully 64 bit, but have am 
unable to get v17R3 or R4 64bit client to work successfully with 64bit 
PowerShell…


4D                Server             Client              PowerShell             
    Result
v17R3            64                     32                      32              
              OK
v17R3.           64                     32                      64              
              OK

V17R3            64                    64                       32              
              OK
V17R3            64                    64                       64              
               X  

I am pretty sure that the PowerShell script is not being executed because 
QuickBooks is not receiving a call. What changes with 64Bit 4d client that 
could possibly be preventing the PowerShell Script from executing?  

I have posted the applicable code and ps script below.

Thanks,

John     

----------------
Here is what the LEP call looks like…

ScriptPath:=$1
$4D_Folder:=Get 4D folder(Active 4D Folder)
$FileID:=String(Milliseconds)+"-"+String(Random)

Case of
 :  (32bit). //pseudo code
        
$FilePath:="C:\\Windows\\sysWoW64\\WindowsPowerShell\\v1.0\\powershell.exe 
-file \""+$ScriptPath+"\”"

 :  (32bit)
        
$FilePath:="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe 
-file \""+$ScriptPath+"\""
        
End Case

$OutputStream:=$3
$ErrorStream:=$4
$XMLOutBlobPtr:=$5
  //set the environmentals and launch the external process
SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE";"true")
SET ENVIRONMENT VARIABLE("_4D_OPTION_BLOCKING_EXTERNAL_PROCESS";"false")
SET ENVIRONMENT VARIABLE("_4D_OPTION_CURRENT_DIRECTORY";$4D_Folder)
  //SET ENVIRONMENT VARIABLE("_4D_OPTION_INPUT_STREAM";"I"+$FileID)
SET ENVIRONMENT VARIABLE("_4D_OPTION_OUTPUT_STREAM";"O"+$FileID)
SET ENVIRONMENT VARIABLE("_4D_OPTION_ERROR_STREAM";"E"+$FileID)
SET ENVIRONMENT VARIABLE("_4D_OPTION_STOP_TOKEN";$FileID)
LAUNCH EXTERNAL PROCESS($FilePath)
—————————

———————
The PowerSrcipt script looks like this…

[String]$requestXML = '<?xml version="1.0" ?>
<?qbxml version="2.0"?><QBXML>
<QBXMLMsgsRq onError="stopOnError">
<CompanyQueryRq requestID="1">
</CompanyQueryRq>
</QBXMLMsgsRq>
</QBXML>'
$myQBXMLRP = New-Object -com QBXMLRP2.RequestProcessor
$myQBXMLRP.OpenConnection2("qb4D","CCFolioPro",1)
$ticket = $myQBXMLRP.BeginSession("C:\Company Files\Cadinha & Co., 
LLC.QBW",$myQBXMLRP.qbFileOpenDoNotCare)
$myQBXMLRP.ProcessRequest($ticket, $requestXML) > $env:_4D_OPTION_OUTPUT_STREAM
$myQBXMLRP.EndSession($ticket)
$myQBXMLRP.CloseConnection()
"Stop" > $env:_4D_OPTION_STOP_TOKEN

-------------------


John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com

**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to