Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8135,19 +8135,7 @@ internal static bool WinIsHardLink(ref IntPtr handle)
{
BY_HANDLE_FILE_INFORMATION handleInfo;
bool succeeded = InternalSymbolicLinkLinkCodeMethods.GetFileInformationByHandle(handle, out handleInfo);

if (!succeeded)
{
int lastError = Marshal.GetLastWin32Error();
throw new Win32Exception(lastError);
}

if (handleInfo.NumberOfLinks > 1)
{
return true;
}

return false;
return succeeded && (handleInfo.NumberOfLinks > 1);
}

private static string InternalGetTarget(SafeFileHandle handle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,22 @@ Describe "Get-ChildItem" -Tags "CI" {
Pop-Location
}

It "Should have a the proper fields and be populated" {
It "Should have all the proper fields and be populated" {
$var = Get-Childitem .

$var.Name.Length | Should -BeGreaterThan 0
$var.Mode.Length | Should -BeGreaterThan 0
$var.LastWriteTime | Should -BeGreaterThan 0
$var.Length.Length | Should -BeGreaterThan 0
}

It "Should have mode property populated for protected files on Windows" -Skip:(!$IsWindows) {
$files = Get-Childitem -Force ~\NT*
$files.Count | Should -BeGreaterThan 0
foreach ($file in $files)
{
$file.Mode | Should -Not -BeNullOrEmpty
}
}

It "Should list files in sorted order" {
Expand Down Expand Up @@ -153,11 +161,7 @@ Describe "Get-ChildItem" -Tags "CI" {
(Get-ChildItem -Path $searchRoot -Directory -Recurse).Count | Should -Be 1
}

It "Should give .sys file if the fullpath is specified with hidden and force parameter" -Pending:$true {
# Enable the test after move to .Net Core 2.1.1
# The tracking issue https://github.com/dotnet/corefx/issues/29782
#
#It "Should give .sys file if the fullpath is specified with hidden and force parameter" -Skip:(!$IsWindows){
It "Should give .sys file if the fullpath is specified with hidden and force parameter" -Skip:(!$IsWindows) {
# Don't remove!!! It is special test for hidden and opened file with exclusive lock.
$file = Get-ChildItem -path "$env:SystemDrive\\pagefile.sys" -Hidden
$file | Should not be $null
Expand Down