I am trying to execute a custom action method from power-shell here is the code I have written in c#
namespace MyCustomAction
{
public class CustomActions
{
[CustomAction]
public static Session TestResult(Session session)
{
session["name"] = "hello";
return session;
}
}
}
After building t he solution here is how I am loading the assemblies
[System.Reflection.Assembly]::LoadFile("C:\Program Files (x86)\WiX Toolset v3.10\SDK\Microsoft.Deployment.WindowsInstaller.dll")
[System.Reflection.Assembly]::LoadFile("D:\CustomAction\\bin\x86\Debug\MyCustomAction.dll") | Out-Null
But I am not getting how to pass session to the method as required I tried the following but no luck
$session = [Microsoft.Deployment.WindowsInstaller.Session]
[MyCustomAction.CustomActions]::TestResult($session)