Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ConfigData = @{
- AllNodes = @(
- @{
- NodeName = "localhost"
- Role = "local"
- },
- @{
- NodeName = "<guid>"
- Role = "XenApp"
- }
- );
- }
- Configuration AppV {
- Import-DscResource -Module zAppVImport
- Node $AllNodes.Where{$_.Role -eq "XenApp" }.NodeName {
- File Test {
- Ensure = "Present"
- DestinationPath = "C:\Windows\System32\WindowsPowerShell\v1.0\Modules"
- SourcePath = "\\<dscmoduleshare>"
- Recurse = "True"
- Type = "Directory"
- Force = "True"
- }
- Package Install {
- Ensure = "Present"
- Path = "\\<pathtoappvclient>\appv_client_rds_MSI_x64.msi"
- Arguments = "AcceptEULA=1 /qb"
- Name = "Microsoft Application Virtualization (App-V) Client for Remote Desktop Services 5.0 Service Pack 2 x64"
- ProductId = "F4BCB831-E3ED-4A05-81C5-E342E22B9E2C"
- }
- # Enable Shared Content Store Mode.
- Registry SCS {
- Ensure = "Present"
- Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Client\Streaming"
- ValueName = "SharedContentStoreMode"
- ValueData = "1"
- ValueType = "Dword"
- }
- # Restart App-V Service.
- Script AppVRestart {
- SetScript = { Restart-Service AppvClient }
- GetScript = { return @{Service = (Get-Service -Name AppvClient).Status} }
- TestScript = { if((Get-Service -Name AppvClient).Status -eq "Running"){ $false } }
- }
- # Import sequences.
- zAppVImport SP2 {
- Ensure = "Present"
- Path = "\\<appvcontentstore>\SP2"
- Single = $false
- }
- zAppVImport x64 {
- Ensure = "Present"
- Path = "\\<appvcontentstore>\x64"
- Single = $false
- }
- }
- }
- Remove-Item -Path "C:\Program Files\WindowsPowerShell\DscService\Configuration\*.checksum" -Force -Confirm:$false
- AppV -OutputPath "C:\Program Files\WindowsPowerShell\DscService\Configuration" -ConfigurationData $ConfigData
- New-DSCCheckSum "C:\Program Files\WindowsPowerShell\DscService\Configuration"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement