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 nessary function of any good shell, IMHO. :)
+3
A:
No it isn't built into PowerShell and the utility mklink on Vista/Win7 is built directly into cmd.exe. You can use the PowerShell Community Extensions (free). There are several cmdlets for reparse points of various types: New-HardLink, New-SymLink, New-Junction, Remove-ReparsePoint and others.
Keith Hill
2009-05-21 19:23:24
Good try. Though if you want to run XP or W2K3 server in either x32 or x64, New-Symlink dosen't work. In XP it will politely tell you that you should be running Vista for this command. In W2K3 server, it flat out breaks.
Mike T
2009-05-21 19:55:01
That's because XP doesn't support symlinks. That's a feature new to Vista. I believe that W2K3 server doesn't support symlinks either. You have to step up to W2K8 server to get symlink support. I'll look into why new-symlink is bombing on W2k3, it should error with a similar message to XP.
Keith Hill
2009-05-21 21:09:59
I tried new-junction and that will work for me. Too bad the link functionality doesn't degrade to junctions in XP and W2K3
Mike T
2009-05-21 22:06:23
on further use of new-junction... I get a junction to the new parse point. However ls (or get-childitem) errors stating that.."The filename, directory name, or volume label syntax is incorrect" If I try and enter a subdirectory from there.
Mike T
2009-05-21 23:24:11
+1
A:
you can use the utility:
c:\Windows\system32\fsutil.exe create hardlink
Cheeso
2009-05-21 20:41:09
It will require elevated privileges, though. Creating hardlinks usually doesn't.
Joey
2009-05-21 23:43:18
+3
A:
The Junction command line utility from Sysinternals makes creating and deleting symbolic (soft)links easy. Hard Links and Junctions in Windows.
notandy
2009-05-21 20:59:40
The use of this utility correctly allows me to junction another directory and traverse it's subdirectories successfully. All in XP and W2K3. Just add the exe to a directory in your PATH and call it like normal.
Mike T
2009-05-21 23:31:53