{"action":"closed","issue":{"url":"https://api.github.com/repos/SitecorePowerShell/Console/issues/316","labels_url":"https://api.github.com/repos/SitecorePowerShell/Console/issues/316/labels{/name}","comments_url":"https://api.github.com/repos/SitecorePowerShell/Console/issues/316/comments","events_url":"https://api.github.com/repos/SitecorePowerShell/Console/issues/316/events","html_url":"https://github.com/SitecorePowerShell/Console/issues/316","id":66157002,"number":316,"title":"Ability to set height on a field in dialog created by Read-Variable","user":{"login":"AdamNaj","id":1209953,"avatar_url":"https://avatars.githubusercontent.com/u/1209953?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamNaj","html_url":"https://github.com/AdamNaj","followers_url":"https://api.github.com/users/AdamNaj/followers","following_url":"https://api.github.com/users/AdamNaj/following{/other_user}","gists_url":"https://api.github.com/users/AdamNaj/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamNaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamNaj/subscriptions","organizations_url":"https://api.github.com/users/AdamNaj/orgs","repos_url":"https://api.github.com/users/AdamNaj/repos","events_url":"https://api.github.com/users/AdamNaj/events{/privacy}","received_events_url":"https://api.github.com/users/AdamNaj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SitecorePowerShell/Console/labels/area-commandlets","name":"area-commandlets","color":"0052cc"},{"url":"https://api.github.com/repos/SitecorePowerShell/Console/labels/area-user-interface","name":"area-user-interface","color":"0052cc"},{"url":"https://api.github.com/repos/SitecorePowerShell/Console/labels/improvement","name":"improvement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"AdamNaj","id":1209953,"avatar_url":"https://avatars.githubusercontent.com/u/1209953?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamNaj","html_url":"https://github.com/AdamNaj","followers_url":"https://api.github.com/users/AdamNaj/followers","following_url":"https://api.github.com/users/AdamNaj/following{/other_user}","gists_url":"https://api.github.com/users/AdamNaj/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamNaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamNaj/subscriptions","organizations_url":"https://api.github.com/users/AdamNaj/orgs","repos_url":"https://api.github.com/users/AdamNaj/repos","events_url":"https://api.github.com/users/AdamNaj/events{/privacy}","received_events_url":"https://api.github.com/users/AdamNaj/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/SitecorePowerShell/Console/milestones/16","html_url":"https://github.com/SitecorePowerShell/Console/milestones/3.1","labels_url":"https://api.github.com/repos/SitecorePowerShell/Console/milestones/16/labels","id":998715,"number":16,"title":"3.1","description":"","creator":{"login":"AdamNaj","id":1209953,"avatar_url":"https://avatars.githubusercontent.com/u/1209953?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamNaj","html_url":"https://github.com/AdamNaj","followers_url":"https://api.github.com/users/AdamNaj/followers","following_url":"https://api.github.com/users/AdamNaj/following{/other_user}","gists_url":"https://api.github.com/users/AdamNaj/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamNaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamNaj/subscriptions","organizations_url":"https://api.github.com/users/AdamNaj/orgs","repos_url":"https://api.github.com/users/AdamNaj/repos","events_url":"https://api.github.com/users/AdamNaj/events{/privacy}","received_events_url":"https://api.github.com/users/AdamNaj/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":19,"state":"open","created_at":"2015-02-27T12:30:33Z","updated_at":"2015-05-29T14:56:32Z","due_on":"2015-05-30T22:00:00Z","closed_at":null},"comments":1,"created_at":"2015-04-03T14:33:55Z","updated_at":"2015-05-29T14:56:32Z","closed_at":"2015-05-29T14:56:32Z","body":"Some more elaborate selectors like Multiline text or item selectors require that the control is higher than default in which case script should enable this behaviour.\r\n\r\nThe following script should render improved dialogs with those fields set to 400px height:\r\n\r\n```powershell\r\n$item = get-item master:\\content\\Home\r\n$items = get-Childitem 'master:\\templates\\Modules\\PowerShell Console\\PowerShell Script*'\r\n$items2 = get-Childitem 'master:\\templates\\Modules\\PowerShell Console\\PowerShell Script*'\r\n$checklistItems =  @(4,16)\r\n$radioListItems = 3\r\n\r\nif($PSVersionTable.PsVersion.Major -gt 2){\r\n    # this will only work on PowerShell in version over 2.0\r\n    $options = [ordered]@{Monday = 1; Tuesday = 2; \"Wednesday (Selected)\"= 4; Thursday = 8; \"Friday (Selected)\" = 16; Saturday = 32; Sunday = 64};\r\n    $selection = [ordered]@{One=1;Two=2;\"Three (selected)\"=3;Four=4};\r\n}\r\nelse{\r\n    #If your PowerShell version is lower than 3 you need to use the following syntax:\r\n    $options = New-Object System.Collections.Specialized.OrderedDictionary\r\n    $options.Add(\"Monday\", 1)\r\n    $options.Add(\"Wednesday\", 2)\r\n    $options.Add(\"Wednesday (Selected)\", 4)\r\n    $options.Add(\"Thursday\", 8)\r\n    $options.Add(\"Friday (Selected)\", 16)\r\n    $options.Add(\"Saturday\", 32)\r\n    $options.Add(\"Sunday\", 64)\r\n    $selection = New-Object System.Collections.Specialized.OrderedDictionary\r\n    $selection.Add(\"One\",1);\r\n    $selection.Add(\"Two\",2);\r\n    $selection.Add(\"Three (selected)\",3)\r\n    $selection.Add(\"Four\",4); \r\n}\r\n\r\n\r\n\r\n$result = Read-Variable -Parameters `\r\n    @{ Name = \"multiText\"; Value=\"Multiline Text\"; Title=\"Longer Text\"; lines=3; Tooltip=\"You can put multi line text here\"; Tab=\"Simple\"; height=\"400px\"}, \r\n    @{ Name = \"checklistItems\"; Title=\"Multiple options\"; Options=$options; Tooltip=\"Checklist with various options\"; Tab=\"Options 1\"; Editor=\"checklist\"; height=\"400px\"}, \r\n    @{ Name = \"radioListItems\"; Title=\"Radio selection\"; Options=$selection; Tab=\"Options 2\"; Editor=\"radio\" ; height=\"400px\"}, \r\n    @{ Name = \"items\"; Title=\"Bunch of Templates\"; \r\n        Source=\"DataSource=/sitecore/templates&DatabaseName=master&IncludeTemplatesForDisplay=Node,Folder,Template,Template Folder&IncludeTemplatesForSelection=Template\"; \r\n        editor=\"treelist\"; Tab=\"Items\"; height=\"400px\"}, \r\n    @{ Name = \"items2\"; Title=\"Bunch of Templates\"; \r\n        Source=\"DataSource=/sitecore/templates&DatabaseName=master&IncludeTemplatesForDisplay=Node,Folder,Template,Template Folder&IncludeTemplatesForSelection=Template\"; \r\n        editor=\"multilist\"; Tab=\"Items 2\"; height=\"400px\"} `\r\n    -Description \"This Dialog shows all available editors in some configurations, the properties are groupped into tabs\" `\r\n    -Title \"Initialise various variable types (with tabs)\" -Width 600 -Height 700 -OkButtonName \"Proceed\" -CancelButtonName \"Abort\" -ShowHints\r\n\r\n$result = Read-Variable -Parameters `\r\n    @{ Name = \"items\"; Title=\"Bunch of Templates\"; \r\n        Source=\"DataSource=/sitecore/templates&DatabaseName=master&IncludeTemplatesForDisplay=Node,Folder,Template,Template Folder&IncludeTemplatesForSelection=Template\"; \r\n        editor=\"treelist\"; height=\"400px\"} `\r\n    -Description \"This Dialog shows less editors, it doesn't need tabs as there is less of the edited variables\" `\r\n    -Title \"Initialise various variable types (without tabs)\" -Width 500 -Height 600 -OkButtonName \"Proceed\" -CancelButtonName \"Abort\" \r\n\r\n\"Variables from dialog:\"\r\n'$multiText: ' + $multiText\r\n'$checklistItems:' + $checklistItems\r\n'$radioListItems:' + $radioListItems\r\n'$items: '\r\n$items\r\n'$items2: '\r\n$items2\r\n```"}}