I want to pass in a dynamic value for AI_GetMsiProperty inside the Power Shell inline script (execution time is set to Immediately) but it does not work.
General aim is to get a folder path inside the loop by calculating a property name from "Files and Folders".
For instance I haver a folder "TestApi" and "TestApi1", the identifiers generated by AI are: TestApi_Dir and TestApi1_Dir.
I have a comma separated string with a list of folder names in custom property - MIGRATION_SERVICES. It value is "TestApi,TestApi1".
In Power Shell script I do the following:
Code: Select all
$migrationServices = AI_GetMsiProperty MIGRATION_SERVICES
$migrationServices.Split(",") | ForEach-Object {
$dirName = $_ + "_Dir"
$Path = AI_GetMsiProperty $dirName
if ($Path -ne '') {
}
}
exit 0
The problem is that $Path is always empty, but this line will return a correct path: $Path = AI_GetMsiProperty TestApi_Dir
I wonder what I missed?
Regards,
Andrey