Get customaction name from within powershell script - Advanced Installer Community
r.bissels
Posts: 7
Joined: Tue Aug 20, 2019 9:46 am

Get customaction name from within powershell script

Hi,

Currently I am implementing a part of script which displays the $LastExitCode. I also want to include the name of the current CustomAction which it occured in. Is it possible to get the current customAction name from within its own script? We got around 50 custom actions, so this would be really helpfull.

I am looking for something like this :

if(!$?)
{
&write-output "The Last Exit Code of the custom action " $CustomActionName" is:" $LastExitCode
}
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Get customaction name from within powershell script

Hello,

Unfortunately, there is no such parameter that stores the name of the custom action.

You can, however, create such a parameter for your custom action as it follows:

CustomActionName.png
CustomActionName.png (101.23 KiB) Viewed 1877 times

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”