#PUT XAML BELOW between the @" "@ $inputXML = @" <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WpfApplication1" mc:Ignorable="d" Title="MainWindow" Height="350" Width="525"> <Grid> </Grid> </Window> "@ $inputXML = $inputXML -replace 'mc:Ignorable="d"','' -replace "x:N",'N' -replace '^<Win.*', '<Window' [void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework') [xml]$XAML = $inputXML #Read XAML $reader=(New-Object System.Xml.XmlNodeReader $xaml) try{ $Form=[Windows.Markup.XamlReader]::Load( $reader ) }catch [System.Management.Automation.MethodInvocationException] { Write-Warning "We ran into a problem with the XAML code. Check the syntax for this control..." write-host $error[0].Exception.Message -ForegroundColor Red if ($error[0].Exception.Message -like "*button*"){ write-warning "Ensure your <button in the `$inputXML does NOT have a Click=ButtonClick property. PS can't handle this`n`n`n`n" } }catch{ Write-Host "Unable to load Windows.Markup.XamlReader. Double-check syntax and ensure .net is installed." } #=========================================================================== # Store Form Objects In PowerShell #=========================================================================== $xaml.SelectNodes("//*[@Name]") | %{Set-Variable -Name "WPF$($_.Name)" -Value $Form.FindName($_.Name)} Function Get-FormVariables{ if ($global:ReadmeDisplay -ne $true){Write-host "If you need to reference this display again, run Get-FormVariables" -ForegroundColor Yellow;$global:ReadmeDisplay=$true} write-host "Found the following interactable elements from our form" -ForegroundColor Cyan get-variable WPF* } Get-FormVariables #=========================================================================== # Use this space to add code to the various form elements in your GUI #=========================================================================== #Reference #Adding items to a dropdown/combo box #$vmpicklistView.items.Add([pscustomobject]@{'VMName'=($_).Name;Status=$_.Status;Other="Yes"}) #Setting the text of a text box to the current PC name #$WPFtextBox.Text = $env:COMPUTERNAME #Adding code to a button, so that when clicked, it pings a system # $WPFbutton.Add_Click({ Test-connection -count 1 -ComputerName $WPFtextBox.Text # }) #=========================================================================== # Shows the form #=========================================================================== write-host "To show the form, run the following" -ForegroundColor Cyan '$Form.ShowDialog() | out-null' Source
<# .SYNOPSIS A summary .DESCRIPTION A more in depth description .NOTES Additional Notes File Name : xx.ps1 Author : First Last - e@mail.com Requires : ... .LINK A hyper link .EXAMPLE The first example .EXAMPLE The second example .PARAMETER xxx text #> [CmdletBinding()] param ( [Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)][int64] $xxx=42 ) #Script
1. Make sure a DNS A and PTR record exists for the VC and the ESXi hosts. 2. Create a installation parameter file. E.g. “example_embedded.json” 3. Run “vcsa-deploy <your_json_file_location_and_name>” E.g. “vcsa-deploy c:/temp/example_embedded.json” 4. Wait (20 a 30min) fot the message " Login as: Administrator@vsphere.local" appears “example_embedded.json” file:
Windows 8 has some new maintenance jobs. These are great when you have an physical machine. But not when you’re using Citrix PVS to stream the OS. To disable these tasks enter the following commands:
Prerequisites
RES: .NET 2 only for Cached User Settings is .NET 4 required. Tips
Always try to reproduce an issue in an empty database. Always configure re-branding. Best Practices:
Split database is new production environments, keep the default name the wizard returns “<name pri db>_2nd”. Reserve a Named Licenses for laptop users when mixing the licenses. Define the Home drive in AD (user/gpo etc.) even-though it’s possible to configure in RES. Email Settings: Always set the setting create once When setting the “Enable offline use” setting, make sure the folder exists on the target device (E.g. GPO or Automation Manager) Signatures, make sure you select the correct version! Make drive reservations for dives used. (E.g. C: / D: / H:-Home Drive) Set the “Do not perform mapping operation” Don’t redirect AppData When testing with zero profile, make the user member of “local guests” a temp profile will be used and this wil make your live easier. Try to capture the user settings as much as possible on application level instead of global level. Always enable Memory optimization. Always enable Instant Logoff for XenApp SCCM Deployments Export key HKLM\SOFTWARE\RES\Workspace Manager, this can be used for SCCM deployments. Admin bypass Set the follwoing advanced setting, “Bypass composer for accounts matching: DOMAIN*admin*”. If the user is member of the local Administrators group RES personalisation will not be applyed. Splash Screen Composition > Desktop > Lockdown and Behavior > “splash”
When using a different base url for storefront than your storefront is member of you might run into this one. When logging on to a machine configured for Domain Passthrough you need to enter the credentials again in Windows. To resolve this issue enter on your StoreFront server the following command:
Socket Pooling. # In StoreFront we need to configgure socket polling in the config files, while in Web Interface we could configure this in the console. Storefront maintaines a pool of sockets instead of creating a socket each time a new user connects, when enabled it will give a better performance for SSL traffic. To change this, edit C:inetpubwwwrootCitrix<STORE>web.config (as Administrator) and find: