Search code examples
powershelldata-migrationscribe-workbench

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


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?


Solution

  • 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