Private/Helper/Test-IsServer.ps1
<#
Copyright © 2024 Integris. For internal company use only. All rights reserved. #> FUNCTION Test-IsServer { <# .SYNOPSIS Determines if the operating system is a server edition. .DESCRIPTION This function checks the product type of the operating system to determine if it is a server edition. .PARAMETER None .EXAMPLE Test-IsServer .NOTES The function uses the Get-CIMInstance cmdlet to get the product type of the operating system. #> $ProductType = (Get-CIMInstance Win32_OperatingSystem).ProductType IF ($ProductType -eq 2) { RETURN $True } IF ($ProductType -eq 3) { RETURN $True } RETURN $False } |