Powershell Symbolic Links in Windows 10

Recently, I’ve been using more the Powershell1 prompt rather than the old command prompt2. Both command consoles can still be run on Windows 10, but on recent occasion I prefer the Powershell as you can use it to create more complex shell scripts on Windows and access some C# modules.

A chain is only as strong as its weakest link.
— Anonymous.

On my previous recent post about moving ProgramData to another drive, I’ve use the mklink utility to create junction directory to-and-from. So here are the equivalent commands:

Command Prompt Syntax Powershell Equivalent Syntax
mklink Link Target New-Item -ItemType SymbolicLink -Name Link -Target Target
mklink /D Link Target New-Item -ItemType SymbolicLink -Name Link -Target Target
mklink /H Link Target New-Item -ItemType HardLink -Name Link -Target Target
mklink /J Link Target New-Item -ItemType Junction -Name Link -Target Target

The New-Item command is also analogous to Unix touch command tool.
Check the definition first of those commands before running on your system.
That’s all guys!

Leave a comment if you have questions and queries. Also you can DM me on twitter 😉.

💻


  1. PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and the associated scripting language. Initially a Windows component only, known as Windows PowerShell, it was made open-source and cross-platform on 18 August 2016 with the introduction of PowerShell Core. ↩︎

  2. The name refers to its executable filename. It is also commonly referred to as cmd or the Command Prompt, referring to the default window title on Windows. The implementations differ on the various systems but the behavior and basic set of commands is generally consistent. cmd.exe is the counterpart of COMMAND.COM in DOS and Windows 9x systems, and analogous to the Unix shells used on Unix-like systems. ↩︎

Comments

Popular posts from this blog

Top Three DNS Providers That Provides Good Service in SEA (Southeast Asia)

Sending Email Using MailKit in ASP.NET Core Web API

Dirty Logging With Serilog For ASP.NET 5