Chris Rodgers
03/26/2025, 11:34 AMJames Kindon
03/26/2025, 11:59 AMJeff Riechers
03/26/2025, 1:02 PMRob Zylowski
03/26/2025, 1:17 PMChris Rodgers
03/26/2025, 1:25 PMYuhua Lu
03/26/2025, 4:20 PMYuhua Lu
03/26/2025, 4:23 PMYuhua Lu
03/26/2025, 4:24 PMYuhua Lu
03/26/2025, 4:30 PMChris Rodgers
03/26/2025, 9:22 PMRob Zylowski
03/26/2025, 9:26 PMChris Rodgers
03/26/2025, 9:26 PMChris Rodgers
03/26/2025, 9:28 PMRob Zylowski
03/26/2025, 9:31 PM#Version 1.2 | 2019-04-23 | Citrix updated the revised script to dynamically recurse four directories then read all files with .dll and .exe extensions
#Version 1.1 | 2019-04-10 | Microsoft revised script to dynamically recurse the "Program Files" directory and read all files with .dll and .exe extensions
#Version 1.0 | 2019-02-07 | Microsoft created script to parse a text document with files to read.
$sw = [Diagnostics.Stopwatch]::StartNew()
function CacheFile([string]$filename)
{
$bytes = [System.IO.File]::ReadAllBytes($filename)
}
$filelist = @(Get-ChildItem "C:\Windows\System32\*.*" -Recurse)
$filelist += @(Get-ChildItem "C:\Windows\SysWOW64\*.*" -Recurse)
$filelist += @(Get-ChildItem "C:\Program Files\*.*" -Recurse)
$filelist += @(Get-ChildItem "C:\Program Files (x86)\*.*" -Recurse)
foreach ($f in $filelist)
{
$ext = [IO.Path]::GetExtension($f)
Switch ($ext)
{
{($_ -eq ".dll") -or ($_ -eq ".exe")} {CacheFile($f)}
}
}
$sw.Stop()
$sw.Elapsed | Out-File -FilePath "C:\VDICache\CacheRunTime.log" -ForceChris Rodgers
03/26/2025, 9:31 PMRob Zylowski
03/26/2025, 9:32 PMChris Rodgers
03/26/2025, 9:33 PMRob Zylowski
03/26/2025, 9:34 PMRob Zylowski
03/26/2025, 9:35 PM#Version 1.2 | 2019-04-23 | Citrix updated the revised script to dynamically recurse four directories then read all files with .dll and .exe extensions
#Version 1.1 | 2019-04-10 | Microsoft revised script to dynamically recurse the "Program Files" directory and read all files with .dll and .exe extensions
#Version 1.0 | 2019-02-07 | Microsoft created script to parse a text document with files to read.
This script is intended to be used for MCS provisioned machines in Microsoft Azure Cloud. The script should be placed onto the master image virtual machine and is used to resolve slowness issues with the basedisk deployed from disk snapshots.
Instructions for use:
The below steps should be completed on the master image virtual machine.
1. Move this folder "VDICache" to C:\ such that accessing this file is C:\VDICache\README.txt
2. Create the scheduled task:
schtasks /create /sc onstart /ru "SYSTEM" /tn VDICache /TR "PowerShell.exe -ExecutionPolicy Bypass C:\VDICache\Cachem.ps1"
3. Test run the scheduled task through the Task Scheduler. Once completed CacheRunTime.log will be created under C:\VDICache\.
4. Power off the virtual machine and make sure it is deallocated in the Azure portal
5. Wait about 10 minutes for disk to be hydrated
6. At this point, you can create/update the machine catalog to begin the deployment process
7. Once machines are provisioned and powered on, log into the machine or remotely navigate and check the C:\VDICache\CacheRunTime.log modification date to ensure the script has finished running (Timestamp will be close to time machine was powered on)
8. Inside CacheRunTime.log the execution time of the script is recorded
9. Run applications to check the launch performanceChris Rodgers
03/26/2025, 9:42 PMRob Zylowski
03/26/2025, 10:45 PMYuhua Lu
03/27/2025, 1:25 AMYuhua Lu
03/27/2025, 1:36 AMChris Rodgers
03/27/2025, 9:16 AMChris Rodgers
03/27/2025, 9:18 AMYuhua Lu
03/27/2025, 2:06 PMNeil Spellings
03/30/2025, 5:22 PMRob Zylowski
03/30/2025, 5:25 PMChris Rodgers
03/31/2025, 9:01 PMRob Zylowski
03/31/2025, 9:02 PM