Pass date variable to date parameter for scribe data migration job in powershell

87 Views Asked by At

I have the following powershell script that passes the $dateMinusThirty variable as parameter into scribe data migration job:

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

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

The date is how I need it, Scribe opens, but immediately crashes

Am I doing this correctly?

1

There are 1 best solutions below

0
J.S.Orris On BEST ANSWER

The correct syntax is the following:

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

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