Using PowerShell Commands from .NET applications
Now we are going to learn how to develop simple .NET applications to call Citrix PowerShell cmdlets on both Visual Basic.NET (VB.NET) and C#.NET.
Requirement to develop applications:
Citrix XenApp 6.5 PowerShell SDK or Citrix XenApp Commands
Microsoft Visual C#.NET and/or Visual Basic.NET. Microsoft provides the Express Edition of Visual Studio.NET, Visual C#.NET, and Visual Basic.NET for free at www.microsoft.com/visualstudio
Creating a sample VB.NET application
Now we are going to create a sample application to list all XenApp servers in our XenApp farm using Citrix XenApp Commands with managed code.
The first step is to start VB.NET. Samples contained in this book are developed in Microsoft Visual Basic 2010 Express Edition.
Go to File | New Project | Windows Forms Application.
Enter the desired name for our project and click on the OK button.
Adding references
The next step is to add a reference to the System.Management.Automation.dll
assembly...