dataplat / docs

The documentation for dbatools module. Issues with command doc and bugs should be reported to dataplat/dbatools.
https://docs.dbatools.io
15 stars 12 forks source link

Issue with Piping Get-DBADatabase to Backup-DBADatabase and using -ReplaceInName #62

Closed wgshef closed 2 years ago

wgshef commented 2 years ago

servername is returning an empty string. Example: Get-DBADatabase -SqlInstance MySQLInstance -RecoveryModel Full | Backup-DbaDatabase -Path V:\servername\Backup\dbname\backuptype -FilePath dbname-backuptype-timestamp.bak -ReplaceInName -CompressBackup -Checksum -type Full -OutputScriptOnly | Out-File C:\DBA\BackupDatabasesFullRM.sql

Getting message:

SQL Server cannot check if V:\\Backup\<databasename>\Full exists. You can try disabling this check with -IgnoreFileChecks

When I run this without the Get-DBADatabase being piped to it (and adding -SqlInstance to the command), it works properly.

wsmelton commented 2 years ago

We've had a few version releases since this issue was created. If the issue still exists in the latest release please create a new issue on the module's repo dataplat/dbatools.