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 mimi
I combined two answers (@bviktor and @jocassid). It was tested on Windows 10 and Windows Server 2012.
function New-SymLink ($link, $target)
{
if ($PSVersionTable.PSVersion.Major -ge 5)
{
New-Item -Path $link -ItemType SymbolicLink -Value $target
}
else
{
$command = "cmd /c mklink /d"
invoke-expression "$command ""$link"" ""$target"""
}
}