Hello everyone!
I'm trying to execute a Powershell script in Business Central.
Importing the necessary dll was easy, but everytime i try to run a simple script, it will throw an error ("Ambiguous Match found").
Is it possible to do this? If yes, what am i doing wrong?
This is my code so far:
dotnet
{
assembly("System.Management.Automation")
{
type("System.Management.Automation.PowerShell"; "PowerShell") { }
}
}
pageextension 50164 DotNetItem extends "Item List"
{
trigger OnOpenPage()
var
Shelly: DotNet PowerShell;
begin
Shelly := Shelly.Create();
Shelly.AddScript('C:\Users\MartinRuhland\Documents\Zeug\Testscript.ps1');
Shelly.BeginInvoke();
end;
}
Regards
Martin