Hi, @MartinWierenga
Thank you for posting in Microsoft Q&A forum.
To use a custom property in MDT for a script, we may try to add the custom property to the CustomSettings.ini file and then reference it in a PowerShell script using the $tsenv
variable. For example, if we added the following line to the CustomSettings.ini file:
ProgID=1234
We can reference this property in a PowerShell script using $tsenv:ProgID
. For example:
$ProgID = $tsenv:ProgID
& "$env:SCRIPTROOT\subfolder\programsetup.exe" -parameter:$ProgID
In this example, the ProgID custom property is stored in the $ProgID variable and passed as a parameter to the programsetup.exe script using the -parameter
switch.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Add comment".