An issue found when repeating installer script with Foundation binaries already in place, the installer fails to detect the product installed and falls over after invoking setup again. Turns out the Get-SharePointInstall function is specifically looking for the Server class name:
Function Get-SharePointInstall
{
if (Get-Command Get-CimInstance -ErrorAction SilentlyContinue)
{
# New way, borrowed from xSharePoint DSC project (https://github.com/PowerShell/xSharePoint)
if (Get-CimInstance -ClassName Win32_Product -Filter "Name like 'Microsoft SharePoint Server%'")
...
Probably needs to have an additional check for Foundation, if the detection needs to avoid false positives from SP Designer etc.
Function Get-SharePointInstall
{
if (Get-Command Get-CimInstance -ErrorAction SilentlyContinue)
{
# New way, borrowed from xSharePoint DSC project (https://github.com/PowerShell/xSharePoint)
if (Get-CimInstance -ClassName Win32_Product -Filter "Name like 'Microsoft SharePoint Server%'")
...
Probably needs to have an additional check for Foundation, if the detection needs to avoid false positives from SP Designer etc.