Script Halts after Service Pack 2 install

Nov 1, 2013 at 7:31 PM
This looks like a great tool. I am having an issue after Service Pack 2 installs. I have looked through the log and rechecked all my settings and can't see the error. Thanks for assistance with this.

Scott

- SharePoint 2010 binaries appear to be already installed - skipping installation.


  • Installing SharePoint Language Packs:
  • Installing ServerLanguagePack_SP2_en-us.exe.............Done.
  • Language pack ServerLanguagePack_SP2_en-us.exe setup completed in 00:00:50.
  • No Language Pack service packs found.
  • Language Pack installation complete.
  • Currently installed languages:

- English (United States)


  • Looking for SharePoint updates to install...
    • Installing SP2010 Service Pack 2 oserversp2010-kb2687453-fullfile-x64-en-us.exe....Done.
    • Patch not required; installed product is same or newer.
    • Service Pack 2 install completed in 00:00:05.
    • Installing SP2010 ...--------------------------------------------------------------
  • Script halted!
Exception : System.Management.Automation.ParameterBindingValidationException: Cannot va
                    lidate argument on parameter 'Name'. The argument is null or empty. Supply 
                    an argument that is not null or empty and then try the command again. ---> 
                    System.Management.Automation.ValidationMetadataException: The argument is n
                    ull or empty. Supply an argument that is not null or empty and then try the
                     command again.
                       at System.Management.Automation.ValidateNotNullOrEmptyAttribute.Validate
                    (Object arguments, EngineIntrinsics engineIntrinsics)
                       at System.Management.Automation.ParameterBinderBase.BindParameter(Comman
                    dParameterInternal parameter, CompiledCommandParameter parameterMetadata, P
                    arameterBindingFlags flags)
                       --- End of inner exception stack trace ---
                       at System.Management.Automation.ParameterBinderBase.BindParameter(Comman
                    dParameterInternal parameter, CompiledCommandParameter parameterMetadata, P
                    arameterBindingFlags flags)
                       at System.Management.Automation.CmdletParameterBinderController.BindPara
                    meter(CommandParameterInternal argument, MergedCompiledCommandParameter par
                    ameter, ParameterBindingFlags flags)
                       at System.Management.Automation.CmdletParameterBinderController.BindPara
                    meter(UInt32 parameterSets, CommandParameterInternal argument, MergedCompil
                    edCommandParameter parameter, ParameterBindingFlags flags)
                       at System.Management.Automation.CmdletParameterBinderController.BindPara
                    meters(UInt32 parameterSets, Collection`1 arguments, CommandMetadata comman
                    dMetadata)
                       at System.Management.Automation.CmdletParameterBinderController.BindComm
                    andLineParametersNoValidation(Collection`1 arguments)
                       at System.Management.Automation.CmdletParameterBinderController.BindComm
                    andLineParameters(Collection`1 arguments)
                       at System.Management.Automation.CommandProcessor.BindCommandLineParamete
                    rs(CommandParameterInternal[] parameters)
                       at System.Management.Automation.CommandProcessor.Prepare(CommandParamete
                    rInternal[] parameters)
                       at System.Management.Automation.CommandProcessorBase.DoPrepare(CommandPa
                    rameterInternal[] parameters)
                       at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean
                     incomingStream)
                       at System.Management.Automation.Internal.PipelineProcessor.SynchronousEx
                    ecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
TargetObject :
CategoryInfo : InvalidData: (:) [Get-Process], ParameterBindingValidationException
FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.GetProcessCo
                    mmand
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
PipelineIterationInfo : {}

PSMessageDetails :

| Automated SP2010 install script |
| Started on: 11/1/2013 3:23:01 PM |

| Aborted: 11/1/2013 3:23:58 PM |

PS C:\SP2010\AutoSPInstaller>
PS C:\SP2010\AutoSPInstaller>
Nov 11, 2013 at 5:41 PM
Ok, I found the cause. I had only downloaded SharePoint2010 SP2 and the latest CU, not SP1 and June 2012 CU

I found this today,

Region Install Update(s)

===================================================================================

Func: InstallUpdates

Desc: Install SharePoint Updates (CUs and Service Packs) to work around slipstreaming issues

===================================================================================

Function InstallUpdates
{
WriteLine
Write-Host -ForegroundColor White " - Looking for SharePoint updates to install..."
$spYears = @{"14" = "2010"; "15" = "2013"}
$spYear = $spYears.$env:spVer
# Result codes below are from http://technet.microsoft.com/en-us/library/cc179058(v=office.14).aspx
$oPatchInstallResultCodes = @{"17301" = "Error: General Detection error";
                              "17302" = "Error: Applying patch";
                              "17303" = "Error: Extracting file";
                              "17021" = "Error: Creating temp folder";
                              "17022" = "Success: Reboot flag set";
                              "17023" = "Error: User cancelled installation";
                              "17024" = "Error: Creating folder failed";
                              "17025" = "Patch already installed";
                              "17026" = "Patch already installed to admin installation";
                              "17027" = "Installation source requires full file update";
                              "17028" = "No product installed for contained patch";
                              "17029" = "Patch failed to install";
                              "17030" = "Detection: Invalid CIF format";
                              "17031" = "Detection: Invalid baseline";
                              "17034" = "Error: Required patch does not apply to the machine";
                              "17038" = "You do not have sufficient privileges to complete this installation for all users of the machine. Log on as administrator and then retry this installation";
                              "17044" = "Installer was unable to run detection for this package"}
if ($spYear -eq "2010")
{
    $sp2010SP1 = Get-ChildItem "$bits\$spYear\Updates" -Name -Include "officeserver2010sp1-kb2460045-x64-fullfile-en-us.exe" -ErrorAction SilentlyContinue
    ##$sp2010June2012CU = Get-ChildItem "$bits\$spYear\Updates" -Name -Include "office2010-kb2598354-fullfile-x64-glb.exe" -ErrorAction SilentlyContinue
    $sp2010June2013CU = Get-ChildItem "$bits\$spYear\Updates" -Name -Include "ubersrv2010-kb2817527-fullfile-x64-glb.exe" -ErrorAction SilentlyContinue
    $sp2010SP2 = Get-ChildItem "$bits\$spYear\Updates" -Name -Include "oserversp2010-kb2687453-fullfile-x64-en-us.exe" -ErrorAction SilentlyContinue
    # First & foremost, install SP2 if it's there
    if ($sp2010SP2)
    {
        InstallSpecifiedUpdate $sp2010SP2 "Service Pack 2"
        # Now install any language pack service packs that are found, using the naming convention for SP2
        $sp2010LPServicePacks = Get-ChildItem "$bits\$spYear\Updates" -Name -Include oslpksp2010*.exe -ErrorAction SilentlyContinue | Sort-Object -Descending
        foreach ($sp2010LPServicePack in $sp2010LPServicePacks)
        {
            InstallSpecifiedUpdate $sp2010LPServicePack ""
        }
    }
So it was looking for SP1 and the June 2012 CU as well in the script. I downloaded them to the updates folder and reran the installer. It is installing.
Marked as answer by scottpayne on 11/11/2013 at 10:41 AM
Nov 18, 2013 at 2:27 PM
Edited Nov 18, 2013 at 2:59 PM
Hi I spotted this a few weeks back so sorry for not reporting back sooner ... In my case I simply commented out the code causing the error since I wasn't installing a language pack

Having re-read your post a few times I would seem similar to mine issue so it may make my fix invalid - not sure. Firstly, I put some debug statements in the script to show what updates it had located.

_sp2010 officeserver2010sp1-kb2460045-x64-fullfile-en-us.exe
sp2010June2013CU <-- null so this is notavailable......
sp2010SP2 oserversp2010-kb2687453-fullfile-x64-en-us.exe
_

My error seems to be at this line
if ($sp2010LPServicePacks -eq $null)
            {
                  Write-host -fore darkred "DAN: No language packs which is fine!"
            }
            
            
            foreach ($sp2010LPServicePack in $sp2010LPServicePacks)
            {
                Write-host -fore darkred "DAN: Now Here $sp2010LPServicePack !" 
                 # this line causes the issue
                InstallSpecifiedUpdate $sp2010LPServicePack ""
            }
            
One possible workaround which I have just tested is you can add this to Function InstallSpecifiedUpdate ($updateFile, $updateName)
function defintion
if ([string]::IsNullOrEmpty($updateFile)) 
    {
         # @westerdaled - this is option can be used throughout the code but does require a commnent
         # in the directly preceding code so you can figure why the UpdateFile is null or empty
         Write-Warning "No Update file supplied so nothing to do...."
         return
    }
    
    Write-Host -ForegroundColor Blue "  - Installing SP$spYear $updateName $updateFile..." -NoNewline
An alternative is to put the null check in the calling code that wraps the for each call but that could be pretty tedious to implement.
  
    If  ([string]::IsNullOrEmpty($updateFile) -ne $true)
    {
            foreach ($sp2010LPServicePack in $sp2010LPServicePacks)
            {
                Write-host -fore darkred "DAN: Now Here $sp2010LPServicePack !" 
                InstallSpecifiedUpdate $sp2010LPServicePack ""
                
            }
        }   
Now Brian La should ultimately decide which if any of the two approaches is valid as he is the architect and not me!
Coordinator
Nov 19, 2013 at 8:59 PM
Hey,

Your best bet is to post this on the AutoSPInstaller codeplex pages. I don't have control over the other project :)

Thanks,
Ivan