login vsi company logo login vsi company logo 250x40
header-04.jpg
  • Home
  • Blog
  • Login AM
  • Creating Custom Scripts within Login AM by Using Custom Variables

Creating Custom Scripts within Login AM by Using Custom Variables

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:

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.

About the author

Niels Geursen works for our partner Login Consultants in the Netherlands. Niels is an enthusiastic consultant who likes a challenge. His specialties are Login AM, Citrix XenApp, XenDesktop, XenServer and Provisioning Services.


Tags: How-to, Login AM

Start Delivering the Best End User Experience Today

Request a Demo

Login VSI, Inc.

3945 Freedom Circle
Suite 670
Santa Clara, CA 95054

Phone: +1 408 899 7418

Login VSI B.V.

De Entree 85
1101 BH Amsterdam
The Netherlands

Phone: +31 20 705 1200