I need to have a dialog box with 2 dates at sitecore 8.2 admin page, and call sitecore powershell script with parameters that came from dialog box ? what is the best way to do it ? it seems like SPEAK should be used here. Does any one has some examples ?
1 Answer
You can use this snippet in your powershell script.
$dialog = Read-Variable -Parameters `
@{ Name = "Date1"; Title = "Date 1"; Editor="Date"}, `
@{ Name = "Date2"; Title = "Date 1"; Editor="Date"} `
-Description "Input Date." `
-Width 800 -Height 600 `
-Title "Date Input" `
-OkButtonName "Start" `
-CancelButtonName "Cancel"
if($dialog -ne "ok"){exit}
Write-Host $Date1;
This will create the dialog for inputting the different dates that you need.