Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Changes to reflect current best practices. #123

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 42 additions & 16 deletions solutions/14_Building_Images_WVD/0_installConfFsLogix.ps1
Original file line number Diff line number Diff line change
@@ -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'
16 changes: 4 additions & 12 deletions solutions/14_Building_Images_WVD/armTemplateWVD.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -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": [
Expand All @@ -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",
Expand Down