The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Powershell code failed to run
#1
The following powershell code can be run successfully in powershell_ISE, but it prompts to load dll error in QM, how to fix it, thanks in advance Heart

Code reference: https://www.example-code.com/powershell/create_json.asp

Because the ChilkatDotNet component does not provide QM programming code, I very much hope to solve the above problem.

I have not tried the C# code example. As far as I know, C# code needs to deal with the quotes and other issues.

Macro PS run
Code:
Copy      Help
str code=
;[Reflection.Assembly]::LoadFile("C:\Chilkat\ChilkatDotNet47.dll")
;
;$json = New-Object Chilkat.JsonObject
;
;#  The only reason for failure in the following lines of code would be an out-of-memory condition..
;
;#  An index value of -1 is used to append at the end.
;$index = -1
;
;$success = $json.AddStringAt(-1, "Title", "Pan's Labyrinth")
;$success = $json.AddStringAt(-1, "Director", "Guillermo del Toro")
;$success = $json.AddStringAt(-1, "Original_Title", "El laberinto del fauno")
;$success = $json.AddIntAt(-1, "Year_Released", 2006)
;
;$json.EmitCompact = $false
;$($json.Emit())

PsCmd code "" _s
out _s


Messages In This Thread
Powershell code failed to run - by win - 06-15-2019, 12:03 AM
RE: Powershell code failed to run - by win - 06-17-2019, 02:26 PM
RE: Powershell code failed to run - by Gintaras - 06-17-2019, 03:31 PM
RE: Powershell code failed to run - by win - 06-17-2019, 10:51 PM
RE: Powershell code failed to run - by Gintaras - 06-18-2019, 04:45 AM
RE: Powershell code failed to run - by win - 06-18-2019, 07:05 AM
RE: Powershell code failed to run - by Gintaras - 06-18-2019, 07:11 AM
RE: Powershell code failed to run - by win - 06-18-2019, 08:17 AM
RE: Powershell code failed to run - by Kevin - 06-20-2019, 04:44 AM
RE: Powershell code failed to run - by win - 06-20-2019, 05:30 AM
RE: Powershell code failed to run - by Kevin - 06-20-2019, 11:54 AM
RE: Powershell code failed to run - by win - 06-20-2019, 12:50 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)