Skip to content
Merged
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 @@ -200,7 +200,7 @@ try
Invoke-Command $session { Set-Alias BrokenAlias NonExistantCommand }
$module = Import-PSSession $session -CommandName:BrokenAlias -CommandType:All -ErrorAction SilentlyContinue -ErrorVariable expectedError -AllowClobber

$expectedError | Should -Not -Be NullOrEmpty
$expectedError | Should -Not -BeNullOrEmpty
$expectedError[0].ToString().Contains("BrokenAlias") | Should -BeTrue
} finally {
if ($null -ne $module) { Remove-Module $module -Force -ErrorAction SilentlyContinue }
Expand Down Expand Up @@ -344,7 +344,7 @@ try
Export-PSSession -Session $session -CommandName Get-Variable -AllowClobber -ModuleName $file -EA SilentlyContinue -ErrorVariable expectedError
} catch { }

$expectedError | Should -Not -Be NullOrEmpty
$expectedError | Should -Not -BeNullOrEmpty
# Error contains reference to the directory that already exists
([string]($expectedError[0]) -like "*$file*") | Should -BeTrue
}
Expand Down Expand Up @@ -377,7 +377,7 @@ try

It "Verfies Remove-Module doesn't remove user's runspace" {
Remove-Module $module -Force -ErrorAction SilentlyContinue
(Get-PSSession -InstanceId $session.InstanceId) | Should -Not -Be NullOrEmpty
(Get-PSSession -InstanceId $session.InstanceId) | Should -Not -BeNullOrEmpty
}
}
}
Expand Down Expand Up @@ -764,11 +764,11 @@ try
}

It "Import-PSSession should return a PSModuleInfo object" {
$module | Should -Not -Be NullOrEmpty
$module | Should -Not -BeNullOrEmpty
}

It "Import-PSSession should return a PSModuleInfo object" {
($module -as [System.Management.Automation.PSModuleInfo]) | Should -Not -Be NullOrEmpty
($module -as [System.Management.Automation.PSModuleInfo]) | Should -Not -BeNullOrEmpty
}

It "Helper functions should not be imported" {
Expand Down Expand Up @@ -1333,7 +1333,7 @@ try
try {
$job = Get-Variable -Name PID -AsJob

$job | Should -Not -Be NullOrEmpty
$job | Should -Not -BeNullOrEmpty
($job -is [System.Management.Automation.Job]) | Should -BeTrue
($job.Finished.WaitOne([TimeSpan]::FromSeconds(10), $false)) | Should -BeTrue
$job.JobStateInfo.State | Should -Be 'Completed'
Expand Down Expand Up @@ -1647,7 +1647,7 @@ try
try {
Invoke-Command $session { function attack(${foo="$(calc)"}){echo "It is done."}}
$module = Import-PSSession -Session $session -CommandName attack -ErrorAction SilentlyContinue -ErrorVariable expectedError -AllowClobber
$expectedError | Should -Not -Be NullOrEmpty
$expectedError | Should -Not -BeNullOrEmpty
} finally {
if ($null -ne $module) { Remove-Module $module -Force -ErrorAction SilentlyContinue }
}
Expand All @@ -1659,7 +1659,7 @@ try
Invoke-Command $session { function Get-Command { write-error blah } }
$module = Import-PSSession -Session $session -ErrorAction SilentlyContinue -ErrorVariable expectedError -AllowClobber

$expectedError | Should -Not -Be NullOrEmpty
$expectedError | Should -Not -BeNullOrEmpty

$msg = [string]($expectedError[0])
$msg.Contains("blah") | Should -BeTrue
Expand All @@ -1675,7 +1675,7 @@ try
Invoke-Command $session { function notRequested { "notRequested" }; function Get-Command { Microsoft.PowerShell.Core\Get-Command Get-Variable,notRequested } }
$module = Import-PSSession -Session $session Get-Variable -AllowClobber -ErrorAction SilentlyContinue -ErrorVariable expectedError

$expectedError | Should -Not -Be NullOrEmpty
$expectedError | Should -Not -BeNullOrEmpty

$msg = [string]($expectedError[0])
$msg.Contains("notRequested") | Should -BeTrue
Expand Down Expand Up @@ -1996,7 +1996,7 @@ try

It "Select -First should work with implicit remoting" {
$bar = foo | Select-Object -First 2
$bar | Should -Not -Be NullOrEmpty
$bar | Should -Not -BeNullOrEmpty
$bar.Count | Should -Be 2
$bar[0] | Should -BeExactly "a"
$bar[1] | Should -BeExactly "b"
Expand Down