Created
November 21, 2019 20:04
-
-
Save martin-guth/330141455d5e5e8f7a5163a86b72b02d to your computer and use it in GitHub Desktop.
An example for a call of the script exportReport.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[String] $dateFrom = $(Get-Date).AddMonths(-1).ToString("yyyyMM01 00:00:00") | |
[String] $dateTo = Get-Date -Format "yyyyMM01 00:00:00" | |
[String] $month = $dateFrom.Substring(0,6) | |
echo "$dateFrom $dateTo $month"; | |
& "X:\Scripts\exportReport.ps1" -databaseServer "mydbserver" -databaseName "mydb" -sqlFile "mySqlFile.sql" -fileName "FancyExport" -fileNameSupplement "_$month" -parameters "DECLARE @dateTimeFrom DATETIME = '$dateFrom', @dateTimeTo DATETIME = '$dateTo';" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment