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 @@ -24,14 +24,14 @@ Describe "Get-FileHash" -Tags "CI" {
}

It "Should write non-terminating error if argument is a folder" {
$result = $PSHOME, "${pshome}\pwsh.dll" | Get-FileHash -ErrorVariable errorVariable
$result = $PSHOME, "${pshome}\pwsh.dll" | Get-FileHash -ErrorVariable errorVariable -ErrorAction SilentlyContinue
$result.Count | Should -Be 1
$errorVariable.FullyQualifiedErrorId | Should -BeExactly "UnauthorizedAccessError,Microsoft.PowerShell.Commands.GetFileHashCommand"
}

It "Should write non-terminating error if a file is locked" -Skip:(-not $IsWindows) {
$pagefilePath = (Get-CimInstance -ClassName Win32_PageFileusage).Name
$result = $pagefilePath, "${pshome}\pwsh.dll" | Get-FileHash -ErrorVariable errorVariable
$result = $pagefilePath, "${pshome}\pwsh.dll" | Get-FileHash -ErrorVariable errorVariable -ErrorAction SilentlyContinue
$result.Count | Should -Be 1
$errorVariable.FullyQualifiedErrorId | Should -BeExactly "FileReadError,Microsoft.PowerShell.Commands.GetFileHashCommand"
}
Expand Down Expand Up @@ -89,7 +89,7 @@ Describe "Get-FileHash" -Tags "CI" {
$newPath = Get-FileHash -Path $testDocumentCopy | Rename-Item -NewName {$_.Hash} -PassThru
$newPath.FullName | Should -Exist

Remove-Item -Path $testDocumentCopy -Force
Remove-Item -Path $testDocumentCopy -Force -ErrorAction SilentlyContinue
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Describe "Get-RunspaceDebug" -Tags "CI" {

Context "Check return types of RunspaceDebug" {

It "Should return Microsoft.Powershell.Commands.PSRunspaceDebug as the return type" {
$rs = Get-RunspaceDebug
$rs | Should -Not -BeNullOrEmpty
$rs[0] | Should -BeOfType Microsoft.PowerShell.Commands.PSRunspaceDebug
}
It "Should return Microsoft.Powershell.Commands.PSRunspaceDebug as the return type" {
$rs = Get-RunspaceDebug -ErrorAction SilentlyContinue
$rs | Should -Not -BeNullOrEmpty
$rs[0] | Should -BeOfType Microsoft.PowerShell.Commands.PSRunspaceDebug
}
}
}