From e647549d0d53ff714c536f7f62ba613ce2a19ccb Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Tue, 28 Jun 2016 12:01:46 -0700 Subject: [PATCH] Exclude Microsoft.WSMan.Management from the list of default snapins Fix #1180 --- build.psm1 | 2 +- .../singleshell/config/MshSnapinInfo.cs | 2 +- test/powershell/engine/BasicEngine.Tests.ps1 | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 test/powershell/engine/BasicEngine.Tests.ps1 diff --git a/build.psm1 b/build.psm1 index d48eb97a8d..30a0dc4154 100644 --- a/build.psm1 +++ b/build.psm1 @@ -156,7 +156,7 @@ function Start-PSBuild { # handle xaml files # Heuristic to resolve xaml on the fresh machine - if ($FullCLR -and ($XamlGen -or -not (Test-Path "$PSScriptRoot/src/Microsoft.PowerShell.Activities/gen/*.g.resources"))) + if ($FullCLR -and ($XamlGen -or -not (Test-Path "$PSScriptRoot/src/Microsoft.PowerShell.Activities/gen/*.g.cs"))) { log "Run XamlGen (generating .g.cs and .resources for .xaml files)" Start-XamlGen -MSBuildConfiguration $msbuildConfiguration diff --git a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs index 33faeb13c1..dd0209b664 100644 --- a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs +++ b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs @@ -1409,7 +1409,7 @@ namespace System.Management.Automation "SecurityMshSnapInResources,Description","SecurityMshSnapInResources,Vendor") }; -#if !LINUX +#if !PORTABLE if (!Utils.IsWinPEHost()) { 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 new file mode 100644 index 0000000000..73e4cf705b --- /dev/null +++ b/test/powershell/engine/BasicEngine.Tests.ps1 @@ -0,0 +1,7 @@ +Describe 'Basic engine APIs' { + Context 'powershell::Create' { + It 'can create default instance' { + [powershell]::Create() | Should Not Be $null + } + } +}