function Remove-Symlink param([string]$Path) if (-not (Test-Path $Path)) Write-Error "Path not found: $Path" return

Remove-Item -Path $Path -Force Write-Host "🗑️ Removed: $Path" -ForegroundColor Yellow switch ($Action) "Create" if (-not $LinkPath -or -not $TargetPath) Write-Host "Usage: -Action Create -LinkPath <path> -TargetPath <path> [-Directory] [-Junction] [-Relative]" return

"Remove" if (-not $LinkPath) Write-Host "Usage: -Action Remove -LinkPath <path>" return

static void CreateLink(string[] args) = SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;

var di = new DirectoryInfo(directory); foreach (var entry in di.GetFileSystemInfos()) var attr = File.GetAttributes(entry.FullName); if ((attr & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint) Console.WriteLine($"Symlink: entry.FullName");

if ($LASTEXITCODE -eq 0) Write-Host "✅ Symlink created: $Link -> $targetResolved" -ForegroundColor Green else Write-Host "❌ Failed. Try running as Administrator or enable Developer Mode." -ForegroundColor Red

[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] static extern bool CreateSymbolicLink(string lpSymlinkFileName, string lpTargetFileName, int dwFlags);

static void ListLinks(string directory)