We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

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: 7853
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 1884 times

Hope this helps.

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

Return to “Common Problems”