"Create" is no approved verb in PowerShell
-function Create-Backup([String]$database, [String]$target) {
+function Invoke-DatabaseBackup([String]$database, [String]$target) {
& $configMysqldumpCli --host=$configMysqlHost --port=$configMysqlPort --user=$configMysqlUser --password=$configMysqlPassword --single-transaction --result-file=$target $database
if($LastExitCode -ne 0) {
& $configMysqldumpCli --host=$configMysqlHost --port=$configMysqlPort --user=$configMysqlUser --password=$configMysqlPassword --single-transaction --result-file=$target $database
if($LastExitCode -ne 0) {
- Create-Backup $d $databaseBackupFile
+ Invoke-DatabaseBackup $d $databaseBackupFile
Invoke-FileRotation -Dir $databaseBackupDir -MaxFiles $configBackupRotate -Pattern $patternBackupFile -LogFile $logFile
}
catch {
Invoke-FileRotation -Dir $databaseBackupDir -MaxFiles $configBackupRotate -Pattern $patternBackupFile -LogFile $logFile
}
catch {