-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase Performance of Test-IsNanoServer #652
Comments
One possible way of increasing performance is to instead use a CIM command to pull the $productDatacenterNanoServer = 143
$productStandardNanoServer = 144
function Test-IsNanoServer
{
[OutputType([System.Boolean])]
[CmdletBinding()]
param ()
$operatingSystemSKU = (Get-CimInstance -ClassName Win32_OperatingSystem).OperatingSystemSKU
return ($operatingSystemSKU -in ($productDatacenterNanoServer,$productStandardNanoServer))
} Is there anyone who knows a reason why this would not be a viable alternative? @gaelcolas , @johlju |
If the class exist in a Nano server then I don't see an issue using it. |
The class exists on Nanaoserver. Ref: https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/mt588480(v=vs.85) Any reason not to go ahead and implement this as in "Add Test-IsNanoServer dsccommunity/DscResource.Common#9"? |
No reason at all :) Please go ahead @HansOMartinsen ! |
Implementing #685 will resolve this issue. I'll be planning this over the next week. |
The cmdlet
Test-IsNanoServer
is used by many of the resources. This cmdlet usesGet-ComputerInfo
to determine if the machine is Nano server:However,
Get-ComputerInfo
is very slow, taking over 2 seconds on average to execute.This causes the resources to run slow and increases overall test time significantly.
We should find a better way to detect if a machine is Nano Server.
The text was updated successfully, but these errors were encountered: