Error after running the following script


  • Testing the following script:

    I have saved revision2 in a file fullbackupwithfilerotation.ps1 and trying to run the script. My script is saved in D:\Scripts and backup is saved in D:\Backupfarm, configdbInstance devwinsql2

    PS D:\Scripts> .\fullbackupwithfilerotation.ps1 -drive "D:" -backupDir "D:\Backupfarm" -fullBackupDay "Sunday" -configDBInstance sql\devwinsql2 -configDBName wss_content_team -nbrDaysRetained 14

    getting the following error :

    Missing expression after ','.
    At D:\Scripts\fullbackupwithfilerotation.ps1:118 char:39
    + param([string]$drive = $(Throw "D:\"), <<<<  `
        + CategoryInfo          : ParserError: (,:OperatorToken) [], ParseExceptio
        + FullyQualifiedErrorId : MissingExpressionAfterToken

    The original script read as following .\BackupSharePoint.ps1 -drive "C:" -backupDir "\\server\backups"  
        -fullBackupDay "Sunday" -configDBInstance sql\sql01 -configDBName ConfigDB  
        -nbrDaysRetained 14 

    Do I have to change version 2 parameter

    # Declare the script's input parameters
    param([string]$drive = $(Throw "D:\"), `
          [string]$backupDir = $(Throw "D:\Backupfarm"), `
         [string]$fullBackupDay = $(Throw "the fullBackupDay parameter is required."), `
          #[string]$logStorage, `
          [string]$configDBInstance, `
          [string]$configDBName, `
      [string]$nbrDaysRetained = $(Throw "the nbrDaysRetained parameter's required."), `
          #[string]$sharePointVersion = $(throw "the SP Version parameter is required."), `
    # END Parameters

    Please advice. Thanks in advance.

    Friday, July 20, 2012 8:39 PM

All replies

  • The only thing that stands out to me at a glance is that you've listed a content database as your configdb.  Is your farm configuration db really "wss_content_team?"

    Colorless Green Ideas Sleep Furiously

    Monday, August 20, 2012 4:24 PM