diff --git a/solutions/14_Building_Images_WVD/0_installConfFsLogix.ps1 b/solutions/14_Building_Images_WVD/0_installConfFsLogix.ps1 index 3d14fbb..d2e7394 100644 --- a/solutions/14_Building_Images_WVD/0_installConfFsLogix.ps1 +++ b/solutions/14_Building_Images_WVD/0_installConfFsLogix.ps1 @@ -1,20 +1,46 @@ -write-host 'AIB Customization: Downloading FsLogix' -New-Item -Path C:\\ -Name fslogix -ItemType Directory -ErrorAction SilentlyContinue -$LocalPath = 'C:\\fslogix' -$WVDflogixURL = 'https://raw.githubusercontent.com/DeanCefola/Azure-WVD/master/PowerShell/FSLogixSetup.ps1' -$WVDFslogixInstaller = 'FSLogixSetup.ps1' -$outputPath = $LocalPath + '\' + $WVDFslogixInstaller -Invoke-WebRequest -Uri $WVDflogixURL -OutFile $outputPath -set-Location $LocalPath - +Write-Host 'AIB Customization: Downloading FsLogix' $fsLogixURL="https://aka.ms/fslogix_download" $installerFile="fslogix_download.zip" +New-Item ` + -Path C:\Temp ` + -Name fslogix ` + -ItemType Directory ` + -ErrorAction SilentlyContinue +$LocalPath = 'C:\Temp\fslogix' +(New-Object System.Net.WebClient).DownloadFile("$fsLogixURL","$LocalPath\$installerFile") +Expand-Archive ` + -Path $LocalPath\$installerFile ` + -DestinationPath $LocalPath ` + -Verbose +Write-Host 'AIB Customization: Downloading of FsLogix installer finished' + +Write-Host 'AIB Customization: Comparing FsLogix versions' +$downloadedFsLogixVersion = Get-Item $LocalPath\x64\Release\FSLogixAppsSetup.exe | Select-Object VersionInfo +Write-Host 'AIB Customization: Downloaded version number:' $downloadedFsLogixVersion.VersionInfo.FileVersion + +$installedFsLogixVersion = Get-Item "C:\Program Files\FSLogix\Apps\frx.exe" | Select-Object VersionInfo +Write-Host 'AIB Customization: Installed version number:' $installedFSLogixVersion.VersionInfo.FileVersion + +if ([version]$downloadedFsLogixVersion.VersionInfo.FileVersion -gt [version]$installedFsLogixVersion.VersionInfo.FileVersion) { + Write-Host 'AIB Customization: Downloaded version is greator than that installed. Updating FsLogix.' + Write-Host 'AIB Customization: Uninstalling FsLogix' + Start-Process ` + -FilePath $LocalPath\x64\Release\FSLogixAppsSetup.exe ` + -ArgumentList "/uninstall /quiet /norestart" ` + -Wait ` + -Passthru + + Write-Host 'AIB Customization: Starting Fslogix installer' + Start-Process ` + -FilePath $LocalPath\x64\Release\FSLogixAppsSetup.exe ` + -ArgumentList "/install /quiet" ` + -Wait ` + -Passthru +} else { + Write-Host 'AIB Customization: Installed version matches the downloaded version. Skipping FsLogix update.' +} -Invoke-WebRequest $fsLogixURL -OutFile $LocalPath\$installerFile -Expand-Archive $LocalPath\$installerFile -DestinationPath $LocalPath -write-host 'AIB Customization: Download Fslogix installer finished' +$installedFsLogixVersion = Get-Item "C:\Program Files\FSLogix\Apps\frx.exe" | Select-Object VersionInfo +Write-Host 'AIB Customization: Installed version number is now:' $installedFSLogixVersion.VersionInfo.FileVersion -write-host 'AIB Customization: Start Fslogix installer' -Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force -Verbose -.\\FSLogixSetup.ps1 -ProfilePath \\wvdSMB\wvd -Verbose -write-host 'AIB Customization: Finished Fslogix installer' +Write-Host 'AIB Customization: Finished Fslogix installer' \ No newline at end of file diff --git a/solutions/14_Building_Images_WVD/armTemplateWVD.json b/solutions/14_Building_Images_WVD/armTemplateWVD.json index 5dc5376..3e44ea1 100644 --- a/solutions/14_Building_Images_WVD/armTemplateWVD.json +++ b/solutions/14_Building_Images_WVD/armTemplateWVD.json @@ -1,5 +1,5 @@ { - "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "imageTemplateName": { @@ -41,15 +41,15 @@ "vmProfile": { - "vmSize": "Standard_D2_v2", + "vmSize": "Standard_D2s_v5", "osDiskSizeGB": 127 }, "source": { "type": "PlatformImage", "publisher": "MicrosoftWindowsDesktop", - "offer": "windows-10", - "sku": "20h1-ent", + "offer": "office-365", + "sku": "win10-21h2-avd-m365-g2", "version": "latest" }, "customize": [ @@ -74,19 +74,11 @@ "restartCheckCommand": "write-host 'restarting post Optimizations'", "restartTimeout": "5m" }, - { - "type": "PowerShell", - "name": "Install Teams", - "runElevated": true, - "runAsSystem": true, - "scriptUri": "https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/solutions/14_Building_Images_WVD/2_installTeams.ps1" - }, { "type": "WindowsRestart", "restartCheckCommand": "write-host 'restarting post Teams Install'", "restartTimeout": "5m" }, - { "type": "WindowsUpdate", "searchCriteria": "IsInstalled=0",