mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Fix issue #1609 - Get-PSSession -computername fails on nano
Root cause: Microsoft.WSMan.Management and Microsoft.PowerShell.Commands.Diagnostics are not put in the default snapin list for win-ops, and thus when a runspace is created using RunspaceConfiguration, those 2 are not loaded as snapins by default, which is a behavior change compared to Nano PS. Fix: Replace the guard 'PORTABLE' to be 'UNIX' so that they are in the default snapin list when targeting windows platform.
This commit is contained in:
1 parent
70aea51cb1
commit
dc9b326587
2 files changed
+11
-2
No files matched your search
@@ -3,5 +3,14 @@ Describe 'Basic engine APIs' -Tags "CI" {
|
||||
It 'can create default instance' {
|
||||
[powershell]::Create() | Should Not Be $null
|
||||
}
|
||||
|
||||
It "can load the default snapin 'Microsoft.WSMan.Management'" -skip:(-not $IsWindows) {
|
||||
$ps = [powershell]::Create()
|
||||
$ps.AddScript("Get-Command -Name Test-WSMan") > $null
|
||||
|
||||
$result = $ps.Invoke()
|
||||
$result.Count | Should Be 1
|
||||
$result[0].PSSnapIn.Name | Should Be "Microsoft.WSMan.Management"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user