Script Error

Dec 19, 2014 at 6:40 AM
Hello.

We start the script in TaskScheduler with:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noprofile -ExecutionPolicy Bypass –File D:\SharePoint\PSScripts\SPSBackUP.ps1 -xmlData [xml](get-content .\SPSBackUP.xml)

Is this correct?

The script generates following errors:

PS>TerminatingError(Test-Path): "Cannot bind argument to parameter 'Path' because it is null."
Test-Path : Cannot bind argument to parameter 'Path' because it is null.
At D:\SharePoint\PSScripts\SPSBackUP.ps1:246 char:17
  • If ((Test-Path $BackUpPATH) -ne $true)
  • ~~~~~~~~~~~
    • CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCom
      mand
PS>TerminatingError(Backup-SPFarm): "Cannot bind argument to parameter 'Directory' because it is null."
Backup-SPFarm : Cannot bind argument to parameter 'Directory' because it is null.
At D:\SharePoint\PSScripts\SPSBackUP.ps1:199 char:27
  • Backup-SPFarm -Directory $BackupFolder -BackupMethod full
  • ~~~~~~~~~~~~~
    • CategoryInfo : InvalidData: (:) [Backup-SPFarm], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.SharePoint.PowerShell.SPCmdletB
      ackupFarm
What's wrong or missing?

Manny thanks for your Answer.

Regards
gmlu