Created
June 1, 2026 23:12
-
-
Save ForNeVeR/053e3f0b2bf9bc12145ceca6a4b45f29 to your computer and use it in GitHub Desktop.
Repro for symlink problems on Windows' ReFS
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
| param ( | |
| $Disk = "W:\", | |
| $Base = "$Disk\symlinks_1", | |
| $Base2 = "$Disk\symlinks_2" | |
| ) | |
| New-Item -Type Directory -Path "$Base/Versions/A" -Force | Out-Null | |
| Set-Content -Path "$Base/Versions/A/OSLog.tbd" -Value "This is OSLog.tbd" | |
| cmd /c mklink "$Base\Versions\Current" "A" | |
| cmd /c mklink "$Base\OSLog.tbd" "Versions\Current\OSLog.tbd" | |
| Get-Content "$Base\OSLog.tbd" | |
| if ($?) { | |
| Write-Host "Symlink 1 works correctly." | |
| } else { | |
| Write-Host "Symlink 1 does not work." | |
| } | |
| Move-Item $Base $Base2 | |
| Get-Content "$Base2\OSLog.tbd" -ErrorAction SilentlyContinue | |
| if ($?) { | |
| Write-Host "Symlink 2 works correctly." | |
| } else { | |
| Write-Warning "Symlink 2 does not work." | |
| Write-Host "I will perform a fixup operation." | |
| Write-Host "Get-ChildItem $Base2" | |
| Get-ChildItem $Base2 | Out-Null | |
| Write-Host "Get-ChildItem $Base2\Versions" | |
| Get-ChildItem "$Base2\Versions" | Out-Null | |
| Write-Host "Get-ChildItem $Base2\Versions\Current" | |
| Get-ChildItem "$Base2\Versions\Current" | Out-Null | |
| Get-Content "$Base2\OSLog.tbd" -ErrorAction SilentlyContinue | |
| if ($?) { | |
| Write-Host "Symlink 2 works correctly after fixup." | |
| } else { | |
| Write-Error "Symlink 2 still does not work after fixup." | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment