diff --git a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs index 6549e7345..e3462deb0 100644 --- a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs +++ b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs @@ -1284,7 +1284,7 @@ namespace System.Management.Automation { s_defaultMshSnapins = new List() { -#if !PORTABLE // Microsoft.PowerShell.Commands.Diagnostics.dll needs to be ported +#if !UNIX new DefaultPSSnapInInformation("Microsoft.PowerShell.Diagnostics", "Microsoft.PowerShell.Commands.Diagnostics", null, "GetEventResources,Description", "GetEventResources,Vendor"), #endif @@ -1303,7 +1303,7 @@ namespace System.Management.Automation "SecurityMshSnapInResources,Description","SecurityMshSnapInResources,Vendor") }; -#if !PORTABLE +#if !UNIX if (!Utils.IsWinPEHost()) { s_defaultMshSnapins.Add(new DefaultPSSnapInInformation("Microsoft.WSMan.Management", "Microsoft.WSMan.Management", null, diff --git a/test/powershell/engine/BasicEngine.Tests.ps1 b/test/powershell/engine/BasicEngine.Tests.ps1 index e51c778b3..eaa1e429e 100644 --- a/test/powershell/engine/BasicEngine.Tests.ps1 +++ b/test/powershell/engine/BasicEngine.Tests.ps1 @@ -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" + } } }