Install or update FSLogix the easy way

Hi all,

Welcome to another blog post about AVD in combination with Nerdio.

Microsoft often releases an update for FSLogix and when this happens you need a way of updating all your session hosts since this often includes a lot of hotfixes for issues you might have.

To make the process a lot easier I wrote a Powershell script. The script will perform the following steps:

  • Download FSLogix
  • Unzip FSLogix
  • Install FSLogix
  • Reboot session host
#description: Downloads and installs FSLogix on the session hosts
#Written by Johan Vanneuville
#No warranties given for this script
#execution mode: IndividualWithRestart
#tags: Nerdio, Apps install, FSLogix
<# 
Notes:
This script installs FSLogix on AVD Session hosts.

#>

$FslogixUrl= "https://aka.ms/fslogix_download"

# Start powershell logging
$SaveVerbosePreference = $VerbosePreference
$VerbosePreference = 'continue'
$VMTime = Get-Date
$LogTime = $VMTime.ToUniversalTime()
mkdir "C:\Windows\temp\NerdioManagerLogs\ScriptedActions\fslogix" -Force
Start-Transcript -Path "C:\Windows\temp\NerdioManagerLogs\ScriptedActions\fslogix\ps_log.txt" -Append
Write-Host "################# New Script Run #################"
Write-host "Current time (UTC-0): $LogTime"

# Make directory to hold install files

mkdir "C:\Windows\Temp\fslogix\install" -Force


Invoke-WebRequest -Uri $FslogixUrl -OutFile "C:\Windows\Temp\fslogix\install\FSLogixAppsSetup.zip" -UseBasicParsing

Expand-Archive `
    -LiteralPath "C:\Windows\Temp\fslogix\install\FSLogixAppsSetup.zip" `
    -DestinationPath "C:\Windows\Temp\fslogix\install" `
    -Force `
    -Verbose
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
cd "C:\Windows\Temp\fslogix\install\"



# Install FSLogix. 
Write-Host "INFO: Installing FSLogix. . ."
Start-Process "C:\Windows\Temp\fslogix\install\x64\Release\FSLogixAppsSetup.exe" `
    -ArgumentList "/install /quiet" `
    -Wait `
    -Passthru `
  


Write-Host "INFO: FSLogix install finished."

# End Logging
Stop-Transcript
$VerbosePreference=$SaveVerbosePreference

Having this script is one thing, now we need a way of running the script on all our session hosts. This is were Nerdio Scripted Actions comes in. Using this feature you can easily run a script on 1 session host or to an entire host pool at once.

I’m very happy that the script is available now as a build in scripted action in Nerdio. When going to Scripted Actions and selecting Windows script you can find the script.

Different scenario’s of updating FSLogix

Now that the scripted action is there, let’s see how to use it.

Option 1:

We can choose to update 1 single session hosts with selecting the drop down arrow on the right side and select run script.

Here you can select the script to update FSLogix

Option 2:

You can do this action on the host pool level and select the script.

You also have the option here to schedule this scripted action and have the update stop if the update process fails on 1 host.

Option 3:

Another option so simply make sure that FSLogix is always up to date is to change the VM Deployment properties. Here you can choose which scripted actions to run for example when adding new session host(s)s.

There you go, 3 simple ways of making sure you are always using the latest version of FSLogix that ia available with the power of Nerdio.

If you have any questions feel free to contact me on my social’s.

Leave a Reply

Your email address will not be published. Required fields are marked *