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
2 changes: 1 addition & 1 deletion Tests/Private/Skip-ExcludedItem.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Describe "Skip-ExcludedItem PS$PSVersion" {
Set-Content -Path (Join-Path $Folder 'data.txt') -Value 'a'
$Files = Get-ChildItem -Path $Folder

$ByPath = [WildcardPattern]::new("$Folder\*.log", 'IgnoreCase')
$ByPath = [WildcardPattern]::new((Join-Path $Folder '*.log'), 'IgnoreCase')
$Result = @(Skip-ExcludedItem -InputObject $Files -Matcher $ByPath)
$Result.Name | Should -Be 'data.txt'

Expand Down
6 changes: 4 additions & 2 deletions Tests/Public/Watch-Command.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ Describe "Watch-Command PS$PSVersion" {
Get-ChildItem -Path $script:Folder
}

$Result = @(Watch-Command -ScriptBlock $Sb -Key Name -Property Name, Length -Exclude "$script:Folder\*.log")
$Result = @(Watch-Command -ScriptBlock $Sb -Key Name -Property Name, Length -Exclude (Join-Path $script:Folder '*.log'))

$Result.Count | Should -Be 1
$Result[0].Key | Should -Be 'data.txt'
Expand Down Expand Up @@ -763,7 +763,9 @@ Describe "Watch-Command PS$PSVersion" {
$PowerShell = [powershell]::Create()

try {
$null = $PowerShell.AddCommand('Import-Module').AddParameter('Name', (Get-Module Watch).Path).Invoke()
# This runs inside the module (InModuleScope), so ask it for its own path: Get-Module Watch
# can't see the module from here, as the test file imported it into Pester's scope.
$null = $PowerShell.AddCommand('Import-Module').AddParameter('Name', $ExecutionContext.SessionState.Module.Path).Invoke()
$PowerShell.Commands.Clear()
$null = $PowerShell.AddCommand('Watch-Command')

Expand Down
Loading