From e52da3b1e5c77c48bcbc3fe22673978609a4eaf0 Mon Sep 17 00:00:00 2001 From: George Fleming Date: Fri, 4 Mar 2016 16:01:24 -0800 Subject: [PATCH] Add hardlink test for New-Item --- test/powershell/New-Item.Tests.ps1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/powershell/New-Item.Tests.ps1 b/test/powershell/New-Item.Tests.ps1 index 1c66438b6e..5a873316e7 100644 --- a/test/powershell/New-Item.Tests.ps1 +++ b/test/powershell/New-Item.Tests.ps1 @@ -118,4 +118,15 @@ Describe "New-Item" { # Remove the link explicitly to avoid broken symlink issue Remove-Item $FullyQualifiedLink -Force } + + It "Should create a hard link of a file without error" { + New-Item -Name $testfile -Path $tmpDirectory -ItemType file + Test-Path $FullyQualifiedFile | Should Be $true + + New-Item -ItemType HardLink -Target $FullyQualifiedFile -Name $testlink -Path $tmpDirectory + Test-Path $FullyQualifiedLink | Should Be $true + } + + + }