Powershell : Backup-SqlDatabase -ExpirationDate

寵の児 提交于 2019-12-11 11:39:37

问题


I try to use the snap-in Backup-SqlDatabase with an expirationDate, and I get an error : invalid value for the parameter EXPIREDATE. Can someone tell me how to format this parameter ?

Here's my code :

$expirationDate = Get-Date
$expirationDate = $expirationDate.AddDays($expirationDelayInDays)

Backup-SqlDatabase -ServerInstance $serverInstance -Database $database -ConnectionTimeout 0 -BackupFile $outputFile -ExpirationDate $expirationDate

来源:https://stackoverflow.com/questions/17144781/powershell-backup-sqldatabase-expirationdate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!