I have tried several was to use DSC to install AppFabric. A couple of them work.
xPackage installs the app but then it cant test for it, as there is no GUID to identify it.
Funny, I’m working on the exact same thing today. Here’s what I’ve got (below). Unfortunately it doesn’t always work, digging through the MSI log file trying to figure out the 1603 error when it fails to install.
configuration AppFabricTest
{
node (hostname)
{
Script AppFabric
{
GetScript = { Return "AppFabric" }
TestScript = {
$appFabric = Get-WmiObject -Class win32_product -Filter "Name='AppFabric 1.1 for Windows Server'"
if ($appFabric) {
Write-Verbose "AppFabric 1.1 for Windows Server is installed"
return $true
}
else
{
Write-Verbose "AppFabric 1.1 for Windows Server is not installed"
return $false
}
}
SetScript = {
Start-Process -FilePath 'C:\Temp\SharepointPreReqs\WindowsServerAppFabricSetup_x64.exe' -Wait -ArgumentList @(
'/i cacheclient,cachingService,cacheadmin'
'/gac'
'/l c:\temp\appfabric.log'
)
}
}
}
}
AppFabricTest -OutputPath c:\temp\AppFabricTest
Start-DscConfiguration -Verbose -Wait -Path c:\temp\AppFabricTest
I notice that when I run: $appFabric = Get-WmiObject -Class win32_product
I do not get Appfabric even though it’s installed.
Perhaps we are using a different version.
In any event, mine installs, it just does not wait till it’s finished.
One thing I did note; My install requires that the Windows Update service is running.