如何更改日期

时间:2018-01-09 21:14:16

标签: sql database powershell azure

如何根据PC时间更改日期? 例如:

$StorageUri = "https://strdatabasebackup.blob.core.windows.net/strdatabasebackupblob/(2018-01-09-07:00)dbdom_buin.bacpac";

如何使我要保存的文件自动更改日期而无需每天更改?

1 个答案:

答案 0 :(得分:1)

将日期构建为变量format options here

$dateVar = Get-Date -format s

然后从中构建$StorageUri路径:

$StorageUri = "https://strdatabasebackup.blob.core.windows.net/strdatabasebackupblob/(" + $dateVar + ")dbdom_buin.bacpac"