string link = args[1]; string target = args[2]; bool isDirectory = Array.Exists(args, a => a.Equals("/d", StringComparison.OrdinalIgnoreCase)); bool unprivileged = Array.Exists(args, a => a.Equals("/u", StringComparison.OrdinalIgnoreCase));
"Remove" if (-not $LinkPath) Write-Host "Usage: -Action Remove -LinkPath <path>" return symbolic link in windows
.\symlink.ps1 -Action Create -LinkPath C:\MyLink -TargetPath D:\RealFolder -Directory .\symlink.ps1 -Action Create -LinkPath .\link.txt -TargetPath ..\data\file.txt -Relative .\symlink.ps1 -Action List -SearchPath C:\ .\symlink.ps1 -Action Remove -LinkPath C:\MyLink using System; using System.IO; using System.Runtime.InteropServices; class SymlinkFeature string link = args[1]; string target = args[2];
string command = args[0].ToLower(); switch (command) case "create": CreateLink(args); break; case "list": ListLinks(args[1]); break; case "remove": RemoveLink(args[1]); break; default: Console.WriteLine("Unknown command."); break; string link = args[1]
Remove-Symlink -Path $LinkPath
string link = args[1]; string target = args[2]; bool isDirectory = Array.Exists(args, a => a.Equals("/d", StringComparison.OrdinalIgnoreCase)); bool unprivileged = Array.Exists(args, a => a.Equals("/u", StringComparison.OrdinalIgnoreCase));
"Remove" if (-not $LinkPath) Write-Host "Usage: -Action Remove -LinkPath <path>" return
.\symlink.ps1 -Action Create -LinkPath C:\MyLink -TargetPath D:\RealFolder -Directory .\symlink.ps1 -Action Create -LinkPath .\link.txt -TargetPath ..\data\file.txt -Relative .\symlink.ps1 -Action List -SearchPath C:\ .\symlink.ps1 -Action Remove -LinkPath C:\MyLink using System; using System.IO; using System.Runtime.InteropServices; class SymlinkFeature
string command = args[0].ToLower(); switch (command) case "create": CreateLink(args); break; case "list": ListLinks(args[1]); break; case "remove": RemoveLink(args[1]); break; default: Console.WriteLine("Unknown command."); break;
Remove-Symlink -Path $LinkPath
| Â |
| Îïöèè òåìû | |
|
|
|
|