Advertisement
alcaron

EX-AppvConfig.ps1

Feb 11th, 2014
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ConfigData = @{
  2.     AllNodes = @(
  3.         @{
  4.             NodeName = "localhost"
  5.             Role = "local"
  6.         },
  7.         @{
  8.             NodeName = "<guid>"
  9.             Role = "XenApp"
  10.         }
  11.     );
  12. }
  13.  
  14. Configuration AppV {
  15.     Import-DscResource -Module zAppVImport
  16.     Node $AllNodes.Where{$_.Role -eq "XenApp" }.NodeName {
  17.         File Test {
  18.             Ensure = "Present"
  19.             DestinationPath = "C:\Windows\System32\WindowsPowerShell\v1.0\Modules"
  20.             SourcePath = "\\<dscmoduleshare>"
  21.             Recurse = "True"
  22.             Type = "Directory"
  23.             Force = "True"
  24.         }
  25.  
  26.         Package Install {
  27.             Ensure = "Present"
  28.             Path = "\\<pathtoappvclient>\appv_client_rds_MSI_x64.msi"
  29.             Arguments = "AcceptEULA=1 /qb"
  30.             Name = "Microsoft Application Virtualization (App-V) Client for Remote Desktop Services 5.0 Service Pack 2 x64"
  31.             ProductId = "F4BCB831-E3ED-4A05-81C5-E342E22B9E2C"
  32.         }
  33.  
  34.         # Enable Shared Content Store Mode.
  35.         Registry SCS {
  36.             Ensure = "Present"
  37.             Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Client\Streaming"
  38.             ValueName = "SharedContentStoreMode"
  39.             ValueData = "1"
  40.             ValueType = "Dword"
  41.         }
  42.  
  43.         # Restart App-V Service.
  44.         Script AppVRestart {
  45.             SetScript = { Restart-Service AppvClient }
  46.             GetScript = { return @{Service = (Get-Service -Name AppvClient).Status} }
  47.             TestScript = { if((Get-Service -Name AppvClient).Status -eq "Running"){ $false } }
  48.         }
  49.        
  50.         # Import sequences.
  51.         zAppVImport SP2 {
  52.             Ensure = "Present"
  53.             Path = "\\<appvcontentstore>\SP2"
  54.             Single = $false
  55.         }
  56.  
  57.         zAppVImport x64 {
  58.             Ensure = "Present"
  59.             Path = "\\<appvcontentstore>\x64"
  60.             Single = $false
  61.         }
  62.        
  63.     }
  64. }
  65.  
  66. Remove-Item -Path "C:\Program Files\WindowsPowerShell\DscService\Configuration\*.checksum" -Force -Confirm:$false
  67. AppV -OutputPath "C:\Program Files\WindowsPowerShell\DscService\Configuration" -ConfigurationData $ConfigData
  68. New-DSCCheckSum "C:\Program Files\WindowsPowerShell\DscService\Configuration"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement