diff --git a/src/powershell-native/CMakeLists.txt b/src/powershell-native/CMakeLists.txt index dd039341f5..5a97546023 100644 --- a/src/powershell-native/CMakeLists.txt +++ b/src/powershell-native/CMakeLists.txt @@ -62,7 +62,8 @@ SET (WIN_VERSION_WINXP 0x0501) #include(dsc_defs.cmake) if (BUILD_ONECORE) - include(nano_defs.cmake) + include(coreclr_defs.cmake) + #include(nano_defs.cmake) else () include(coreclr_defs.cmake) endif (BUILD_ONECORE) diff --git a/src/powershell-native/Install-PowerShellRemoting.ps1 b/src/powershell-native/Install-PowerShellRemoting.ps1 index 9ef4224e32..c83f46e81b 100644 --- a/src/powershell-native/Install-PowerShellRemoting.ps1 +++ b/src/powershell-native/Install-PowerShellRemoting.ps1 @@ -13,7 +13,15 @@ param ( - [Switch]$Verbose + [parameter(ParameterSetName = "ByPath")] + [ValidateNotNullOrEmpty()] + [string] + $PowerShellHome, + + [parameter(ParameterSetName = "ByPath")] + [ValidateNotNullOrEmpty()] + [string] + $PowerShellVersion ) function Register-WinRmPlugin @@ -74,13 +82,18 @@ function Generate-PluginConfigFile [string] [parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] - $pluginFile + $pluginFile, + + [string] + [parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + $powershellHomeDir ) # This always overwrites the file with a new version of it if the # script is invoked multiple times. - Set-Content -Path $pluginFile -Value "PSHOMEDIR=$PSHOME" - Add-Content -Path $pluginFile -Value "CORECLRDIR=$PSHOME" + Set-Content -Path $pluginFile -Value "PSHOMEDIR=$powershellHomeDir" + Add-Content -Path $pluginFile -Value "CORECLRDIR=$powershellHomeDir" Write-Verbose "Created Plugin Config File: $pluginFile" } @@ -103,7 +116,9 @@ if ($Verbose) $VerbosePreference = "Continue" } -$powershellVersion = $PSVersionTable.PSVersion +$powershellVersion = $PowershellVersion +$powershellHome = $PowerShellHome + $pluginBasePath = Join-Path "$env:WINDIR\System32\PowerShell" $powerShellVersion $resolvedPluginAbsolutePath = "" @@ -122,10 +137,10 @@ $pluginRawPath = Join-Path $resolvedPluginAbsolutePath "pwrshplugin.dll" $fixedPluginPath = $pluginRawPath -replace '\\','\\' # This is forced to ensure the the file is placed correctly -Copy-Item $PSHOME\pwrshplugin.dll $resolvedPluginAbsolutePath -Force -Verbose +Copy-Item $powershellHome\pwrshplugin.dll $resolvedPluginAbsolutePath -Force -Verbose $pluginFile = Join-Path $resolvedPluginAbsolutePath "RemotePowerShellConfig.txt" -Generate-PluginConfigFile $pluginFile +Generate-PluginConfigFile $pluginFile $powershellHome $pluginEndpointName = "powershell.$powershellVersion" diff --git a/src/powershell-native/coreclr_defs.cmake b/src/powershell-native/coreclr_defs.cmake index 1b4071895c..cfa4353d7d 100644 --- a/src/powershell-native/coreclr_defs.cmake +++ b/src/powershell-native/coreclr_defs.cmake @@ -171,13 +171,6 @@ add_compile_options($<$,$>:/MTd>) # clr_unknown_arch() #endif (CLR_CMAKE_TARGET_ARCH_AMD64) -# -# TODO: Are these needed??????????? -# -#add_definitions(-D_BLD_CLR) -#add_definitions(-DDEBUGGING_SUPPORTED) -#add_definitions(-DPROFILING_SUPPORTED) - add_definitions(-DWIN32) add_definitions(-D_WIN32) add_definitions(-DWINVER=${WIN_VERSION_WIN8})# 0x0601 for Win7, was 0x0602 diff --git a/src/powershell-native/nativemsh/pwrshexe/CMakeLists.txt b/src/powershell-native/nativemsh/pwrshexe/CMakeLists.txt index e0f8ada213..5c3ea6cd4d 100644 --- a/src/powershell-native/nativemsh/pwrshexe/CMakeLists.txt +++ b/src/powershell-native/nativemsh/pwrshexe/CMakeLists.txt @@ -8,17 +8,17 @@ if (BUILD_ONECORE) CssMainEntry.cpp ) set(PWRSHEXE_WINDOWS_LIBS -### ${STATIC_MT_CRT_LIB} -### ${STATIC_MT_VCRT_LIB} -### ${STATIC_UCRT_LIB} onecore.lib - vcruntime.lib - ucrtd.lib - msvcrt.lib - msvcrt.lib - msvcprtd.lib - user32.lib - atls.lib + ${STATIC_MT_CRT_LIB} # use for coreclr_defs + ${STATIC_MT_VCRT_LIB} # use for coreclr_defs +### ${STATIC_UCRT_LIB} + #vcruntime.lib# use for nano_defs + #ucrtd.li# use for nano_defs + #msvcrt.lib# use for nano_defs + #msvcrt.lib# use for nano_defs + #msvcprtd.lib# use for nano_defs + #user32.lib # use for nano_defs + #atls.lib# use for nano_defs ) set(powershell_definitions _CONSOLE diff --git a/src/powershell-native/nativemsh/pwrshplugin/CMakeLists.txt b/src/powershell-native/nativemsh/pwrshplugin/CMakeLists.txt index 981d69d82a..a23d2936ea 100644 --- a/src/powershell-native/nativemsh/pwrshplugin/CMakeLists.txt +++ b/src/powershell-native/nativemsh/pwrshplugin/CMakeLists.txt @@ -13,16 +13,27 @@ add_library(pwrshplugin SHARED if (BUILD_ONECORE) # Libraries to use when creating this binary for Windows on OneCore-based SKUs set(PWRSHPLUGIN_WINDOWS_LIBS -### ${STATIC_MT_CRT_LIB} -### ${STATIC_MT_VCRT_LIB} + ${STATIC_MT_CRT_LIB} # use for coreclr_defs + ${STATIC_MT_VCRT_LIB} # use for coreclr_defs ### ${STATIC_UCRT_LIB} - onecore.lib - vcruntime.lib - ucrtd.lib - msvcrt.lib - msvcprtd.lib - user32.lib - atls.lib + + kernel32.lib + advapi32.lib + ole32.lib + #oleaut32.lib + #uuid.lib + #user32.lib + #version.lib + #shlwapi.lib + #bcrypt.lib + + #onecore.lib #use for nano_defs + #vcruntime.lib # use for nano_defs + #ucrtd.lib # use for nano_defs + #msvcrt.lib # use for nano_defs + #msvcprtd.lib # use for nano_defs + #user32.lib # use for nano_defs + #atls.lib # use for nano_defs wsmsvc.lib ) set_target_properties(pwrshplugin PROPERTIES COMPILE_DEFINITIONS "CORECLR")