@@ -105,6 +105,18 @@ $Script:SPSEFeatures = @("NET-WCF-Pipe-Activation45",
105105 " WAS" , " WAS-Process-Model" , " WAS-Config-APIs" , " Web-Mgmt-Console" ,
106106 " Web-Mgmt-Tools" )
107107
108+ $Script :SPSEWinCoreFeatures = @ (" NET-WCF-Pipe-Activation45" ,
109+ " NET-WCF-HTTP-Activation45" , " NET-WCF-TCP-Activation45" ,
110+ " Web-Server" , " Web-WebServer" , " Web-Common-Http" ,
111+ " Web-Static-Content" , " Web-Default-Doc" , " Web-Dir-Browsing" ,
112+ " Web-Http-Errors" , " Web-App-Dev" , " Web-Asp-Net45" , " Web-Net-Ext45" ,
113+ " Web-ISAPI-Ext" , " Web-ISAPI-Filter" , " Web-Health" , " Web-Http-Logging" ,
114+ " Web-Log-Libraries" , " Web-Request-Monitor" , " Web-Http-Tracing" ,
115+ " Web-Security" , " Web-Basic-Auth" , " Web-Windows-Auth" , " Web-Filtering" ,
116+ " Web-Performance" , " Web-Stat-Compression" , " Web-Dyn-Compression" ,
117+ " WAS" , " WAS-Process-Model" , " WAS-Config-APIs" ,
118+ " Web-Mgmt-Tools" )
119+
108120function Get-TargetResource
109121{
110122 [CmdletBinding ()]
@@ -388,8 +400,17 @@ function Get-TargetResource
388400 }
389401 elseif ($osVersion.Build -ge 20000 )
390402 {
391- Write-Verbose - Message " OS Version: Windows Server 2022"
392- $WindowsFeatures = Get-WindowsFeature - Name $Script :SPSEFeatures
403+ $OSServerLevel = Get-ComputerInfo | Select-Object $OSServerLevel
404+ if ($OSServerLevel -eq " FullServer" )
405+ {
406+ Write-Verbose - Message " OS Version: Windows Server 2022"
407+ $WindowsFeatures = Get-WindowsFeature - Name $Script :SPSEFeatures
408+ }
409+ elseif ($OSServerLevel -eq " ServerCore" )
410+ {
411+ Write-Verbose - Message " OS Version: Windows Server 2022 Core"
412+ $WindowsFeatures = Get-WindowsFeature - Name $Script :SPSEWinCoreFeatures
413+ }
393414 }
394415 else
395416 {
@@ -628,6 +649,7 @@ function Get-TargetResource
628649 MSVCRT11 = $MSVCRT11
629650 MSVCRT14 = $MSVCRT14
630651 MSVCRT141 = $MSVCRT141
652+ MSVCRT142 = $MSVCRT142
631653 KB3092423 = $KB3092423
632654 ODBC = $ODBC
633655 DotNetFx = $DotNetFx
0 commit comments