Creating hard and soft links using PowerShell

Viewed 240936

Can PowerShell 1.0 create hard and soft links analogous to the Unix variety?

If this isn't built in, can someone point me to a site that has a ps1 script that mimics this?

This is a necessary function of any good shell, IMHO. :)

11 Answers

In Windows 7, the command is

fsutil hardlink create new-file existing-file

PowerShell finds it without the full path (c:\Windows\system32) or extension (.exe).

Try junction.exe

The Junction command line utility from SysInternals makes creating and deleting junctions easy.

Further reading

  • MS Terminology: soft != symbolic
    Microsoft uses "soft link" as another name for "junction".
    However: a "symbolic link" is something else entirely.
    See MSDN: Hard Links and Junctions in Windows.
    (This is in direct contradiction to the general usage of those terms where "soft link" and "symbolic link" ("symlink") DO mean the same thing.)

You can use this utility:

c:\Windows\system32\fsutil.exe create hardlink
Related