cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
DonAIR
Level 6

PowerShell Custom Action retrieve MSI Properties in Deferred Mode

We are looking for a way to retrieve our MSI Properties in a custom PowerShell Action that runs in deferred mode. The properties are being set during the UI sequence (or silently) and the file gets copied to the local server and run. We were hoping to use something like get-property but that is returning blank.
Labels (1)
0 Kudos
(4) Replies
OneDayBehind
Level 4

I think the answer to the question is "yes".

It took me a while to figure it out, but I am able to get the value of the INSTALLDIR property into a PowerShell script that runs in deferred execution. To do so, follow the standard steps for making a property accessible in deferred execution as described here. For Step 3., using the following PowerShell command to get the property you are looking for:

$value = Get-Property -Name CustomDataAction


Note that the "name" part of the PowerShell command is not INSTALLDIR as one might think.

The next challenge is to figure-out if it's possible to pass more than one property via the CustomDataAction variable. So far, I've only passed the one INSTALLDIR variable... I'm not sure what would happen if I tried to pass more than that.
0 Kudos

Hello there is a mistake in your script.

You have: $value = Get-Property -Name CustomDataAction 

It should be $value = Get-Property -Name CustomActionData

Took me a while to figure out why my scripot wasn't working.

0 Kudos
pmsatterlee
Level 3

OneDayBehind wrote:
I think the answer to the question is "yes".

It took me a while to figure it out, but I am able to get the value of the INSTALLDIR property into a PowerShell script that runs in deferred execution. To do so, follow the standard steps for making a property accessible in deferred execution as described here. For Step 3., using the following PowerShell command to get the property you are looking for:

$value = Get-Property -Name CustomDataAction


Note that the "name" part of the PowerShell command is not INSTALLDIR as one might think.

The next challenge is to figure-out if it's possible to pass more than one property via the CustomDataAction variable. So far, I've only passed the one INSTALLDIR variable... I'm not sure what would happen if I tried to pass more than that.


You can set the CustomActionData for one LONG continuous stream of information delimited by ";" and the run a FOR loop to break it back down in to an array. I have done this in the past with VBScript which I am now trying to convert to PowerShell.
0 Kudos
chad_petersen
Level 9

Make sure your properties being set are in ALL UPPERCASE or they will not survive from the UISequence to the ExecuteSequence.
0 Kudos