问题
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