Symbolic Link In Windows -

if (Test-Path $Link) Write-Error "Link already exists: $Link" return

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

:

const int SYMBOLIC_LINK_FLAG_FILE = 0x0; const int SYMBOLIC_LINK_FLAG_DIRECTORY = 0x1; const int SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE = 0x2; const int SYMBOLIC_LINK_FLAG_DIRECTORY = 0x1

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"); const int SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE = 0x2

$targetResolved = if ($UseRelative) $relativePath = Resolve-Path -Path $Target -Relative -RelativeBasePath $parent if (-not $relativePath) $Target else $relativePath else $Target