Last active
August 29, 2015 14:00
-
-
Save justinledwards/2c59cb301287a3f38f88 to your computer and use it in GitHub Desktop.
Ultra Fast VDI Boot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Did you run Voodoo on the registry and reboot? | |
| # Did you run "Set-ExecutionPolicy remotesigned" ? | |
| Set-Location C:\voodoomagic | |
| function Test-ReparsePoint([string]$path) { | |
| $file = Get-Item $path -Force -ea 0 | |
| return [bool]($file.Attributes -band [IO.FileAttributes]::ReparsePoint) | |
| } | |
| function Symlinker([string]$dir) { | |
| if (Test-Path($dir)){ | |
| if (Test-ReparsePoint($dir)) { | |
| Write-Host "$dir is symlinked" } | |
| else { | |
| Write-Host "$dir is not symlinked yet" | |
| $robocopy = "& ECHO ROBOCOPY ""$dir"" ""S:\$dir"" /MOVE " | |
| Invoke-Expression $robocopy | |
| Write-Host "Remove-Item -Recurse -Force ""$dir""" | |
| $cmd = "& ECHO cmd /c mklink /d ""$dir"" ""S:\$dir""" | |
| Invoke-Expression $cmd | |
| } | |
| } else { | |
| Write-Host "Directory $dir does not exist, creating it and symlinking it." | |
| Write-Host "New-Item -ItemType directory -Path ""S:\$dir""" | |
| $cmd = "& ECHO cmd /c mklink /d ""$dir"" ""S:\$dir""" | |
| Invoke-Expression $cmd | |
| } | |
| Write-Host "" | |
| } | |
| Set-Location $env:USERPROFILE | |
| $symdirs = "AppData\Local\Microsoft\Communicator", "AppData\Local\Microsoft\InputPersonalization", "AppData\Local\Microsoft\Office", "AppData\Local\Microsoft\Outlook RoamCache", "AppData\Roaming\Cannon Electronics", "AppData\Roaming\Identities", "AppData\Roaming\Microsoft\Internet Explorer\Quick Launch", "AppData\Roaming\Microsoft\Internet Explorer\UserData", "AppData\Roaming\Microsoft\Office", "AppData\Roaming\Microsoft\Outlook\RoamCache", "AppData\Roaming\Microsoft\Windows", "AppData\Roaming\Microsoft\Windows Photo Viewer", "AppData\Roaming\Microsoft\Signatures", "Contacts", "Desktop", "Documents", "Downloads", "Favorites", "Links", "Music", "Pictures","Saved Games", "Searches", "Videos" | |
| $symdirs | ForEach { Symlinker($_) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Did you run Voodoo on the registry and reboot? | |
| # Did you run "Set-ExecutionPolicy remotesigned" ? | |
| Set-Location C:\voodoomagic | |
| function Test-ReparsePoint([string]$path) { | |
| $file = Get-Item $path -Force -ea 0 | |
| return [bool]($file.Attributes -band [IO.FileAttributes]::ReparsePoint) | |
| } | |
| function Symlinker([string]$dir) { | |
| if (Test-Path($dir)){ | |
| if (Test-ReparsePoint($dir)) { | |
| Write-Host "$dir is symlinked" } | |
| else { | |
| Write-Host "$dir is not symlinked yet" | |
| $robocopy = "& ROBOCOPY ""$dir"" ""S:\$dir"" /MOVE " | |
| Invoke-Expression $robocopy | |
| Remove-Item -Recurse -Force "$dir" | |
| $cmd = "& cmd /c mklink /d ""$dir"" ""S:\$dir""" | |
| Invoke-Expression $cmd | |
| } | |
| } else { | |
| Write-Host "Directory $dir does not exist, creating it and symlinking it." | |
| New-Item -ItemType directory -Path "S:\$dir" | |
| $cmd = "& cmd /c mklink /d ""$dir"" ""S:\$dir""" | |
| Invoke-Expression $cmd | |
| } | |
| Write-Host "" | |
| } | |
| Set-Location $env:USERPROFILE | |
| $symdirs = "AppData\Local\Microsoft\Communicator", "AppData\Local\Microsoft\InputPersonalization", "AppData\Local\Microsoft\Office", "AppData\Local\Microsoft\Outlook RoamCache", "AppData\Roaming\Cannon Electronics", "AppData\Roaming\Identities", "AppData\Roaming\Microsoft\Internet Explorer\Quick Launch", "AppData\Roaming\Microsoft\Internet Explorer\UserData", "AppData\Roaming\Microsoft\Office", "AppData\Roaming\Microsoft\Outlook\RoamCache", "AppData\Roaming\Microsoft\Windows", "AppData\Roaming\Microsoft\Windows Photo Viewer", "AppData\Roaming\Microsoft\Signatures", "Contacts", "Desktop", "Documents", "Downloads", "Favorites", "Links", "Music", "Pictures","Saved Games", "Searches", "Videos" | |
| $symdirs | ForEach { Symlinker($_) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment