-
Notifications
You must be signed in to change notification settings - Fork 96
Description
This command
Backup-SQLDatabaseToFile -DatabaseServer NAVDEV1 -DatabaseName "Demo Database NAV (11-0-21836 GB)"
Gives me the following error. Is there an assumption that I am issuing the command from a session on the SQL server machine? "G" (referenced below) is the drive where the SQL backups are put by default.
Join-Path : Cannot find drive. A drive with the name 'G' does not exist.
At C:\Program Files\WindowsPowerShell\Modules\Cloud.Ready.Software.SQL\1.0.1.7\Backup-SQLDatabaseToFile.ps1:51 char:27
$BackupFileFullPath = Join-Path $Backuplocation $BackupFile
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : ObjectNotFound: (G:String) [Join-Path], DriveNotFoundException
- FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.JoinPathCommand
Backing up database ...
BACKUP DATABASE [Demo Database NAV (11-0-21836 GB)] TO DISK = N'' WITH COPY_ONLY, NOFORMAT, INIT, NAME = N'NAVAPP_QA_MT-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
Invoke-Sqlcmd : Invalid zero-length device name. Reissue the BACKUP statement with a valid device name.
BACKUP DATABASE is terminating abnormally.
At C:\Program Files\WindowsPowerShell\Modules\Cloud.Ready.Software.SQL\1.0.1.7\Backup-SQLDatabaseToFile.ps1:57 char:5
Invoke-Sqlcmd -Query $SQLString -ServerInstance "$DatabaseServer\ ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlPowerShellSqlExecutionException
- FullyQualifiedErrorId : SqlError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand
Get-Item : Cannot bind argument to parameter 'Path' because it is null.
At C:\Program Files\WindowsPowerShell\Modules\Cloud.Ready.Software.SQL\1.0.1.7\Backup-SQLDatabaseToFile.ps1:59 char:14
Get-Item $BackupFileFullPath
~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidData: (:) [Get-Item], ParameterBindingValidationException
- FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.GetItemCommand