在powershell中为scribe数据迁移作业传递日期变量到日期参数

问题描述 投票:0回答:1

我有以下powershell脚本将$dateMinusThirty变量作为参数传递到scribe数据迁移作业:

$dateMinusThirty = Get-Date (Get-Date).AddDays(-30).ToString('s') -Format d; 

.\TWorkbench.exe "D:\filePath.dts" /VCreatedBefore="DATEVALUE($dateMinusThirty)" /RS 

日期是我需要它的日期,Scribe打开,但立即崩溃

我这样做了吗?

powershell data-migration scribe-workbench
1个回答
1
投票

正确的语法如下:

$dateMinusThirty = Get-Date (Get-Date).AddDays(-30).ToString('s') -Format d; 

.\TWorkbench.exe "D:\filePath.dts" /VCreatedBefore="DATEVALUE(\""$dateMinusThirty\"")" /RS 
© www.soinside.com 2019 - 2024. All rights reserved.