Skip to content

Instantly share code, notes, and snippets.

@hishaamn
Created March 5, 2017 16:34
Show Gist options
  • Save hishaamn/8914f7e4db44596c2ca5cdd0270e5402 to your computer and use it in GitHub Desktop.
Save hishaamn/8914f7e4db44596c2ca5cdd0270e5402 to your computer and use it in GitHub Desktop.
Sitecore Powershell Script
$templateItem = Get-Item -Path "master:\templates"
$props = @{
Parameters = @(
@{ Name = "userInput"; Title = "User Input"; Tab = "General" },
@{ Name = "templateItem"; Title = "Start Item"; Root = "/sitecore/Templates/"; Tab = "General" }
)
Title = "Powershell Demo"
OkButtonName = "Proceed"
CancelButtonName = "Abort"
Width = 600
Height = 700
}
$result = Read-Variable @props
if ($result -ne "ok") {
Exit
}
$manager = New-Object Namespace.Demo
$response = $manager.GetResponse($userInput, $templateItem)
Show-ModalDialog -Control "OutputResult" -Parameters @{btn_0="Ok"; te="The response is $response"; cp="Important Questions"} -Height 120 -Width 400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment