Creating Custom Scripts within Login AM by Using Custom Variables

The power of Login AM is the dynamic design. When I create a component I am able to fill in the settings on the top level of the component. These values can be used in Linked Values throughout the complete component from a Dynconf to a Citrix Published application.
Toplevel Component:
What often is forgotten is that the name and value is used as a system variable during execution of the component. This is very handy because this gives me the possibility to use these ‘custom’ variables inside a custom script.
In this example I am going to create a path from the variables SOURCEDIR and REVISION.
The easiest way to combine the SOURCEDIR and the REVISION is to create a PowerShell variable.
$APPV_SourcePath
Then we need to call the system variables in the powershell script. This can be done by using the following command: $env:<VariableName>
In my example it will look like this:
$env:SOURCEDIR
$env:REVISION
Now we need to combine all parts.
$APPV_SourcePath = $env:SOURCEDIR + '\'+ $env:REVISION
The command write-host plus the variable is a nice way to check what the outcome is during scripting. The result will be display in your PowerShell window.
Write-host $APPV_SourcePath
Some useful command for showing all system variables:
Get-ChildItem env:
I hope this information helps you in creating custom scripts within Login AM.