This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
Improve speed of Test-IsNanoServer function #155
Labels
enhancement
The issue is an enhancement request.
in progress
The issue is being actively worked on by someone.
Opening a dedicated issue to track the issue @X-Guardian tried to fix in #154. Currently, the Test-IsNanoServer function calls the Get-ComputerInfo cmdlet to check with the computer is running Nano server or not. Get-ComputerInfo can take 40+ seconds to run each time. This function is called for each user and group resource within a Dsc configuration and therefore can make the Dsc application very slow.
Recommended fix:
Replace Get-ComputerInfo with checking the registry value at HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Server\ServerLevels\NanoServer, as documented here: https://msdn.microsoft.com/en-us/library/windows/desktop/hh846315(v=vs.85).aspx
The text was updated successfully, but these errors were encountered: