I am trying to automate the installation of HPC Pack to set up a head node using PowerShell DSC.
The following code succeeds but returns very quickly with exit code 10 from the process:
Configuration TestHpcInstall
{
Import-DscResource –ModuleName PSDesiredStateConfiguration
Node $AllNodes.Where({$_.Roles -contains 'HpcHeadNode'}).NodeName
{
$HpcPackName = "Microsoft HPC Pack 2012 R2 Server Components"
$HpcPackSourcePath = "C:\Temp\HPC2012R2_Update3_Full\setup.exe"
$sqlServer = "EMEAWINQA15"
$Arguments = "-unattend -headNode"
Script TestInstall
{
GetScript = {
return @{ "Result" = "$true"}
}
TestScript = {
return $false
}
SetScript = {
Write-Verbose "HpcPackSourcePath: $using:HpcPackSourcePath"
Write-Verbose "Arguments: $using:Arguments"
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = $using:HpcPackSourcePath
$startInfo.Arguments = $using:Arguments
$process = New-Object System.Diagnostics.Process
$process.StartInfo = $startInfo
$exitcode = 0
$process.Start() | Out-Null
$process.WaitForExit()
if($process)
{
$exitCode = $process.ExitCode
Write-Verbose "Exit code: $exitCode"
}
}
}
}
}
TestHpcInstall -ConfigurationData $configData -OutputPath "C:\Temp"
Start-DscConfiguration -ComputerName "EMEAWINQA15" -Path "C:\Temp\" -Verbose -Wait -Force
Strange this is, when I run just the process part locally (everything in the SetScript function above) it works fine. So I'm just confused: can anyone tell me what exit code 10 is from the HPC Pack setup.exe?
Thanks,