From 84b89c326213f3315ac23f5d60770d9ebc2534c2 Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Mon, 2 Dec 2019 12:32:10 -0800 Subject: [PATCH 1/4] Ifdefs to decouple PS Core plugin from Windows dependencies. --- .../nativemsh/pwrshplugin/pwrshplugin.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/powershell-native/nativemsh/pwrshplugin/pwrshplugin.h b/src/powershell-native/nativemsh/pwrshplugin/pwrshplugin.h index 1c73e6b..f2c0993 100644 --- a/src/powershell-native/nativemsh/pwrshplugin/pwrshplugin.h +++ b/src/powershell-native/nativemsh/pwrshplugin/pwrshplugin.h @@ -584,11 +584,16 @@ class PwrshPlugInMediator return g_MANAGED_PLUGIN_ALREADY_LOADED; } +// Not used for CORECLR plugins +#if !CORECLR + if ((NULL == wszVCLRVersion) || (NULL == wszVAppBase)) { return g_INVALID_INPUT; } +#endif + do { // Setting global AppBase and CLR Version @@ -646,6 +651,10 @@ class PwrshPlugInMediator void LoadPowerShell(PCWSTR version) throw (...) { + unsigned int exitCode = EXIT_CODE_SUCCESS; + +// PowerShell core plugin does not depend on registered Windows PowerShell version. +#if !CORECLR // Verify incoming powershell version format. int iPSMajorVersion = 0; int iPSMinorVersion = 0; @@ -671,16 +680,18 @@ class PwrshPlugInMediator { requestedMonadMajorVersion = 1; } +#endif wchar_t* wszMonadVersion = NULL; // Allocated via ConstructPowerShellVersion || GetRegistryInfo wchar_t* wszTempCLRVersion = NULL; // Allocated via GetRegistryInfo wchar_t* wszTempAppBase = NULL; // Allocated via GetRegistryInfo PWSTR wszMgdPlugInFileName = NULL; // Allocated in CreateMgdPluginFileName - unsigned int exitCode = EXIT_CODE_SUCCESS; PlugInException* pErrorMsg = NULL; do { +// PowerShell core plugin does not depend on registered Windows PowerShell version. +#if !CORECLR exitCode = ConstructPowerShellVersion(iPSMajorVersion, iPSMinorVersion, &wszMonadVersion); if (exitCode != EXIT_CODE_SUCCESS) { @@ -711,9 +722,11 @@ class PwrshPlugInMediator { break; } +#endif if (!bIsPluginLoaded) { + // wszMgdPlugInFileName is ignored for CORECLR. this->powerShellClrHost = PowerShellClrWorkerFactory(wszMgdPlugInFileName); if (NULL == this->powerShellClrHost) { @@ -721,6 +734,7 @@ class PwrshPlugInMediator break; } + // wszMonadVersion, wszTempCLRVersion ignored for CORECLR. exitCode = powerShellClrHost->LaunchClr(wszMonadVersion, wszTempCLRVersion, "PwrshPlugin"); if (EXIT_CODE_SUCCESS != exitCode) { @@ -730,8 +744,10 @@ class PwrshPlugInMediator break; } + // wszMgdPlugInFileName, wszTempCLRVersion, wszTempAppBase ignored for CORECLR. exitCode = LoadManagedPlugIn(wszMgdPlugInFileName, wszTempCLRVersion, wszTempAppBase, &pErrorMsg); } +#if !CORECLR else { if (requestedMonadMajorVersion != iMajorVersion) @@ -747,6 +763,7 @@ class PwrshPlugInMediator exitCode = g_OPTION_SET_APP_BASE_NOT_MATCH; } } +#endif } while (false); if (NULL != wszMonadVersion) From f75aa936891eb6b17e78fad915933c62bcdef552 Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Tue, 3 Dec 2019 09:59:43 -0800 Subject: [PATCH 2/4] Temporarily have CI artifacts uploaded --- .vsts-ci/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vsts-ci/windows.yml b/.vsts-ci/windows.yml index ac07bdb..5d34caa 100644 --- a/.vsts-ci/windows.yml +++ b/.vsts-ci/windows.yml @@ -52,4 +52,4 @@ phases: - powershell: | Write-Host "##vso[artifact.upload containerfolder=artifacts;artifactname=artifacts]$(System.ArtifactsDirectory)\Packages\$(buildName)-symbols.zip" displayName: Upload artifacts - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) + condition: succeeded() From ef04cab137c2edfa0193c3a8d363d716a6d6e713 Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Wed, 4 Dec 2019 13:28:12 -0800 Subject: [PATCH 3/4] [Feature] From 062daabe6c9fbb6c26d8e1c8b24bb277f23c1cfc Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Wed, 4 Dec 2019 13:30:35 -0800 Subject: [PATCH 4/4] [Feature]