Powershell Studio: A Comprehensive Guide 9781542658010, 1542658012

"Fantastic...it is going to be worth gold to people! the code examples will be invaluable."- Don Jones, Presid

2,354 210 109MB

English Pages [551] Year 2017

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

Powershell Studio: A Comprehensive Guide
 9781542658010, 1542658012

Citation preview

Power_ A Comprehensive Guide

Jeff Holder

ISBN'-13:978-1542658010 ISBN'-10: 1542658012

© Copyright 2016 - All rights reserved.

In no vvay is it legal to reproduce, duplicate, or transmit any part of this docume11t in either electronic means or in

printed format. Recording of this publication is strictly prohibited and any storage of this doctunent is not allowed tutless with '.vritten permission fro1n the author. All rights reserved. The information provided herein is stated to be truthful ru1d consistent, iI1 that any liability, in tem1s of inattention or otherwise, by any usage or abuse of any policies, processes, or directions contained within is the solitary and utter responsibility of the recipient reader. Under no circu111stances will any legal responsibility or bla1ne be held against the publisher or author for any reparation, da1nages, or monetaiy loss due to the information herein, either directly or indirectly. The publisher and author disclaim any personal liability, directly or indirectly, for advice or information presented within. Altl1ough the author and publisher have prepared this manuscript with utmost care and diligence and have 1nade every effort to ensure the accuracy and co1npleteness of the information contained within, vve assu1ne no responsibility for errors, inaccuracies, omissions, or inconsistencies. The information herein is offered for informational purposes solely, and is universal as so. The presentation of the information is 'vithout contract or any type of guarantee assurance. The trademarks that are used are vvithout any consent, and the publication of the trademark is ,;vithout permission or backing by the tradernark ovvner. All traden1arks ru1d brru1ds vvitlrin tlris book are for clarifying purposes oruy and are owned by the ovvners then1selves, 11ot affiliated vvith this document. No warrai1ty 111ay be created or extended by sales or promotional inaterials. The advice ru1d strategies contained herein may not be st1itable for every situation. This work is sold \.Vith the understanding that tl1e publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for dainages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further info1mation does not 111ean that the author or tl1e publisher endorses the info1mation tl1e organ.izatio11 or Web site 1nay provide or recommendations it may make. Further, readers should be aware that Inten1et Web sites listed in this work may have changed or disappeared between \V hen this \;vork \.Vas \.Vritten and when it is read.

orewor Ma11y Pov,;erSl1ell scripters will tell yot1 that the idea of creating GUI applications for PowerShell scripts is abStud and breaks the very essence of scripting. Ho,vever, you must keep in mind that eve11 thou.g h yotrr scripts may see1n logical and easy to use to you, tl1ey n1ay not be quite so understandable or so easy to use for many that are not fanliliar with the Po\\1erShell language, or in positions outside of system adn1inistration. The purpose of sc1ipting is to provide a n1ore efficient, robust, auto111ated, custornizable solution to tl1e inany repeatable processes that are involved in Infonnation Technology every day. The purpose of creating PowerSl1ell GUI applications is to take the same PowerShell scripts that you or others have created and present thern in a very easy to use and understandable GUI application that cai1 be quickly deployed and used by others 'vith i10 scripti11g experience at all. That saves trai11ing costs, reduces hu1nan errors, increases productivity, and helps overall lo"ver overhead. PowerShell scripting has beco1ne a required skillset for any Windows System Administrator. We can do tilings more efficiently, n1ore reliably with repeatable results, and gained tremendously more power over local and remote systems tllan ever in the past. However, tills has also shifted a lot of responsibilities to Syste1ns Adnunistrators that in tl1e past were handled by Helpdesk persom1el, because many did not u11derstand the use of Po,verShell sc1ipts, paraineter require1nents, etc. This i1nbalance of workload caused Syste1n Administrators with scripting eA']Jerience to find a \;vay to utilize tJ1e inuch-needed PowerShell scripts but also at the same time to e1npower less teclulicaJ perso1n1el with the ability to use the numerous scripts t11at developers vvere churning out. This has caused a sllift towards PowerShell GUI applications. I have been extensively using PowerShell Studio for several years, and have developed inany enterprise level applications, and hundreds of sniaJler applications for both corporate and govennnent agencies. When I first staited, there \Vas very little training docu1nentation outside of SAPIEN Teclu1ologies, and even tl1ough tl1ey did a great job documenting 1nany of the countless feat11res in PowerShell Studio it vvas cumberso1ne fi11ding the infonnation and there ,;vas still some undocumented areas. It wasn' t until I was deep into "vriting this book that I stepped back and realized just ho\¥ inuch of a challenge this was going to be. I was far too deep into it to ttrrn around so the only tiling to do was to push forward because it is 'vhat I would have \vanted an author to do for i11e. I wrote this to be the kind of book tl1at I "votlld have "vanted to read \Vl1en learning to use Po\>verShell Studio. I hope you enjoy!

Acknowledgements First and fore1nost, this book is dedicated to my wile, Kathleen, and my children: Haley, Matthe"v. Aaron, Cassandra and Ca11dice. This book \vould never have been possible \vithout my wue·s extraordiJ1ary patience, support and encourage1nent to follow my heart. She kept me fed. clothed, managed our home, cared for our children, and worked a fulltime job as an Occupational Therapist helping others overco1ne life's challenges. Kathleen is an a1nazing giving person, dedicated n1other to 011r children, and a loving and caring wife. I couldn't think of another person that I would rather spe11d the rest of my life with than n1y best friend. My children a1·e iny life. they are the reason I get up every day. They represent the future and I kno\v the future \Yill be great 'vith them in it. A parent cannot express i11 words what they feel for their children because it 111ns so much deeper t11an \vords could ever express. We all vva11t to leave behind a legacy. and rny children arc 1ny greatest legacy. I could not be 1nore proud of each one of then1. I thank 111y children for their sacrifice in tin1c a\vay fro1n gan1es and playing to give Daddy the tin1e he needed to complete tllis book. I would like to thank n1y father and 111y 1not11er. God rest her soul, for teaching ine the fo11itude and resilience, and for raising nle -vvith the values of hard \VOrk and the i1nportance of a strong fan1ily. They are both an inspiration to n1e every day. I \vould also like to thank my sister Sru1di. she 11as al\vays inspired me to be strong, keep persevering in the hardest tin1es. to love life and be tn1e to yourself. I would like to thank t11e SAPIEN tea.in, Ferdinand Rios (CEO). David Corrales (Lead Engineer), and Alexander Riedel (CTO). All of \Vho1n \Vere insllumental in revie,ving the 1naterial in Ulis book. I 'vould especial1y like to thaJtk, David Co1TaJes, \Vho always took the ti1ne to a1lS\ver n1y inany questions, and never failed to offer n1e as 1nuch guidance as I needed on tllis quest. Special thanks as \Veil to Alexa11der Riedel, for taking the time when I first started approaching this book to speak ' vith me on many occasions. A special thanks to Don Jones. a legend in the Po,verShell conununity ru1d a superb aut11or in his O\Vll right. Don revie"ved this book and provided his great teclurical insights, he \vas al,vays \villing to put on his author hat and give ine constructive advice \Vhich \Vas instn1mental in helping get this book out the door! Don Jones is one of the \Vorld's leading expe11 on the Microsoft business technology platforn1. He's the author of more thai1 45 books ai1d the President/CEO of Po,verShell.org. Thanks lo J11ne Blender. who didn' t even kno'v n1e when I first contacted her to ask for her expert opi1rion and advise for tJlis book. She \vitJ1out hesitation gladly offered to review tl1e book for 1ne. For ai1yone that does not know Jm1e Blender, she is a Microsoft MVP, a for1ner Senior Programming Writer at Microsoft Corporation \Vhere she worked on tl1e Po,verShell Tea1n developing the help system and 'vriting the Get-help help topics for Po\verShell 1.0 to 3.0. Her other "vorks incl1tde writing content for t11e Azure Active Directory SDK, Azure Po~·erShell Help. Windo'~'S Driver Kits, Windo\vs Suppo1t Tools, ru1d Windo"vs Resol1rce Kits. Jtme currently 'vorks at SAPIEN as a technology evangelist ru1d trail1er.

About the Author Jeff Holder bas over three decades of eA'J)erience as a Senior Level Systems Ad1ninistrator specializing in Virtualization and Remote System Mai1age111ent. Prior to that, Jeff proudly served in the U.S. Naval service aboard the U.S.S. Le,;vis and Clark ai1d U.S .S. Pe11nsylvania Submarines, as a Navigation Electronics Technician. Over the last 30 years, Jeff has achieved a broad range of experience. and filled ma11y roles as an Active Directory Architect, V111ware Virtualization Specialist, Cisco Unified Communications System SME. PowerShell Script Developer, and author of five technical and outdoor books. In his free ti1ne, he enjoys spending time \.Vith his family and the outdoors. As an avid angler. he can regularly be found in and around the lakes of Southern California, or hiking in the surrounding inountains. Jeff and Kathleen have been married for 13 wonde1ful years, and have nvo children together, Haley and Matthew.

Contents GETTING STARTED WITH POWERS HELL STU 010 .•..........•...•...•..............• 15 1.1 WHATS NEW IN POWERSHELL STUDIO 2017 ..................................... ............ ... ....................~ · · ·· ·· · · 16 1. 1. 1 Updated Control Helper Functions................................................................................... 16 1. 1.2 Updated Editor Font and Coloring Settings Dialog ..................................... ................. .. 16 1. 1.3 New Office 2016 Themes ...................... ............................................................................. 17 1. 1.4 Prima/Sense Performance Improvement ......................................................................... 18 1.2 REQUIREMENTS............................................................................................................................... 19 1.3 INSTA LL_ATION ......................................................................... ......................................................... 19 1.4 FIREWALL CONSIDERATIONS ........................................................................................................ 20 1.5 ACTIVATE YOUR LICENSE ..................................................................... ......................................... 21 1.6 DEACTIVATELICENSE .................................................................................................................... 21 1. 7 OPTIONS AND CUSTOMIZATION .................................................................................................. 24 1.7. 1 General Settings.............................................................. ........ ........ ..... .................... .... ....... 24 1.7.2 Backup Settings ..... ............................................................................... .. .. ........................ ... 26 1.7.3 Console Settings.... ......................... ........ ................................. ............. ............................... 27 1.7.4 Debugger Settings .............................................................................................................. 28 1.7.5 Designer Settings................................................................................................. ............. ... 29 1.7.6 Ed it or Settings .......................................................................... ............................................ 32 1.7.7 Assemblies Settings ............... ............................................................... ................. .............. 40 1.7.8 Formatting Settings ................................ .... ......................................................................... 40 1.7.9 Panel Settings ...................................................................................................................... 48 1.7. 10 PowerShell Settings ........................................................................................................... 49 1.7. 1 l Source Control Settings ....... .... ......................................................................................... 50

BASIC ORIENTATION ........•..•.....•............•.....•............•............•...•..•......55 2.1 DOCUMENT EXPLORER ................................................................................................................. 55 2.2 RIBBON BAR AND TABS .................................................................................................................. 57 2.2.1 Home Tab ........ ....................................... ........ ..................... .... .... ........ ................. ............... 57 2.2.2 Designer Tab ........................................................................................................................ 68 2.2.3 DEPLOY TAB ......................................................................................................................... 79 2.2.4 Tools Tab ................ ................................. ................ ......... ........ ........ ..................... ............... 92 2.2.5 Source Control Tab .......................................................................... ................................... 99 2.2.6 Help Tab ................. ................................................................. .............. ............................. 103 2.2.7 View Tab ................ .................... ............. .... .... ............................ .......... ... .......................... 104 2.3 PANES ............................................................................................................................................ 107 2.3. l Call Stack Pane .................. ............................................................................................... 107 2.3.2 Console Pane .................................................................................................................... 107 2.3.3 Debug Pane ........................................................................................................................ 107 2.3.4 Debug Console Pane .................................... ........ ......................................... .................. 108 2.3.5 Find Results Pane .................................... .... ..................... ......... .... ...................................... 110

2.3.6 Function Explorer Pane ....................... ........ ..... ......... ,. .. .............................. ....................... 111 2.3.7 Help Pane ........................................................................................................................... 112 2.3.8 Object Browser Pane .................................. ...................................................................... 114 2.3.9 Output Pane .................................................................................. ............ .... ............. ....... 115 2.3. 10 Performance Pane .... ................. ..................................................................................... 116 2.3. 11 Project Pane ....................................... ................................. ..................... ....................... 117 2.3.12 Property Pane .................................................................................................................. 119 2.3.13 Snippets Pane ................................................................................................................. 12 1 2.3. 14 Toolbox Pane ......... . ...................................................................... ........ ..... ....................... 12 5

FORM DESIGN AND PROJECTS .......................................................... 137 INTRODUCTION TO FORMS ................................................................................ .......................... 137 FORM TEMPL.A TES ........................ ............ ..................................................................................... 138 Form Border Styles ....................................... .............................................. ........................ 139 Empty Form ................................................... ........ ............ ............ .. ....... ............................ 141 Dialog Style Form ............................................................................................................... 142 Explorer Style Form ............................................................................................................ 143 Full Grid Search Template ........................... ............................................ ......................... 144 Grid Job Template ................................................... ........................................................ . 145 Grid Search Template ............................................. .......................................................... 146 Grid Template .................................................................................................................... 147 Menu Template ................................................................................................................. 148 Tab Control Template ..................................................................................................... 149 Text Box Template .... ......................... ............ ..... .................... .... ......... ............................ 150 Text Box with Search Template ...................................................................................... 151 Wizard Template ........................................ .... ............................. ............. ....................... 152 Accessibility ........................................................................................................................ 153 Appearance .................................................................................. ..................................... . 153 Behavior ............................................................................................................................ . 155 Data ..................................................................................................................................... 155 Design .................................................... .................... .......................................................... 156 Focus ................................................................................................................................... 156 Layout ............... ............ .... .................................................................................................. 156 Misc ................................................................ ............ ........ ................. ......... ....................... 159

FOR.M PROJECTS .................................................................... ....................................................... 165 Multi-Form Projects ............................................................................................................ 166 Scope Variables ................................................................................................................ 170 Collection Project .............................................................................................................. 171 Module Projects ........................ .................... ..................................................................... 172

FORM CONTROLS .............................................................................. 179 4. 1 BUTION CONTROL ..... ........ .. .......... ................... ............ ........... ..................... ............ .......... ......... 179 4. I. I Button Events ............................................................................................................ ......... 180 4. 1.2 Button Manipulation ......................................................................................................... 182 4.2 C HART CONTROL ........................................................................................................................ 185 4.2. 1 Chari .E xample .................................................................................................................. 185 4.3 C HECKBOX CONTROL ............. .. .................. ................... .......................................................... .. 191 4.3.. 1 CheckBox Example ..... ........ .... ....... ........ .. ................................ .......................... ........... ... 192 4.4 CHECKEDLISTBOX CONTROL ..................................................................................................... 194 4.4. I CheckedListBox Example ... ......... ............ .... .................................................. .................. 194 4.5 COLORDIA LOG CONTROL......................................................................................................... 200 4.5. I ColorDialog Example ....................................................................................................... 200 4.6 COMBOBOX CONTROL.............. .. .................................. ..................... ................... ................ .... 20 1 4.6. I ComboBox Example ............................ ............................................................................ 20 I 4.7 CONTEXTMENUSTRIP CONTROL ...... ....................................................... .................................... 203 4.7.1 ShowCheckM argin and Showlm a geMargin .............. ..... .. ............... ................ ............. 204 4.7.2 ContextMenuStrip Example ............................................................................................. 205 4.7.3 Important Events ................................................................................................. .............. 206 4.7.4 Important Methods .. .. .. ..... .... .. .. ... ... .......... .. .. ... ............. .. .... ... .. .. ... ...... .... .... ... .. .... ........... .. 208 4.8 DATA GRID AND DA TAGRIDVIEW CONTROLS ....................... ..................... .......................... .... 209 4.8. 1 Dynamic Populated Example ............................................ ............................................. 210 4.8.2 Manually Populated Example ......................................................................................... 214 4.8.3 Important Methods............ .... .... ............................................ .......................................... . 215 4.9 DATETIMEPICKER CONTROL .................................... ............ ....................................................... 215 4.9. 1 DateTimePicker Example .......................................... ........................................... .......... .. 216 4. 9.2 Add Date Time Picker to DataGridView .......................................................................... 2 17 5.0 DOMA INUPDOWN CONTROL ... ... ............. .. ................... ........ ............ ................. .... ................. .. 217 5. 1 ERRORPROVIDER CONTROL ...................................................................................................... 218 5. I. I ErrorProvider Properlies .................................................................................................... 218 5. 1.2 Important Methods........................ ................................................................................... 219 5.1.3 Example Use .. ..................... ............................................................................................... 222 5.2 FILESYSTEM WATC HER CONTROL................................................ .... .............. .............................. 224 5.3 FLOWLA YOUTPANEL CONTROL...... .... ........ ................................................. .............................. 227 5.4 FOLDERBROWSERMODERNDIA LOG ......................................................................................... 228 5.5 FONTDIALOG CONTROL............................................................. ................................................ 229 5.5.1 Font Dialog Exa mple ......................................................................................................... 229 5.6 GROUPBOX CONTROL ......................... ........ ................... ............................................... ............. 230 5. 7 HE LPPROVIDER CONTROL ........................ ............ ................... ............ ................ .................... 231 5.8 IMAGELIST CONTROL ...................................................... ............................................................ 232 5.8. 1 Comparing Image Bit-Depth .......................................................................................... 233 5. 9 LA BEL CONTROL ................ ............ .................... ........... .............. .... ................ .. .......... ... .............. 234 6.0 LI NKLABEL CONTRO L................................................................................................................... 235 6. 1 LIST BOX CONTROL .................... ....................................... ............................................................ 236

6. 1.2 ListBox Control Example .. .. ...... ... .... .... .... ... ... .... .. .... .... .. .. ..... ....... .. ...... ... .... .... .. .. ..... .... .... ... 237 6.2 LISTVIEW CONTROL ......................................................................................................................238 6 ..2. 1 Important Properties ... ... ... .... .... .... .... ..... .... .. ... .. .. ... ...................... ... .... ............. ...... ... ... ..... 238 6.2.2 Important Methods ..... ................................. .................... ............ ........ ............................. 248 6.2.3 Important Events .......................... ................ ..................................................................... 249 6.3 MASKEDTEXTBOX CONTROL ...... ........................................... ............ ............................... ........... 252 6.3.1 Important Properties ......................................................................................................... 252 6.3.3 Important Methods ...................... ..................................................................................... 255 6.3.3 lmpor·fant Events ..... ............ .... .... .. .. ... .... .... .. ....... ... .. ... ... .. ....... .... .. ....... ... .. ....... .. .... .... .. ..... 256 6.4 MENUSTRIP CONTROL ..................... ....................................... ...................................................... 257 6.4.1 Add Icon to Menu Item .................................................................................................... 259 6.4.2 Adding Standard Menu Items .................... ........ .... ..................... ........ .... ......... .... ........... 260 6.5 MONTHCALENDAR CONTROL .................................................................................................... 260 6.6 NOTIFYICON CONTROL .................... ................... .................. ...................................... .. .............. 262 6.6. 1 Important Properties ... ................. .. ............ .. .......... ........ ......... ... .. ............................. .... .... 262 6.6.2 Important Events .......................................... ................. .................................................... 263 6.6.3 Important Methods ........................................................................................................... 264 6.7 NUMERICUPDOWN CONTROL .................................................................................................... 266 6.7.1 Important Properties ......................................................................................................... 266 6.7.2 lmpor·t ant Event ...................... ....... .. ........... .. ..... .. ........... ....... ..... ........ ... ... .............. ........... 267 6.8 OPENFILEDIALOG CONTROL ...................................................................................................... 267 6.8. 1 OpenFileDialog Example......... .... ..................................................................................... 267 6.9 PANEL CONTROL .......... ........................................ ...................................... .................... .............. 269 7.0 PICTUREBOX CONTROL ...............................................................................................................270 7.1 PROGRESSBAR AND PROGRESSBAROVERLA Y ......................................................................... 271 7. 1. 1 Important Properties ... ... .. .. ...... ..... ... ...... .... .. .. .... .... .... ........ .. ...... .. ... ..... ... ... ..... .. ..... ...... ..... 271 7. 1.2 Important Methods ........................................................................................................... 272 7.2 PROPERTYGRID CONTROL ... ............. .. ............... .. ............... .. ........ ........ ....... ..... ............. .. .... ....... 273 7.3 RADIOBUTION CONTROL ............... ....................................... ...................................................... 275 7.3.1 Important Properties ... .... ........ .... ...................................................................................... 27 5 7.3.2 Important Events ........................................................................... .................................... 27 5 7.4 RICHTEXTBOX CONTROL.................................................... .......................................................... 276 7.5 SA VEFILEDIALOG CONTRO L ................................................. ...................................................... 277 7.6 SPLITCONTAINER CONTROL .................................................. ...................................................... 278 7. 7 SPLITIER CONTROL ....................................................................................................................... 280 7.8 STATUSBARCONTROL .................................................................................................................. 281 7. 9 STATUSSTR IP CONTROL .......................................................... ...................................................... 282 7.9.1 Important Properties ......................................................................................................... 283 7.9. 2 lmpor·tant Events ............................................................................................................... 284 8.0 TABCONTROL CONTROL ............................. .......................... ...................................................... 284 8.0. 1 Important Events ...................... .................................................................................. ....... 285 8.1 TABLELA YOUTPANEL CONTROL ..... ....................................... ...................................................... 286 8.2 TEXTBOX CONTROL ......................................................................................................................288 8.3 TIMER CONTROL ...........................................................................................................................289

8.3. 1 Important Events .................................... ................ ......... .... ........ .... ...................... ............ 289 8.3.2 Timer Example 1 ................................................................................................................ 291 8.3.3 Timer Example 2 ......... .. ... ........ .. .. .. ......... ... ... .... .................... .. ... .. .. ............. ...... .... ... .... .... .. 291 8.4 TOOLBAR CONTROL ........................................................ ........................ ...................................". 292 8.5 TOOLSTRIP CONTROL .................................................................................... .............................. 293 8.6 TOOLTIP CONTROL ............... ............................... ........................ ................................................ 294 8. 7 TRACKBAR CONTROL ................................................................................................................. . 29 5 8.8 TREEVIEW CONTROL .................................................................................................................... 30 l 8.9 VSCROLLBA R CONTROL ................................................. ............ ................................................ 302 9 .0 WEBBROWSER CONTROL......... ................................................................................................... 303 9.0. 1 Example ............................................................................................................................. 303

EXAMPLE PROJECTS .......................................................................... 307 IP RANGE SCANNER ........... ................................................................. ............................................... . 307 DISPLAY AND KILL RUNN ING PROCESSES REMOTELY 315 FILESHARE ANALYZER .............................................................. ............ ................................................ 317

REFERENCE GUIDE ............................................................................. 327 EXPORTING CACHE FROM REMOTE MACHINE ........................................................................... .... 327 IMPORTING REMOTE CACHE FILE ...................................................................................................... 329 REMOTE SCRIPT EXECUTION ENGINE (RSEE) .............................................. ....................................... 331 SINGLE THREADED APARTMENT (STA) ............................................................................................... 336 PSSCRIPTANALYZER ............................................................................................................................. 337 SCRIPTPA TH IN HOST ............................................................... ............................................................ 337 CONVERTING HEX# COLOR NUMBERS ......................................... ................................................... 338 REQU IRE ADM INISTRATOR .................................................................................................................. 338 CONTROL PROPERTIES ............................................................ ............................................................ 339 BUTTON ........................................... .... ........................................................................................... 339 CHART ........................................................................................................................................... 343 CHECKBOX ................................................................................................................................... 347 CHECKEDLISTBOX ......................................................................................................................... 352 COLORDIALOG ................................................. .................................... ....................................... 356 COMBOBOX ................................................................................................................................. 357 CONTEXTMENUSTRIP .................................................................................................................... 363 DATAGRID AND DATAGRID VIEW................................................................................................ 368 DATETIMEPICKER .... ....................................................................................................................... 374 DOMAINUPDOWN ....................................................................................................................... 378 ERRORPROVIDER ....................................... ........................ ........................................................... 383 FILESYSTEMWATCHER ....... ................................. ........................................................................... 384 FLOWLA YOUTPANEL .......................................... ........ ........ .... .......................... ............................. 384 FOLDERBROWSERMODERNDIALOG ................................................ ........................................... 389 FONTDIALOG ..... ................................ ........................................................................................... 389 GROUPBOX ........................................................ ................................. .... ...................................... 390

HELPPROVIDER 395 /MAGEL/ST ....... .............................................................. ................................................................. 395 LABEL ....... ........................................................... ...................................................... ........................ 396 LINKL.ABEL ...................................................................................................................................... 401 LISTBOX......................... . ........... 405 LISTVIEW ............................................................................................. ............................................ 4 11 MASKEDTEXTBOX........................................................................................................................... 417 MENUSTRIP .................. ................................................................................................................... 42 2 M 0 NTHCA LENDAR ...... .................... ........... .. ............... ................ ................... .. ............ ................ 42 7 NOTIFY/CON .................................................................................................................................. 432 NUMERICUPDOWN .......................................................................................................................432 OPENFILEDIALOG ................................... .......................... ............................................................. 437 PANEL ............................................................................................................................................. 438 PICTUREBOX ............................................................................................. ..................................... 443 PROGRESSBAR AND PROGRESSBAROVERLA Y...................................... ............. . ................... .... 44 8 PROPERTYGRID .... ..... . ........................ . .... .......... ............ ....... .... ...... ........................ ......... .... ............ 452 RADIOBUTTON ............................................................................................................................... 457 RICHTEXTBOX .......................................................................................................... ........... ............. 462 SA VEDDIALOG ............................ .................................................................................................. 469 SPLITCONTAINER ................................................................................................... ........................ 470 SPLITTER .......... ............................................................................................ .... ........ ........................ 476 STATUSBAR ............................................ ........ .................................................................................... 48 1 STATUSSTRIP .. ....... ........................................................................................................................... 488 TABCONTROL .............. . ....... 494 TABLELA YOUTPANEL .................................................................................................................... . 498 TEXTBO X ........................................................................................................................................ .503 TIMER ............................................................................................................................................. . 510 TOOLBAR ......................................... . 511 TOOLSTRIP ....... ....................................................................................................... . ....................... 519 TOOLTIP ................................................. ............ ............................. .... .................... ..........."........... .524 TRACKBAR 525 TREEVIEW ...................................................................... ......................................... .... .................... 530 VSC ROLLBAR .. ...................................... ................................................................. . 536 WEBB ROWSER ................................................................................................................................540

IND EX .••....................•.......................•..•....•...•.................••..•.•.............. 54 7

Chapter 1

POWERSHELL SrUJDIO

Bu'lt for Coders by Co ersl

PowerShell Studio - Introducing PowerShell Studio

I 15

GETTING STARTED WITH POWERSHELL STUDIO Po,verShell Studio is a product of SAPIEN Technologies, Inc.. and is one of tlle most premier Integrated De elopment Environments (IDE) designed for Windo,vs Po"verShell scripting. It combines the po,ver of a fullyfeatured Windo,vs Po,verSlleU editor \.vilh a robust fean1re-rich GUI Designer, and U1e u1ost po,verful Sc1ipl Debugger available today. Fe\v \Vit:hin the Po,verShell co1mnunity have not heard the naines Don Jones. Jeff Hicks, Jason Helrnick, all of,vhich \>Vere fom1er SAPIEN ernployees. David Corrales is currenUy the Lead Developer for SAPIEN a11d June Blender is currently a SAPIEN technical trainer ai1d "''rote the original Po,verSbell help files \Vb.en she \vorked on the Windo,vs PowerShell team. All legends with the PowerShell Comnu1nity, and they have all \Yorked to make Po"·erShell Studio what it is today. an amazing Integrated Development Environment. b1Ult by scripters fo r scripters! That \.Vas almost l 1 years ago, and since that tin1e Po,verShell has contir1ued to evolve and gro\v into \.\·bat today is one of t11e most po,verful scripting languages used by System Adnunistrators. On August 20 16, Microsoft announced that Po,verShell had gone open-source ai1d cross-platfonn \¥ith support for Windo\VS. OS X, CentOS. and Ublffitu. It wasn't long after the source code for PowerShell 'vas published on GitHub, that PowerShell Core was born \¥hich nms 011 .NET Core and " 'ill start shlppit1g \Vith 1Windows Seiver 2016 Nru10 Server. Windo\vs Po,verShell has quickly over the years become the de-facto scripting language for Windo\VS system inanagement among ad1ninistrators \vorld-\vide. Today, Po,verShell has become a must-kno,_.,. skillset. and is one of the first skills that an employer looks for"\\·hen filling any IT System Ad1ninistration position. System Ad1ninistrators have been creating Po,verShell scripts for years and they proved to be very efficient, Yery reliable, and provided consistent results. The only do";nside " ·as that many of the scripts were complex,, and \Vithout scripting kno,vledge it \Vas difficult for other employees to use them. including IT Helpdesks. Thankfully \Vith PowerShell St11dio, very po,:verful complex Po,verShell scripts can no\v be integrated \Vithin a userfriendly GUI application that requires Little if any scripting kno,vJedge to use. You can do,vnload a fully functional. 45-day free tiial by visiting SAPIEN Po,verShell Studio hon1e page. Current licensed cost is $389 wiU1 co1rununity suppo11, an addjtional $99 gets you Premium Support (Direct tech11ical support frorn SAPIEN 'viU1 a guaranteed response tin1e of 24 hours).

0-..

Whenever you see this icon in the book it means that SAPIEN has created a Spotlight article on their \vebsite for the topic. look in the footnotes for reference to the page.

Upon activation of Po"1erSheJl Studio, you 'vill also receive access to lhe free con1pJin1ental)1 Productivity Pack \vllich includes: • • • •

1

PowerRegEx: Po,..verRegEx allo,vs you lo export your expression for Po,~·erShell use. Po,verSbell HeJp: Get help for Po,verShell U1e \Vay it \Vas meant to be. Po\l erShcU Profile Editor: is a dedicated tool for J.lllU1aging and editing PowerShell profiles. PrimaJPad: single file, color coding editor for VB Script, Jscript, HTML. C++. C#, SQL and Po,verShell . 1

https://en.wikipedia.org/wiki/Windows_Server_2016# Nano_Server

16

I PowerShell Studio -

1.1

A Comprehensive Guide

WHATS NEW IN POWERSHELL STUDIO 2017

In the process of vvriting this book, SAPIEN released PowerShell Studio 2017, so I feel it is in1portant to point out the nevv changes to you. SAPIEN doesn't wait to release major updates only once a year, instead they release the1n as they are ready \Vhich gives you the ability to receive improvements and new feah1res withot1t having to wait long pe1iods or purchase the latest major version release.

1.1. 1 Updated Control Helper Functions One of the most i1nportant changes that needs to be pointed out is that in the 20 17 version SAPIEN has changed the verb of the control helper functions.

2017 ver. 5.4.134 - Control Helper Functions now start with " Update" i.e. Update-DataGridView 2016 version and earlier - Control Helper Functions started with "Load", i.e. Load-DataGridView The reason for this change was to co1nply with PSScriptAnalyzer's best practice, which has always stated that Load is an unapproved verb.

1.1.2 Updated Editor Font and Coloring Settings Dialog Editor Font and Color Settings

X

fuavea Settings)

Presets:

I•

Font (bold type indicates fixed-w1chh fonts):

Size:

IConsolas

,•

Edtor badqound:

CJ Wh~ Modfied ine saved color:

._g 108, 226, 108 Mo6dcgound:

_E]

CJ 240, 240, 2.;o Oxrent li'le indicator color: CJ S4ver

=tJ

Cobm gulcle color:

- Daridllue

I· I

Pooeishel I• r----------------1 items, Powershel

L~: ~y

'""'"" Plan ~ ~= ~ ~==~r--rnz;-v.-v---~~ I_...,.-,I

A5as

Code SnJlpet Field Corrrnand

Command Argunent Command As Paraml!ter

Corrment Oredrve External Tool Ft.nctJon l~tedReference

-~ -oop-Label

_ _ _ _ _.,,

Item badqound:

!CJ

----1·I

[,a Bold

C:::. I taK

.] lk1derfne

San"C)le:

L

J

~-------

AaBbCcXxVyZz

0(

I ~

figure 1 - Font and Color Settings

J

A language selection \Vas added to the Editor Font and Coloring Settings dialog. The dialog novv distinguishes the syntax coloring for a plain text file fro1n a PowerShell file.

PowerShell Studio - Introducing PowerShell Studio

1.1.3 New Office 2016 Themes •

..



- -·- - -... • -- • • • • • • • JI

•-

.. . _ .. ·-··- o -



..... ....

____________ ...................

·-- ·---...

'ii

I> · ~­

n

.._

-------- . •. . ._....... .... ...... ... ...-.. ................. ... ... J

--

:)

t

0--

~._.,_.. ,...._ __ ..,_Ile....... .....

~

,.

·~-

---

,



.. ... :.:::

·Cl-

o, "' "-

..... •

.,_

.. ..

-. -..... ··-··......... --_ ........

a •..,.

......... WI

b

:ez a



-"""'



--C ......

··-

.......... .................. ..._.._. . .... -~

............

-

· ·~,_

._. ,. ,J_.__, .,,,._... '·

.,,...

.,.~

-

..

''·==

..,,,,...,

,,,_...._

..... -____

..,.,,......... .....,: ......... ,,,, .,

.,.~

• ,_...a.. ,,,._

.

.,......

·~

';.~~=~.~l"!;;':::::'.5 " - -

....... ,...........

·~

-

... ...... - .-.

Figure 2 - Office 2016 Colorful

•• • •. .. ' . ..

-

-

-

-· -·

-

I> ..

..--~-"1111

-

----·-·

-



_ _ _ __ _.._. ................................... .__

--

r- •

,,_

--~..,_.~~

.......

,

..,,.,....... -... ..,,._.,_ ,...................... .. .,.... "'·::::: ~

.,.~

,.,,

.r......

T

Figure 3 - Office 2016 Dark



17

18

I PowerShell Studio -

A Comprehensive Guide

1.1.4 PrimalSense Performance Improvement Pri1na1Sense response time vvith this release has been improved. You may notice the improvement \Vhen triggering PrilnalSense for .NET Types or when using general code completion.

fAbandonedMutexExc,pt1on ~ AccessedlhroughProp,rtyAttribut' 4$ Accessibl'°bjttt AccessRul' AccessRu1,·1 AccessViolationE.xc,ption .. Ac,Enumerator C...... Action C Action ·1 ::; Action ·10

Figure 4 - Code Completion

PowerShell Studio - Introducing PowerShell Studio

I

19

1.2 REQUIREMENTS As with every software there are minilnum reco1nmended requirements for installing PowerShell Studio: • • • • • •

Windovvs Server 2008 R2 I Windows Server 2012 I Windows Server 2012 R2 or Windows 7 I Windows 8 I Windows 8.1 I Windovvs 10, 32-bit ai1d 64-bit versions are supported. 200MB free disk space 2GBRAM Processor capable of running Windows 7 .NET Fra1nework 4.5 Visual Studio 2012 Runtime

These are the niinimum requirement recommendations, ho111ever siniply having the mininium does not niean PowerShell Studio, or any soff:l11are for that niatter, will operate at its peak performance. I recommend a niinimum ofat least J6GB ofRAM to prevent issues ltllith application freezing and out ofn2en2ory errors.

1.3 INSTALLATION There are three types of installation: •

TYJ>ical

Reco1mnended for most users, it vvill install PowerShell Studio 2016, the component library, ScriptMerge 2016, the MS Chart Controls, the SAPIEN Docu1nent Explorer, and both the 32- and 64-bit versions of Visual C++. •

Custom

Tllis option alJows you to select whlch features to install. This option is recommended only for advanced users since portions of Po,verShell Studio n1ay not be available if you do not select the appropriate components at thls point. •

Complete

Tllis option \Vill install all components, na1nely, PowerShell Studio 2016, the co1nponent library, ScriptMerge 2016, the MS Chart Controls, the SAPIEN Document Explorer, and both the 32- and 64-bit versions of Visual C++. There have been instances 111here Jv!cAfee Anti-Virus produces a false positive for Trojan detection specifzcallywith the.files (Win32.exe). These files can safely be excluded, and SAPIEN typically reports these false positives to McAfee for updating their scanning engine and DAT files.

20

I PowerShell Studio -

A Comprehensive Guide

1.4 FIREWALL CONSIDERATIONS PowerShell Studio can install a small service to support the Re1note Script Execution Engine. This can result in a fire"vall ,;vanling as the service atte1npts to open the port it listens on. The ports are configurable in the options under debugger. PowerShell Studio occasionally atte1npts to access a text file located on the sapien.co1n web site. Tllis text file contains the version nu1nber of the current version of PowerShell Studio; your firewall software 1nay wan1 you when Po,;verShell Studio attempts to read this file for the first time. PowerShell Studio does not trans1nit any personallyidentifiable information when 1naking tllis check-its sole purpose is to notify you when updates are available. Many people have asked me how ca11 they add tllis type of update checking into their own GUI application, this is ho"v: First, create an index.ht1nl file within a folder on your website. Inside the Index.htinl enter only your latest version nu1nber for your application (ex. 2.2.1), or whatever specific wording you want to check for. 1 2 3 4

Try {

# Reference the folder location of the index.html file on your webserver. $URL= http://www.poshcamp.com/update/ # Here we issue a request to check the URL and read the content in the

5 index.html file.

6 7 8 9 10

11 12 13

14 15 16 17 18 19 20 21 22

23

$data= lnvoke-WebRequest -Uri $URL If ($data -notmatch "2.2. 1") { # If the version number online does not match 2.2.1 then we can either issue a Notifylcon, set a picture visible about update available, or any other process you would like to execute here. $update_pic.Visible =$tru e } else { # If the versions are the same then we do nothing, in this case I am simply making sure my update picture is not visible. $update_pic.Visible =$false } } catch { # If the website is unavailable or there is not internet connection we can do nothing or you can execute any process that you like here. $update_pic.Visible = $false

}

PowerShell Studio - Introducing Po·werShell Studio

I 21

PovverShell Studio also accesses the Web to display its product registration page (after initial installation), and to display Web pages "vhen you click on links in the Info Browser.

1.5 ACTIVATE YOUR LICENSE I. Enter your SAPIEN ID. 2. Enter your pass\.vord. 3. Enter your License No., this is the same nu1nber as your subscriptio11 nUinber. 4. Click " Activate" Eacl1 license allows nvo activations, this is great especially if you do a lot of work from home as "vell, because it will allow you to have PowerShell Studio on both your 'vork co1nputer and ho111e computer. You 1'11ill not need to enter the SAPIEN ID or PasStt1ord ifyou are doing an offline activation.

Offline Activation - If you are unable to activation your licensed copy of PowerShell Studio online, possibly due to network restrictions, you can request an offline activation k~ey. Log in to your account on SAPIEN' s \Vebsite, go to "My Account/Registered Products", on the right side of the page look for the link "Click to request an offline key". You will need to fill out a standard contact form, along with an explanation of why you need to activate offline.

M any governnient restrictions do not allow online application registering/licensing and require ofjline keys. The process is very si'tnple, contact SAPIEN to request an of/line key, they norrnally resp onded liVithin nzinutes l11ith an email and an offline activation key will show up l11ithin your Registered Software Subscriptions page. We could only wish that M icrosoft 's Ojjline Activation could be so sin1ple.

1.6 DEACTIVATE LICENSE Ok, you 're thinking "Why would you ever \¥ant to deactivate your license?" One such t:ilne 1night be if you've gotten a ne"v co1nputer and you want to install your copy of Po"verShell Sn1dio. You would first need to deactivate your license to do this. REAL-WORLD SCENARIOS 1.

2.

Your company purchased several licenses and employees created th eir Ol-Vn accounts on SAPIEN and activated licenses untler those accounts, but one or more of those team members are no longer •vith the company, can you reuse those activations? Yes, it is possible, you should send the license infonuation to [email protected] and eA']Jlain your issue, they 'vill discuss yotu options witl1 you. You had PolverShell Studio installed on your computer but the hard drive crashed anti you ctmnot deactivate it? Contact support at SAPIEN, they will be able to reset one of your activations for you.

22

I PowerShell Studio -

A Comprehensive Guide

How to deactivate license lvithin PowerShell Studio: 1.

Click on the License information in the top right of the Po,verShell Studio application.

DOe!S G y l'I_,_ fill S'toro.p.pss

SAPIEN Information Center-Articles vou may have missed

ii iii



ii ii

• features.

• Happy Halloween from SAPIEN SAPIEN Script Pac!Giger updates and new

Wjll"- l

• Mv SAPIEN license Is expiring. No, it's not!

-

• ~Keyboard Shortcuts in PowerShell Studio

Refe-~Nam

v

• Are you SAPIEN MVP material? Aeply here!

lrdJde '"--.nc!ExteFFile Pa~ F:\SAPtEN',.,oae: Shel St

• Are you headed to Microsoft Ignite 2016?

ii

Mlsc

Nim!

StarluP.°"'

WMI Explorer Remote Connection • Enable Permissions • September Online Savings

• r. Even tTr~t

• r. llSAOmonm ' r.; International

- - 1- i - - - +

View all articles related to this product



19 LAVCU!S

>.

... to t..avcut

READ O\'R CM' NUM I

figure 5 - PowerShell Studio Welcome Screen

x

license information If you have ao.rrent s.bsaipbon rurber, Qlellse entl!r or paste yru riformationll the lieldsbelow. SAPIB'l ID:

Cr~ale

ocr:IU!t..

Password:

tntlSeno: Nole: SAP!!;N ID Olld 1>4S$W01d are not reed when en~ .., offtrie .node key. Renew Now

Yru anent subscription is valid tlTouli>: 8/"1D 17

vemon.

Deactivating yru !leer= Y4 revert lhs prorurt to an e-ed tnaj You no.ost be comected to the i'tternet to regal! an acl>vabon for another computer.

![

De~alekense

]

Figure 6 - Deactivate License 2. Within the License Information box, click on "Deactivate License". Prior to version 5.3. 131 you could click on the "About" icon in the top right of the Po'\overShell Studio '\-Vindow.

PowerShel l Stud io - Introducing PowerShell Studio

I 23

The "deactivate license " button and "copy info ,, button 111ere removed 1iVith the release ofversion 5.3. 131 1.

Select your PowerShell Studio license fro1n the list of SAPIEN products. All SAJPIEN products that are currently installed \vill be listed so be sure that you select the PowerShell Studio installation.

x

About SAPIEN PowerSh1>ll Sturlin 2016

• • • S1\J>l I N

••• PowerShell 2016 ••• STUDIO.. 1hs product is licensed

SAPIEN PowerShel Studio 2016

Jeff

Version 5. 2.129 Copyright© 2010-2016

---- ---

__ ... -

SAPIEN Tec:Mologies, Inc. PowerSheJ Stuc:&o 2016 ProductMty Pack 2016 SAPfEN Sofuvare Slite 2016 Trial Expred

I

_t: •v-·

Select License Copy Info

-

I

\11/amuig: This computer program rs protected by copyright law and intemabonal treaties.

Unauthorized reproduction or distnbution of this program, or any porbon of 1t, may result in severe dVi and 0'1mll'lal penalbes, and wil be proseruted to the maxirrum extent possible under the law. PowerShel Studio uses a subset of the \VIX Toolset to create MSI insta!er databases. The complete \VIX Toolset rs open source and can be dov-.'nloaded from http://V\'ixtoolset.org.

,,- - - - - - L I

Deactivate LJCense

OK

J

'

Figure 7 - Deactivate License 2.

Click " Deactivate License". Now you are free to install and activate SAPIEN PowerShell Studio on another co1nputer using your original license information.

"That was easy.'"

24

I PowerShell Studio -

A Comprehensive Guide

1.7 OPTIONS AND CUSTOMIZATION SAPIEN certainly tl1ought about flexibility \vhen they were designing their options for PowerShell Studio. In this section, \Ve vvill go over the various options that are available and what they do.

1.7 .1

General Settings

-

Settings ~ Enable remote file stab.JS check

Show start page on startup

l Restore open fies on startup

r

Console

~ Show exported fies n

Alow nU~ instances

~ Show the doa.ment selector when navigall"lg tabs

~ Enable deferred file loading I1

l

Windows Explorer

Defa!At fie type:

Save Al Settings.. ~

Save Editor Settin9s

I ~ PowerShel Sa1>t [

Load Settings...

v

_J

User Infurmabon

I

I I

Jeff

Username: Orgarizabon:

I

Assembties

~~

Olrectones

I

Defa!At Fies Directory:

C:';.Jsers\Jeff'4)ocunents\SAPIEN'PowerShel Stuclio\"ies

Deraut Project Directory:

C: VJsers \Jeff'4)ocunents\SAPiB"'fowerShel StudioV>ro.iects

Template Directory:

C:VJsers\)eff\App()ata~oasmg\SAPiB"'fowerShel Stuclio 201J

I

Q

.J

I

I PowerShel

Project Settings

Deraut acbon fur copy ll'f'C)Ol't fie to project:

Sou"ce Control

Figure 8 - General Settings • • • •





Sholv start page on startup Enables or disables the start page. Restore open files on startup Reopens the files that were open \Vhen PowerShell Studio was last shut down. Allow multiple instances Allows for 1nore than one copy of PowerShell Studio n1mling at once. Enable deferred file loading Loads files on demand. Deferred loading ilnproves overall perfonnance when loading large groups of files while reducing memory consu1nption and load times. Enable remote file status check PowerShell Studio "vill wan1 you if a file has been edited outside of its editor. Checki.J1g remote files can cause Po\verShell Studio to slow down. This option allows you disable remote file checking if needed. Sho\v ex1Jorted files in Windo\vs Explorer After exporting files from PowerShell Studio, launch Windows Explorer focused on the export folder. If you do not the Windo\tvs Explorer to open auto1natically every time you do a build or deploy, then uncheck this box.

PowerShell Studio - Introducing PowerShell Studio •

I 25

Show the document selector 'vhen navigating tabs

When you press [Ctrl + Tab] to cycle behveen documents, the Document Selector appears, if you do not \Vant this to appear and you wa11t to directly cycle through the document tabs without the selector then uncheck tlris feature to disable it. •

Default file type



Choose what gets created \Vhen you click on the ne\v button ( ) in the ribbon bar. U sername and Organization Enter your details here. This infonnation will be used in your templates.



Default Files Directory

Specifies the folders you would like Po\verShell Studio to use to store scripts. •

Default Project Directory

Specifies the folders you would like PowerShell Studio to use to store projects. •

Template Directory

Specifies the folders you would like PowerShell Studio to use to store templates. •

Default action for copy im11ort file to project

When importing an existing file into a project, PowerShell Studio can 1nake a copy of the file and add it to the pr~j e ct folder or create a link to tl1e original file.

IT

Save AD Settings... ]_ _ _ _[

Save Editor Settings

J___L_

Load Settings.. .

JI

Figure 9 - Application Settings Save Options

Save All Settings - this buttons saves all application settings. Save Editor Settings - this button will only save editor settings. It can take a lot of time to get your environrnenf..just the way that you like it, and it would be very disheartening to have something happen and lose your configuration. The configuration A.ML files are stored at the locations listed below; it is highly recommended that you keep a copy these files in a safe place.

%HOivlEPATH%\Documents\SAPIEN\Po,verShell Studio 2016\Files\PowerShellStudio.Settings.XInl o/oHOMEPATH%\Documents\SAPIEN\Po\verShell Studio 2016\Files\PowerShellStudio .Editor.Settings.xml Load Settings - this can be used to loading a previously saved settings XML file. *You will need to restart the application after loading the XML file(s).

26

I PowerShell Studio -

A Comprehensive Guide

1.7.2 Backup Settings

I-

Restore Points v' Create a restore po11t as soon .-s a file is modified.

~ Remove restore po11ts when the appicabon do'..es. Ver~ecal

U

Automabealy submt to VersionReall reposotory "hen a tile tS dosed.

Panels

-

Figure 10 - Backup Settings •





Auto save every [x] minutes The frequency in minutes that files will be auto-saved. I personally set nrine at 5 ininutes, although inany will say that is overkill, I have lost data in the past and we all know how that feels. Create a restore point as soon as a file is modified Create a restore point when you inodify a file to allow you to easily undo all cha11ges. The automatic restore point is only created once, at the tiine of first edit (start of a session). This confuses a lot of people, some might think this ineans that every time you 1nake a chaJ1ge to yotu project or file that it will automatically create a restore point, however that would be wrong! When you create a pennanent restore point, it only stores one. This is meant as a quick recovery tool ai1d not as a versioniI1g tool. So. if you work on your script for a long time and you need to restore it to a point using this method. then it will restore back to the begi1uling of vour session. You will lose everything you've done since. Remove restore points when the a1Jplication closes If you're about to do so1nething in your script that you 1nay want to roll back from, click the Create button on the Restore Points inenu on the Tools ribbon.

Q • •

When you close PowerShell Studio, restore points 1'vill be removed.

Automatically submit to VersionRecall repository when a file is closed VersionRecall is SAPIEN's version control syste1n. Tllis option allows you to save your script to VersionRecall when it closes. *Thls is a separate SAPIEN application not included inPowerShell Studio.

PowerShel l Stud io - Introducing PowerShell Studio

1.7.3 Console Settings General

Console Style

Font:

SIZe:

[ Lucida Console

I

Console

Bold

v

8

L I tak

'

AaBbCCXXYyZZ

Ecitllf

Assel'rbM!s Formattr.g

Panels PowerShel Sou'a Control

Figure 11 - Console Settings



Font Sets yotrr preferred font for the PowerShell console.



Test Color, Size, Bold, Italic Configures the display properties of the PowerShell console.



Enable enhanced console input line Creates a separate input box to type, instead of typing directly into the console. !l!console

Cl

Figure 12 - Switch between 32 and 64 bit PowerShell

x

I 27

28

I PowerShell Studio -

A Comprehensive Guide

1. 7.4 Debugger Settings These settings configure the net\;vork ports that PowerShell Studio uses to connect to a remote installation of the Remote Scripting Execution Engine. You inust use the same port nu1nbers on any computer that you want to support t11e re1note execution. When deciding on which ports to use, it is important to consult your network and security tea1ns, as they will be able to advise you which ports are safe to use and, if required, reconfigure any firewalls. Port nu1nbers are specified in the registry on a machine that is running the RSEE service.

' General

Remote Ports RSEERe~:

8adoJp

Deb\Jgger Recevrig:

C«lsole

-

Debugget

'

J:]

tJ

1

9988

RSEE S°"°"9:

L

9987

99861:1

Deix.gger Sending:

[

i§J ~J

Note: lncOfTlll!j and outgo,ng por1$ are reversed on~ se1V0r Side. The ou19ol)g port here IS '9 port on !llde and vice ver~.

Illat

l.Dc:IJlion

Ye.

II

No

Figure 18 - Search for source file

1. 7.6 Editor Settings General

Console

Ecitor Se~ r.,/

_.., Enable anent ine ~tng

.., Enable track changes

D Use v.ntespaces instead of tabs

2J Show ine runbers

v Show crndet help whle typing

J

V' Enable br~t ~tng

V' Colapse regions on load

Cok.lm:

Editor

Enable axle folclng

./ Enable automatic syntax chedang

80

II

Show white spaces

[1 Show ce>Um ~

Tab Size:

Insert comment-based help:

I BefolEN • Pov.t.ctUlts

.._. RT·AC6'W

~ s.ics {U:..·pc)

..,

Figure 27 - Save Editor Style

Give the preset a name and press the Save button. Now the preset will be displayed in tl1e drop-down list:

Ed1t0t Font 4nd Color Setting~

IPresie~· IFY ~:D'!'I Pr~..tt =====. .: -) =~=

..=e= As=Pr=esc =t=..= .~

;:I

Sa.ec!Se~

Fo. t (bod

Sl."I::

Conse>Q· ~erShcl !SE Thcf"lc PowerShel S:udo "'he1ie f:o;:o

...

~t ~

Cl 2SS, 255.

:.'~~

-------'· Cl 240,·

_ ___.. v

:'-!O,

10

bad.vOU'ld: 2~ _ _ ______,_v

Ordct ~ ~'fd\'lotd

Ooera:or Y'ari-'11""' 1-&rb:r

u-oti••

SIMO Co "ieilt Fune \'IOI •

~=

Poron:!=r

CO'l't'l\at'd As ?111an"eti!f Codie Snooet f,ecf I fitJ'Wl'i:cd Ref°tf C"ICC Type

-

A4BbCcXxVyZ:

J

B.esCCfeOefaJts

Figure 28 - Custom Presets

...

PowerShell Studio - Introducing PowerShell Studio

I 39 i

j

!.................................................................................................................................................................................. ...................................................................................................................................................................................................................... ~...................................................................................................................!

You can quickly wrap selected text in the editor in brackets, quotes, braces, or parentheses, by using the shortcut keys below.

Keyboard Shortcut

Wrap Selection In

Ctrl + Shift + 9 Ctrl + [

()

Ctrl +Shift+ [

{}

Ctrl

+'

Ctrl +Shift+'

[J

'' ""

40

I PowerShell Studio -

A Comprehensive Guide

1. 7. 7 Assemblies Settings General

Default Editor Assemblies

+ -----1 ran mscori:>, Version=4.0.0.0, Oibse=neutral, Pub&dI [Sy> ~ rOf"P'~ • SChartContro1, (Par t (Position SXPoints, (Pa r (Posi tion SYPolnts, (Pa • (Position ( st ini; ) SXT!tl .-, (Position ( P• [ st ini.J

s.:

= 1, Mandatory = $true)]

.ing.Ch1rt)

s•

[ P.r (Position SJCPoit1ts ,

2, X.ndotory

Struc))

(Par (Position SYPo!nH,

3, x.ndatory

Struc))

(Par [strina)

•, Xandatory

Sfals.e))

Sl S3

3, Kandatory

Stru.-))

'• X.ndatory

Sfalse) l

S9

Sfohc) )

68 61 62 63 64

5, ll.lndatory

St rue) J

I

Por• ( (Por.o&e• (Po•ltion [Alles( I )) (Sys te-.1111\dCo. •o SChor tCont rol ,

SS 56 57

2, X.t>datory

, Lolout TOfllC$

•e ,A

I

eot"t Oldct$

r. HodtJres

• fiAl>'l'x

• r; !liUlransfl!:r

Cii'J 1est.p&"

?

I

Name

~



Posi~

Si:>or~ocess



·I

Parameter Set filter. (Show All)

C...,.,l>!r

~:>l'aQIOll

Conf1m1Jmpact

t:

Default Parameter Set

~ onfi

?

Type

• Po
rogram Fies (x86}\SAPIB"Technologies, lnc'fowerShel Stucio

v

2016~c l

l:'S

MSI Opbons

64 bt 11Sta!er ~ fnstal fur al users >./ Requi-e Aclml'lislTator

Mnm.m PowerShel Version required:

lPowerShel VerSIOf'I 3

. OK

Cancel

Figure 54 - Product Settings

Product Name: this is the name that \vill be displayed in "Progra1ns and Feattrres" after installation. Product Version : The version nmnber. You should incre1nent that number "v henever you create a new build of your product. The installer will use that nmnber to detenni11e if the specific product version is already installed. If it is, it will not install. If you created an MSI with a higher nu1nber, it "vill uninstall the old version and then install the newer one. *Notice there is no auto-incrernent file version when creating a11 MSI, as there was with creating ai1 EXE. Company Name: tllis is the name that will be displayed in "Prograins and Featt1res" after installation. Product Type: Yotrr selection here, together with tl1e "64 Bit installer" and "Install for all users" options detemline \V here your files are installed.

The following table sho\vs the locations for 64-bit OS with "Install for all users" selected -----------------------------------------

PRODUCT TYPE Windovvs Application Script Application PowerShell Module

64 BIT

32 BIT C:\Program Files (x86)\Product Name C:\Program Files (x86)\Product Na1ne %Windir%\SysWOW64\ WindowsPowerShell\vl .O\Modules\P roduct Naine

C:\Progra1n Files\Program Name C:\Program Files\Product Na1ne

I

%Windir%\Syste1n32\ WindowsPowerShell\v1.O\Modules\Product Name

88

I PowerShell Studio -

A Comprehensive G uide

The folloiving table shows the locations for a 64-bit OS w ith a current user only selected

PRODUCT TYPE -

-

Windows Application Script Application PowerShell Module

I

32 BIT

64 BIT

- -

C:\Program Files (x86)\f>roduct Name o/oHomePatho/o\Script Apphcations\Product Name %HomePatho/o\WindovvsPowerS hell \Modules\Product Name

C:\Program Files\Program Name %I-IomePath%\Sc;ript Applications\Product Na1ne %Ho1nePatho/o\WindowsPowerS11ell \Modules\Product Name

Product Icon : This icon file w ill be embedded in the MSI file and shown in "Programs and Features" with your product.

64-Bit installer: Checking this option prevents installation on 32-bit OS. It also registers COM components as 64 bit co1nponents and changes some folder na1nes as indicated earlier.

Install for all users: This \Vill install the application and its shortcuts for all users on a system . In most cases this option \:vill require administrative privileges. It also affects the install folder location for some product types.

Require Administrator: Checking this option will cause Windows Installer to prompt for elevation on Windo,vs Vista or higher. The type of prompt depends on your local UAC (User Access Control) settings and the currently logged on user.

Minimum PowerShell Version required: select the 1ninimum PowerShell version that your application requires to run, any version less than that is detected a prompt to install the 1nini1nt1111 version will be displayed and the installation aborted. If you use an installer prograin such as InstallShield, you can include the files for the 1ninilnu1n PowerShell version as a prerequisite. I have also used this to install required PowerShell Modules for applications. 4

Another rather interesting method is to create an Elevated manifest.exe which copies the modules to the correct folder. In yourpri1nary exe or application (at the very first part of your code) make an " if (!(test-path $module_path) {start elevated.exe }" . This \.viii prompt the user \.Vith an elevated message if they \Vant to install the 1nodule. Once it's installed once, it will bypass the elevated install next time the app is ru11 because the test-path is true.

Scripters definition of a Zero- Day

4

https://www.sapien.com/forums/viewtopic.php?t=7894

PowerShell Studio - Basic Orientation

I 89

FILES AND FOLDERS x

MSI Settings - test. psf

r;-oduct Detais ]

~ /Folder

Files (drag and drop files here) S-

~P

C: Tn'

Create Shortait to: MSI Name:

"l

[(SO\Kce Script) test

Output Folder: StaoiigFokler:

.ll'ISI

Ire I r..________________,11 r:o I 1£~sers\leff'l>ocunents\SAP!EN'fowerShel Studlo'files

I

Figure 55 - MSI Settings (Files/ Folders)

Files: These are the files that you installed. Arrange and name them exactly as you ' vai1t tl1em installed on the target machine. Please make sure that you don' t have any stray temporary files in this folder, because anything here will be included in the MSI file. If you have COM object DLLs, just place tl1em here as well. They will be recognized as such and registration information will be extracted at build ti1ne. Create Shortcut to : Select the file you want to create a shortcut to in the Windows Start 1nenu. Currently, you can only select one file. Typically, this is your main executable or sc1ipt file. For PowerShell modules, you can link to the help file for example. MSI Name: The filename for your MSI. This only affects tl1e actual MSI file and not any of the internal names. Out 1l ut Folder: This specifies the location where you want the MSI file to be created. Do not use the staging folder for your software for this or your previous M SI file vvill be included in the next re-build. If you have not loaded a wizard settings file fro1n someplace else, a .1nzw file with the same base na1ne as the MSI name you specified will be created, tl1at file contains all the setting you entered into the wizard' s dialog. Staging Folder: This is the location of all the files that you want installed.

90

I PowerShell Studio -

A Comprehensive Guide

SIGNING x

MSI Settings - test.psf Product Detais

Fies /Folder

~

l [i] ~ I

Certificate:

I

Password:

I

Time:starrc URL:

[http://trnestamp.globalsql.com/~tsjlmstamp.dl

0

I

Use the SlgrW1g Vfizard to Sl9'l the MSI fie.

I

OK

I[

Cancel

]

Figure 56 - MSI Settings (Signing) Certificate: A certificate is either code signing certificate installed in your local store or a PFX file you specify in this fields. You can browse for a PFX file using the file browse button or using the certificate button. Pass,vord: If you specified a PFX file for code signing it may require the use of a password. If so, please enter it here. Timestam1> URL: This URL is used to create a time stamp for the signature used to sign the file. Logging the time of signing allows you MSI file's signature to re111ain valid even after the certificate expired. Use the Signing Wizard to sign the MSI file: If your certificate does not fit the above criteria or if you need to sign \vith a different signature each time you are building an MSI, you can use the Microsoft Signing Wizard. Any settings entered above will be ignored and the wizard \Viii guide you through the signing process. Build : creates the MSI installer package based on the settings you configured.

Settings

Insta er

Install: this will install the current MSI build. U ninstall: this will uninstall the current package installed (if it inatches the same version).

PowerShell Studio - Basic Orientation

I 91 i

j

!.................................................................................................................................................................................. .................................................................................................. .................................................................................................................... ~......................................................................................... ..........................!

Settings

~.Deploy •

Deploy: creates the deployment based on the settings that you configured.

lldl Send to ...

Send To : sends a compressed archive of the deployment files for the active docrunent to an email recipient.

(j

Copy to CD/DVD

Deployment

Copy to CD/DVD : bun1s the deployment files for the active docu1nent to a

CD/DVD.

x

Deploy Settings - test.psf Mall fie to deploy:

I....(Scu _ ce _ 5CJl> _ t) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _I"

[

OK

J

rs::~ Sal>t)

!Additional Files (drag

' (Packaged ExeaJtable) (lnstaler Fie)

Deploy Res to:

I

Additional Deployment Commands

Figure 57 - Deploy Files

Main tile to deploy: There n1ust be at least one file to deploy, fro1n the dropdown box you \.viii notice in the example there are four selections: • • • •

None: this is the default and you cannot deploy using this selection of course. Source Scri1Jt: this is will use your existing script file to create the deploy1nent. Packaged Executable: this \Vill only be listed in the dropdown if you have first used the Packager to build an executable .EXE. Installer File: this will only be listed in the dropdown if you have first used the Installer to build a Windows h1staller file .MSI.

Additional Files: need to add files to your deploy1nent, drag and drop them into here. De1>loy files to: this is the location that you want your deployment saved to.

92

I PowerShell Studio -

A Comprehensive Guide

Additional Deployment Commands: For the additional deployment com1nands, you can add any co.rnmand line tools you like or need. If, for example you need to also ftp your MSI file so1ne,vhere, this would be the place to specify that command. These commands are executed in sequence, one at a time, so make sure you have no blocking tools in there which 'vill potentially sit all night with a dialog up, waiting for your response.

2.2.4 Tools Tab

rm

[j

-;J



~

.

fii 0 an Des9'ler

nl

;

Deploy

~

Tools

SOIXce Control

iji Fm il Faes.. .

!]) Ched< Syntax

~ PmlalSaipt

~ PowerShel ~Wnter

~]! Compare Fies

)'$ Verify Scrl>t

~ PrmalSQL

~ VerSIOO Recal

~ Custom Tool •

~ Analyze Scnpt

E:3 PnmalXr-t.

Home

Sign Script

.

Analys!S

Fie

View

m

a PowetSJiel Console a PowerShel ISE

EiJ PowerRefi7 . 26 bc;&tt.cc.S

l.ll

ert.V JU1:11;11-•u.eV.i.na..15t.ylchcld:.olo::•>trot

tr 14 Sf t

'fP~.cy :ia:t.••O..-.V:.aU&ll'tyl~clttolor•Ji >tlili ""lili «/ilil Prilii Cl>tn: iiliil'> iillll••-

~''



true-

f t J.

! 69 '" ,,

~70

tn.lttonJ < F:ci:-r~v r.eae••5~zc•>fi,

"'

16

Cowa. rorsq.lu:c.on. Sy•t.,.:.w.1: J)OO'V1t. ronu, '.'e&11an.., .{).O plication] section, add co1nrnands that don' t exit, like a conunand that displays a file or UI that you 1night vvant to keep open. The custo1n 1nenu runs these co1nn1a11ds and exits without waiting for them to complete. • There is a [Commandline] section that you might hear about, however it is the saine as using [Menu] .

For example, here a co1n1nand in the [Ap1>lication] section opens the current Custo1nMenu.inffile in Notepad, and the Run Get-ACL conunand in the [Menu] section. As you can see from the screenshot of the menu on the previous page, the [Menu] section and (Application] section are auton1atically separated by a line .

[n1enu] 1=Run Get-Acl;povvershell Get-Acl -Path $File$ I Format-List -Property * [Application] l=Open CustomMenu.inf;Notepad 'C:\Progranillata\SAPIEN\PowerShell Studio 2016\CustoinMenu.inf'

5

https://www.sapien.com/blog/2016/05/23/add-custom-tools-to-the-menu/

PowerShell Studio - Basic Orientation

I 97

To add a separator line wherever you want, to better organize your menu, enter a line between two items and use a dash "-" character. Example;

[menu] 1=Run Get-Acl;powershell Get-Acl -Path $File$ I Format-List -Property * 2=Get User;powershell [Environment]::UserName 3=4=Get IPConfig;powershell Get-NetlPConfiguration

-

A Find in Fies .. .

~~ Compare Fi!es Sign Script •

Custom Too! ...

Run Get-Acl Get u~er Get IPConfig Open CustomMenu.inf

Folder-S11ecific Custom Tools To create custo1n tools that appear only when the current file is stored in a specific directory, place a CustornMenu.inf file in the specified directory.

L.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................l

l]l

-

Check Syntax

Cbecl< Syntax: this nifty tool will run through your script a11d identify any syntax errors that it finds. I reco1m11end doing this after any inajor changes to a script.

, ~ Venfy Scrrpt , ~ Analyze Script

Analysis

Verify Script: instead of checking syntax this tool will check that 11ave all the required parts to your script, i.e. if you have Import-1nodule state1nents it vvill verify that you have those inodules available.

Analyze Script: this is a co1runu1Iity driven module called 6''PSScriptAnalyzer" . PSScriptAnalyzer provides script analysis and checks for potential code defects in the scripts by applying a group of built-in or customized rules on the scripts being analyzed. One of the things that you will notice that it does not like are Aliases, now I know this will frustrate inany Po,verShell scripters because the 1nain consensus is to make your com1nand lines as short and as efficient as possible. The upside is, to the beginner it inakes reading your code inuch easier if you use e:x.1Janded cormnands.

6

https://www.powershellgallery.com/packages/PSScriptAnalyzer/l .8. l

98

I PowerShell Studio -

A Comprehensive Guide

,. ..........................................................................................,,.,,.,, ..........................................................................................,,.,,.,, ......................................................................................., •., •., ........., ••_ ...............................................................................................................................................................................,,.,,.,,1

I,.,........................................... SAPIEN..................................................................-................................................................................................ .. ;

, _,,,

~ PMnalScnpt ~ PowerShel Help\'Inter ~ Pr.malSQL

~ Version Reca~

t:i PrimalXML

~ \A/MI Explorer

i

..................................................................................................................,_ ............................................................................. ..._,.......................................................................................;

BJ Po'lterRegEx fa Profi1e Editor

~,

These are weblinks to various SAPIEN products to enl1ance your PovverSl1ell scripting.

SAPIEN

7PrimaJScript:

Pri1nalScript 20 16 is the next generation of our industry-leading Universal Sc1ipt Enviro1unent (USE). As a syste1n, database or network achni11istrator, web developer or e11d-user developer, you need to vvork with 1nultiple technologies, lai1guages a11d file formats at the sa1ne time. 8Prima1SQL: usiJ1g Pri1nalSQL you cai1 connect to any database: fro1n Microsoft SQL Server to Oracle to Microsoft Access or even Microsoft Excel. PrimalSQL can be used to build rich and complex queries. Fro1n within the application yo11 can test ai1d retine queries, export results or generate code snippets in a vaiiety of languages. Its modern, strea1nlined interface makes PrilnalSQL easy to 1mderstand and use. 9PrimaJXML: a tool tl1at is specifically designed to edit, manipulate, and create XML files. 10

Po'\verShell HelpWriter: PowerShell Help Writer 20 16 is the pre1nier editor for Windovvs PowerShell XML help files for all command types, including c1ndlets, functions, workflows and CIM collllnands. 11

VersionRecall: VersionRecall 2016 auto1nates the n1ost widely used manual process of creating backups and 1naintaining inultiple versions of your files. 12

WMI Ex1Jlorer: tl1e next generation tool for e>..]Jlo1ing the vast universe of the Windows Manage1nent Instiun1entation database. The WMI database represents a huge repository of infonnation about yolu servers and client 1nacl1ines \¥hich as a syste1n or nehvork administrator you need to utilize every day. 13

PowerRegEx: Po\;verRegEx is the tool that makes regular expression creation and discoverability easier, by grouping regular expression constn1cts by category, providing construct descriptions a11d exan1ples.

Profile Editor: Po\.verShell's profiles inake setting up your \VOrk environment a bit easier, allowing you to pre-load your 1nost co1nmon snap-ins or 1nodules, defil1e fimctions, set variables and whatever else you need on startup.

7

https://www.sapien.com/software/primalscript 8 https://www.sapien.com/software/primalsq l 9 https://www.sapien.com/software/primalxml 10 https://www.sapien.com/software/powershell_helpwriter

https://www.sapien.com/software/versionrecall 12 https://www.sapien.com/software/wmiexplorer 13 https://www.sapien.com/software/prod uctivity_pack 11

~

PowerShell Studio - Basic Orientation

I 99 i

j

!.................................................................................................................................................................................. ...................................................................................................................................................................................................................... ~...................................................................................................................!

~

PowerSheD Console

~

PowerSheD ISE

PowerShell Console: opens a PowerShell console "vindo\.v. PowerSbell ISE: opens the Windo"vs PowerShell (x86) ISE console.

DI Update+ielp U1Jdate-Help: this will update your help files to the latest available version.

Power Shel

Q

x

Updating Help for module Microsoft.PowerShell.Operation.Validation

..

.

.

.

.

.

0% Installing Help content ..

figure 60 - Installing Help If you receive this not so user friendly error message during Update-help it means that the help file isn 't available yet for download from Microsoft. Not the most intuitive error niessage I agree, but it's generated from Microsoft, not SAPIEN.

Ex.

'https://technet.microsoft.co1n/en-us/library/jj657534.aspx' does not resolve to a container.

2.2.5 Source Control Tab r.m D·B·lr O.nn. • -

Home

c

Create

G Restore Cl Delete ~ Rewind

Restofe Points

Desig11er

Deploy

~

VersiOORecal Explorer

Tools

[1- Submt Fie

CJ, Restore Fie (l0 Get Latest

VersionRecal

Source Control

~

Lat..neh

~

View

®, AddTo•••

~ Undo Chedc Out ~ Properbes

~ Chedcin

~Get latest

~Compare

~

~ View 1-tistory

Refresh

ChedcOut

Source Control

These controls are all based around providing a syste1n to restore your script back to a previous ti1ne, and providing source control for yotrr scripts, especially when \.Vorking "vith other teain me1nbers on the same script.

100

I PowerShell Studio-A Comprehensive Guide

;

,.,.........,,,_,,,............................................................ ,_,,,.......................................................................................................................................................................................................................................................................................................................................,_,,,....................................................................................;

~

0 Create

G Restore £1 Delete

This reminds n1e of Microsoft Windows restore points. and it does si1nilar behavior but instead operates at a script level. This \vill help you recover fro1n shooting yourself in the foot if you iajected mistakes or erroneous code into your scripts.

..._ Rev-.'ind

Create: before any

m~jor

scripts updates I highly recotnmend that you get into the habit Restore Points of creating a restore point, one day you will be tliaukful that yo11 did. Currently there doesn't seem to be an indication that a restore poi.lit has been created. which can mislead you into thinking that nothing happened. I would prefer some type of message or stah1s indicator that the restore point created successfully. It will however if it is the first restore point you've created, enable the "Restore'' and "Delete" b1Itto11 which is at least so1ne indicatiou, but after that it is hard to knovv subsequent restore points created successfully. Only the last created restore point 111ill be kept, there is currently no restore point history. Do you wish to restore this file?

Restore: this will restore your script to the last restore point that you created.

You \Vill get a popup confirmation message before restoring.

test.psf

Delete: this will delete your last restore point. 14

Re,vind: this is used to restore your script back to the beginning of the

current session. Careful using th.is if you have been working on your script for quite a vvhile as it \Vill erase ALL changes since the beg.inning of the current session. Restore Points

V

Create a restore po111t as soon as a file 1s modified.

P' Remove restore points when the application doses. Restore Point options are available in the "Backup" tab within PovverShell Studio Options.

... . . .-.. . . ... . .. . .-.. . ..... . .. . . . .. ... . . . . . . . . ... .. . . . . . . . . . ... . . . ... . .. . . . . .. . . . . . . . ... . .. . . . . . . . . . . . ... . . . . .--.... . . . . . . .. . . ... . . ... . . . . .. .... . .. . . . . . ....... . ... ... . . . . . . . . . . . . . . . . . . . .. . . . . ... . . . . .. . . . . ..... . . . . .. . . . ...... ... .. ... . . . ... .. . ... . . . . . . . . . . . . . . . . ... . . . .1 rI VERSIONRECALL I ...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................i

15The

simple and quick setup lets you select a folder that VersionRecall vvill 1nanage as well as a "backup location" where your previous versions 'vill be stored (usually on an exten1al drive or network drive.) Fron1 that point on~ \vork as you usually do, saving the file locally, and wl1e11 you are ready, sin1ply subnlit the file using Version.Recall E:x.rplorer or our Windovvs Explorer integration. Or, set VersionRecall up for autonlatic submission at a predeternli.ned ti1ne. You must have SAPIEN's Version.Recall installed on your system otherwise the controls in PowerShell Studio vvill be disabled. Unlike many other versio11 recall systems, SAPIEN's Version.Recall 11ever changes a file or its extension., so restoring is very simple and as easy as opening an older version of the file, there is no cryptic fonnat. There are also no locking 1nechanisn1S. so no check-in or check-out, which is good for a one or two-person tea1n.

14 15

https://www.youtube.com/watch?v=DsNCIEXSY6A https://www.sapien .com/software/versionrecall

PowerShell Studio - Basic Orientatio n

I 101

Version.Recall is in a11d of itself a full featured product separate from Po\;verShell Studio so we won't go into inhere. If you 'vould like to k.no\¥ more abol1t Version.Recall visit depth detail https ://w\.vw .sapien.com/software/versionrecall

~ VersronRec Explorer

s

bmJt

Q, Restore F "' ~ Get latest

VersionRecall Ex(llorer: this will launch the Version.Recall E>..1Jlorer with the associated repository that corresponds to the active document. Submit File: submits the active file to the corresponding Version.Recall repository.

VerS10nRecal

Restore File: ove1vvrites the active file with the latest with the latest version submitted to the correspo11ding Version.Recall repository. Get Latest: overwrites the active file with a newer version from the corresponding Version.Recall repository.

l .....................................................................................................-.................................................................._..,.................................................................................................._.............................................................................................................................~...................................................................................................................J

16

Version.Recall is a Source Control Provider. However, SAPIEN did not want it to intentionally ~ Get latest ~ Compare ~ Check In use any API especially not tl1e Microsoft SouTce Launch Control interface for several reasons. The specs for .., Checkout ~ ew History Refresh the Microsoft Co11trol interface API can be changed Source Control without notice and it is a very dated API which causes excessive work on the part of the develop1nent team to confonn to its requirements. ~Add To ...

~ Undo Check Out

[B Properties

To enable the Source Control tools, you must first have setup a source control provider, and enabled source control in the PowerShell options u11der "Source Control" tab. Settings ~ Enable source

control

../ Prompt for check in

Automatic check in:

Disable Automatic Check In

Check out on edit:

Automaticaly Check out

Direct info output:

suppress info messages

Launch : launches the source control soft\vare. Alld To: adds the cturent document to a source control database. Check In: checks in the changes to the current docume11t into the source control database. Check Out: checks out tl1e current docttn1ent for editing fron1 tl1e source control database. Undo Check Out: restores the file to the last checked in version. Get Latest: get tl1e latest version of tl1e document fron1 the source control database. Vielv History: view tl1e past versions of tl1e current docu1nent. Properties: vie"v tl1e source control properties for tl1e current document. Com11are: compares the active doctunent to a previous version. Refresh : refresh the source control status.

16

https:// www.sapien.com/b log/20 14/04/23/versionrecall-integra tion-with-primalscript/

I PowerShell Studio -A Comprehensive Guide

102

i

................................................................................................................................................................................................................................................................................................................................................................................................................................... ..................................................................................................i

~

~

17

GIT is a free open source distributed version control system designed to handle everything fro1n s1nall to very large projects, ai1d is probably one of the 1nost \.Videly used version control systems \Vorldwide. Currently the only support for GIT integration \¥ith PowerShell Studio is via the custom menu. Unfortunately, GIT does not have an API. To use a source control solution with SAPIEN products it must have a MSSCCI provider, there are a few MSSCAPI providers out there for GIT. If you're using projects, you cru1 run a git add -u with the custom menu and it'll add just the modified files in your repository to be co1nmitted.

CUSTOM GIT MENU [Menu] l=GIT - Add To 2=GIT - Commit ''{PromptlEnter 3=GIT - Commit "{PromptlEnter

Staging;"C:\Program Files\Git\bin\Git.exe" add "$file$" To Local Repo;"C:\Program Files\Git\bin\Git.exe" commit $fileName$ -m commentlCommit from PowerShell Studio $Date$ $Time$}'' All To Local Repo;"C:\Program Files\Git\bin\Git.exe" commit -a -m commentlCommit from PowerShell Studio $Date$ $Time$}"

4=-

S=GIT - Status;"C : \Program Files\Git\bin\Git.exe" status 6=-

7=GIT - Push Files To Remote Repo;''C:\Program Files\Git\bin\Git.exe'' push Remote 8=GIT - Fetch From Remote Repo;"C:\Program Files\Git\bin\Git.exe" fetch Remote 9=GIT - Pull From Remote Repo;''C:\Program Files\Git\bin\Git . exe'' pull Remote master [Application] l =GIT - GUI;"C:\Program Files\Git\cmd\git-gui.exe"

GIT SOURCE CONTROL ARTICLES •

How GIT branches affect files on disl
: this checks online with Microsoft for updates to Windo,vs

PowerShell help content. .............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................r

i

ONLINE

........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................:;

Contains links to online SAPIEN resources for support, latest information, articles, forums. Very useful when you are trying to solve an issue or get advice on the best methods to use for your scripts or forms.

Ask the Experts

SAPIEN Blog

GUI Related Artides

SAPIEl'J Home

MvSAPIEN Account

Supoort Forums

Online

L......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................J

Context Hefp Help

This can be confusing for many and I have seen co1nplaints that it doesn't do anything, the issue is usually that it is not being used correctly. The context help triggers on the caret position and not actually the selection, so place your cursor at the beginni11g of the c1ndlet then click the Context Help button. If help is available for the c1ndlet then it \viii either be displayed at the bottom of the screen in the window belo"v your script, or if it is an online help resource your default browser \Vill open to display the help page.

In the next screenshot, you can see the cursor at the beginning of the attribute "Para1neter" on line 23 . After clicking the Context Help button the help information appeared in the \.Vindo\v belo"v.

2.2.7 View Tab teer

Lavout

The view tab contains several options for panel vie,ving \.Vith different areas of PowerShell Studio including; Output, Editor, Designer, Debugging, Layouts, and others. It also includes buttons to display the Start page and Po\:verShell Studio Options.

There are various layout templates that you select, such as; Defaltlt, Co11sole, Debug, Designer, Editor, and Editor Only.

PowerShell Studio - Basic Orientation fl ..l -

El .._

E "" _.,., ~

Gi O ot>'" ~ .....

-w...

·tt~

-

-

...-e. ..... .....

•l '"-' ~ • ;;i '

...... cn..o

:::

b..•t

.. - .. ";;]

t:. t.Jw

..-

-..

....

-.

......

.:

,

... . .

ID..-•

"~o.ra.._

-

• S'l'"-

~



.

.Gr'J( lllll

.. 11

......

ii



...

WY'!! ,.,. .,_._,,....,,..,._, ,.,. ..,._, ftf 1to. • -

x

" 0

"°.uo.-.c.

------------- ----

'~ ':

"

\'""' rf!HIW'

. ~llilti"""!

1, :•:

...U!

/II ....sc..-tao\ I~

.-f ,.,._ r~ ~-.:..,. .

""11111t'rt•~t-

,.lh•

"'•wd.rtlr.., ,.._. ~- ...,._, .....

.

u.

~t

...:•:'" ...

""D

">Ct\• ....,. ''It\~' o(fl'Oilt• • ' v.l""-l'

tt:

•it~• l ~tl~ t >owt t!lie

hie

),.):

~......

21•

,,; ,..

( !tt·t•, d·,,..

("'-l•r..., • l ttw),



(...,_,.•tooy • l tn.it)j

..

tu-,"f_Jvs-., (1Jr-~•



..'1•.- ,,...

(lt;'"' '~t.,.

i_.U «•( 9'f000l ~tl•l.Uc ,...,.. Wtl"OU l!ICt'C

...,

..

" ,....... _......

-

I



_________________





.......

,~---

" '.

~°'····

>

...... ........

Figure 62 - Debug Layout

I

••.O.t

,...

.,...

' • •,. .. 1

105

106

PowerShell Studio - A Comprehensive Guide

-- --

... ..

Cl f)·t.i·• O ..,n.

..., '-• .. r_.,, ·,..._ r..._ ., r a... ., "' ..... ~ ·!, .......... ..,, ... ~ "' ...... ~ ... o .

.....,....

;:::; .... ....._:...~

~

=....,.... .,. .".... .,

-

= ,...,_

Ii:

~.;;..I Q..~

il ·--.r-

"'"

-.."'"''""

... .

c-L

..

., ": ,........,.._ i.~·~

,,..

.;



••'

.ot'I( •

•. 1•

...

~-

11

& ~J-C1"-S.:.t:1crl

cf

t-'lt

•J!llC

,.f , ....

,,



.--



'"'

i...



..:..I' •

1 1. ,_ ,_ t•lt--



-

1•

~lt~ ~r~t.L•"

"'

JI

-

,...,._, ..,

..a...t. t.h# JI.kl,

;! t • "

"

.........

d - .. (............,.. ,,,_,J (•1 'f!fJf;"'"'" '· ,,. ...,.. • lt.... )

:..i J• \

(~to!')'

" itrl1'l'- • f ,..., C...,...t ..r-

••

''-·-~·( a'TOOO· t.,.it.U U.U

ti M

.... •

..... C...t,..1' kf"'C

"

,~.. ..,

0

,__,.If. 1"""'1-

1:

"'

11'1J{W

....... f.....- . . _-....... ·~ ,,,.. -

x

If

• • · "

•'

l

..'.

-

v

111..-1,

J ..J ~ ·



A

., y

•\lw

, __ .

............... :m ... (....

~

,,..

. ....

,,. l

"

·. -· .

L .l

......

..

"'••

.,,_

"'

•,,

...

.>:I

=

...J

Figure 63 - Designer Layout C C·lrl·• O ..,no -

~

.........

~

t~

"'1:

W.F• trfr:)f

E ~'•,....

.n1""~'-.

..; :E ~ ., ai ..... ·~

~~...,o..,.,

·!r~

W ...

~

)ct..c

v o .....

~

...... ,....,.

.~

,, ..,,....

'.:. G.-1 )(.....;

....."'",

.._ v

~OoJt.•t"-•

·-

.., 61~ ·

:J t•-..... ..; ....u.,.,.

...... e • •



' '

,\,,(llP) I~

".,..-t...,. r.itt,,.,. , ,...,,

••

.,.t.UIUTt, Kac I. 4tter1-~

,.

" i:

·""""""Cl ~~, 4 fttoCrt1Kt0"1 fl( t."•

l. &l I•

,, ,.•• ",. ,. ..

.,,.._

~ . . . . . . . . . ,.

._

a

P'

0..1'. .Uf'

C~tr

N'Vt«•r

II-..

c \>

..,._ •v.1-i•

.,~,.

'ti1•1_.1·

..

1VUI

\

J1'....,!'"~•·Q"•l'l('J!tot)'

" • Stn.t-))

..

.

tt-"1-"tl Pl..u.

r·. .....,.......

ltJD ..1,.,.:

NUW

IJ'T4

lN lJ C. l

;"">)

)

Figure 64 - Editor Layout

If none of the predefined layouts work for you, then you can also create and save your own custo1n layout that fits your own needs.

PowerShell Studio - Basic Orientation

I

107

2.3 PANES There are 16 different panes available inPowerShell Studio 2016.

-~

Call Stack Console

2.3.1

Call Stack Pane

1"11Find Results

The Call Stack pane sho\.vs you the execution path through your script to the current breakpoint when debugging. Each line, except the first, represents a point where your script called a fi1nction. The first line is the location of tl1e current breakpoint. Double clicking on a line in this windo"v will take you to that distinct line in the code editor.

~

2.3.2 Console Pane

~

Debug

[iJ

Debug Console

Function Explorer

fQ

Help

~ []

Object Browser

~

Performance

Output

~

Project

~l

Snippets

~

Toolbox

[I! Property



Variables

The console pane is an instance of Po,verShell hosted in the PowerShell Studio IDE. There is a platfonn selector at the top which allows you to switch between 32-bit and 64-bit PowerShell instances. One tiring to keep in inind is that you do not type conunands on the coffilnand line as you inight be accusto1ned, you type the1n in the Input Box and press enter, this sends the co1ruru1nd to the shell. If you like you can also disable the input box in the Console Tab of the Po\.verShell Studio Options. Right clicking i.J.1 the Console window will display a context inenu containing the following options:

11coosoi.

c "

!,,,....--,:~~------------------.

&) Watch

Copy Copy highlighted text to the clipboard. Paste Copy the contents of the clipboard into the console. Restart Shell Restart the shell. This will erase all work done in tl1e current shell.

2.3.3 Debug Pane

Figure 65 - Console

The Debug output pane shows you messages written to the debug strea1n - by Write-Debug, for exan1ple. It also records messages created by tracepoints in your code.

108

I PowerShell St udio -A Comprehensive Guide

fill Output

o x

>>Debugging (MainForm.psf) Script ... >> Platform: VS 32Bit (STA) (Forced) ERROR: Exception calling "Save" \'iith "l" argument(s): "Access to the path 'C: \ path.xml' is denied." Mainform.psf (1173, 4): ERROR: At line: 1173 char: 4 ERROR: + $PathFile .Save($Path) ERROR: + Categoryinfo NotSpecified: (:) [], MethodinvocationException ERROR: + FullyQualifiedErrorid : DotNet/'\ethodException ERROR: ERROR: Get-Content : Cannot find path 'F: \ SAPIEN\ PowerShell Studio 2014\Projects \ 452CS Status Display\ Mainform.psf (1188, 22): ERROR: At Line: 1188 char: 22 ERROR: + $ConfigFile = [xml)(Get-Content $CnfgFile) ERROR: + ERROR: + Categoryinfo ObjectNotFound: (F:\SAPIEN\Power ... us Display\ none:String) [Get-C ERROR: + FullyQualifiedErrorid PathNotFound,Microsoft.PowerShell.Con:mands.GetContentCommand ERROR: ERROR: Exception setting "Interval": "Value '0' is not a valid value for Interval. Interval must be gr ERROR: Parameter name: Interval" Mainform.psf (1191, 2): ERROR: At Line : 1191 char: 2 ERROR: + $timerl.Interval = $ConfigFile.Settings.Display.timer


> $sOS

SystemDirectory Organization BuildNumber RegisteredUser SerialNumber Version

C: \Wil~DOHS \sy stem32 Hewlett-Packard Company 14393 1

10.0.14393

-

~ ~~ Ii] Debug Console

I ":!. Stack

~ \~atdi

ii Variables

Figure 66 - Debug Console In the example, you can see that we set a breakpoint at line 27, we can then query the contents of the variable $sOS within the debug console to ensure that the contents are as expected. This is a great tool for debugging your script commands and functions.

Debugging

I PowerShell Studio -

110

A Comprehensive Guide

2.3.5 Find Results Pane When you do a search within Po,;verShell Stl1dio, whether it be a "find in files" or a " find all references", the results will be displayed in the Find Results Pane.

Mi Rnd Results

CJ x

C: \ Users\ Jeff\ Documents\ SAPIEN\ PO\ierShell Studio\ Files\ test.psf (22, 2) : $forml_Load={ Total References: 1

II Console

..... Debug

IJli Find Results

G Help

[g Output

~ Performance

Figure 67 - Find Results

This is an example of a "Find All References" search for the tenn $fornzl _load- { within a test script, as you can see there is only one results, if there were more tha n one $fonn_load statements then we would have a proble1n.

Mi Find Results

CJ x

C: \ Users\ Jeff\ Documents\ SAPIEN\ PO\ier Shell Studio\ Files\ test . psf (22, 2): $forml_Load={ Total References: 1

I

I!~

Copy Copy HTML

IJli llJ Console

..... Debug

IJli And Resul

Ctrl + C Ctrl + Shift+ C

Find ...

Ctrl + F

Select All

Ctrl +A

Clear

Ctrl + E

Marie as Visited Cancel Find m Files

Right-click within the Find Results pane to display the sub1nenu; Copy, Copy HTML, Find (finds with the find results ... nifty huh!), Select All, Clear, and Mark as Visited.

PowerShell Studio - Basic Orientation

I

111

2.3.6 Function Explorer Pane The function eArplorer "vill display will display all functions and events within the current script. This a very useful tool for fiI1diI1g a specific function within particularly large scripts. If you work with scripts in the thousands of lines of code, this can save you countless hours.

G FunctJons

0

x

p

G Update~og G Update-t.og G Update-t.og G Update-t.og G Upda~og G Update-t.og

The right-click menu contains tl1e follo"v features:

G Update-t.og

G Update-t.og

G Update-t.og

G Update-t.og G Update-t.og G Update-t.og G Update-t.og

Go to Declarat ion

Find All Ref e.rences

G Update-t.og

Insert

G Update-t.og

Gene.rate Comment Based Help

G Update-t.og-Mearee G Update-t.og- [·NoEnumerate) [] Detailed Description The Wme-Oulput crndlel sends the specified ob1ect down the popel1ne to the next command ~the command 1s the last command in lhe ppeline, lhe object is displayed on the console Wnte-OUlput sends objecls down lhe primary popehne. also known as the •output stream· or the "success pipehne · To send error objects down the em>r pipeline, use Write-Error This cmdlel Is typocally used in scripts to display strings and other ObJ8CtS on the console Howeo.-er. because the default beha'llor 1s to d1Splay the objects at the end of a pipehne. it is generally not necessary to use the cmdlel For example. •get· ptocess I wnte.output" 1s equMllent to "get·ptocess·.

Parameters 4nput0bject Specifies lhe obiects to send down the ptpelme. Enter a variable that contains the objects. or type a command or exptessoon lhat gets lhe objects Required true Posilion: 1 0eraul1 value: Accept pipeline input true (6yValue) ~cept wildcard characters· false

If PowerShell Studio is configured to use external help, the help will be displayed m the SAPIEN Docu1nent Explorer.

PowerShell Studio - Basic Orientation To ensure that help items will show up in the Help Pane, you must configure two options as follo"vs:

c=>

1. Options

Editor •

> Sho\v cmdlet help while typing

Ecitor Settings ~ Enable autcmabc syntax dle S9l wilh the tirst avaiable code signing c~bficate)

Ecitor PFX C~bficate:

Password:

~==================~ http://llf'OeStamp.olobalsqi.eotn/saf)tsfr:ms~.cl

ExterNI SiQnno Tool: (IJsng an external tool Ml ovemde al other settings. Speofy %Fie% fur the S0'1>t to sign.)

Panels

J

0

Automaticaly 59'1 .ps 1 saots when saVf'9

PowerShel

l

Source Con1rol

Figure 71 - Document Explorer Help

[]

I

113

114

I PowerShell Studio -

A Comprehensive Guide

2.3.8 Object Browser Pane

tJi1 Object Browser ---~ [ Ci1

o x

lia-___..._ii___.____

I E""'te" t--n ro S'":c ,..,

._ SJ About ToPJCS .., C!J Core Cmdlets

e

The object browser contains all the follo"ving panes: PowerShell Bro,vser - for exploring Po,;verShell objects including c1ndlets, aliases, 1nodules, functions and help files.

I

P "

iJll

.NET Object Bro,vser - displays the .Net assemblies available on

your co1nputer. Each asse1nbly can be opened to reveal the na1nespaces and types contained within. Individual types can be opened to reveal their contents - properties, methods etc.

Ofo

L!]? Bae

[lQl

C!J Add-Computer C!J Add-Content C!J Add+listory C!J Add-Member C!J Add~SSnapin C!J Add-Type B asnp

WMI Browser - displays namespaces and objects from the WMI database on your computer. As you click on nodes in this panel, PowerShell Studio will display information and code examples about the node in the Help pane.

ii

Database Bro,vser - allows you to explore databases and generate code to read and display data. Before you can use the Database Browser you need to create a database connection. Po"verShell Studio supports the follovving connections; Access, SQL Server, MySQL, ODBC, OLEDB, Oracle, Oracle Native, PostgreSQL, and Sybase.

e

cat 0cd

SCFS

B

e

chdir

••

Click on the "Create new database connection" icon. Once you have configured your co1mection, pressing Save will add a new node to the database browser. Clicking on the node will enumerate the contents of the database and allow you to tunnel into the tables, views, stored procedures, etc.

Ched

Gener4tc Query Form.

Gtnerate QuC'f)' P~-ttSn

Generate Query PowerShell Scri11t: Creates a PowerShell script that uses ADO.Net to retrieve all records from the database ai1d

S> Running (test.psf ) Script ... >> Building ( test . psf) ... >> Platform: VS 32Bit (STA) ( Forced) >> Execution ti.Ire : 00 : 00 : 05 >> Script Ended

["~

Copy HTML

Mi

II Console

..... Debug

Copy

MJ Find Results

Ctrl + C Ctrl + Shift + C

Find ...

Ctrl + F

Select All

Ctrl +A

Clear

Ctrl + E

@ Help

[]Output

Figure 72 - Output Pane

~Performance

I PowerShell St udio -A Comprehensive Guide

116

Right-Click Menu consists of: •

Copy (Ctrl+C) Copy highlighted text to the clipboard. Copy HTML (Ctrl+Shift+C) Copied highlight code, including color coding and formatting. Find (Ctrl+F) Search the text in the output vvindow. Select All (Ctr l+A) Select all the text in the output \vindow. Clear (Ctrl+E) A. B Clear the output vvindow. ~~=+-

• • • •

2.3.10 Performance Pane ~ Performance

0.9

0.9

0.8

0.8

0.7

0.7

jg 0.6

0.6

Q)

Ol

cQ)

L.

Q)

:J 0.4 0....

u

0.5 -< '

r

~

0.4

0.3

0.3

0.2

0.2

0.1

,.... CPU

1

3: 3

Atlpearance - this control the overall general appearance of the form such as; background color or image, font and color, border style, etc.

False

EnablePreventForusC ContextMeruS (none)

v

Form Properties: the screenshot to the left is an exa1nple of the properties pane for a form object. Form properties contain the follovving sections:

Property panes can vary depending on the control or object selected, some may have less properties than others. In our chapter on Controls we discuss in depth each of the properties for every control object. The properties of objects can also be ma1upulated fro1n within your script, which allo\VS you to provide interactions witllin your GUI when executing, i.e. tunling on/off controls, changing text, 1nanipulating displayed data, and much more.

O, O

Text

The text associated with the control.

You can right-click on any property to getMSDN online help about that option, or you can press F 1 after selecting the property .

120

I PowerShell St udio -A Comprehensive Guide

Y Properties

I:g

J1.

sforml: Systern.\~fndows.For... ...,,

~~ l J:jl ~ ~ v

Accessibitity

----

AccessibleDe AccessibleRo Defalit Appearance

D Badcgroundli D Bad

AccessbleNa v

x

So1ne controls support all alternative way to 1nodify control properties called smart tags. These appear as a s1nall icon, on the top right of a control, when it is selected in the 0 fonns designer.

False

Behavior

0 C

Enabled ImeMode

MSDN HeJp Reset True NoControl

Clicking on the s1nart tag will display options specific to the control, and it vvill present all alternative task oriented ' vay of modifying control properties.

0

~

ComboBox Tasks

0

~

Use Data Bound Items

Unbound

Mod~

-,... .. ...s.~

The left two buttons allow you to switch behveen viewing properties grouped into functional groups or simply listed alphabetically.

The right hvo buttons This pair of buttons allows you to switch between looking at the properties an object supports or the events it can trigger.

PowerShell Studio - Basic Orientation

I

121

2.3.13 Snippets Pane ~ Snippets

~

rii

0

x

~

Enter te>·t to search...

P

~~~~~~~~--~

-

I\

User

Preset

.4 -

• -

ADS!

• -

dasses

-

If you are not fainiliar with snippets, these are small pieces of reusable code that can be easily inserted into scripts, snippets can be full functions or simple one line staten1ents. The snippets pane contains various snippets that can be used within your scripts to complete many comn1on tasks. The default snippets are contained in the %ProgranlData% \SAPIEMP0111erShell Studio 2016\Snippets\ folder. You can also add an extra folder of your own to the snippet browser by specifying the folder path on the Panels tab of the Options dialog. This folder is always called 'custo1n' in the snippet browser.

• -

Database

k"



Escapes

"""

.4 -

Fies ~ Readlilesfromfife ~ ReadNamesfromfile

.4 -

Form Functions

~ OnApphcationExit ~ OnAppbcabonload • -

-

Opens the currently selected snippet folder in Windo\vs Explorer.

~

Launches the snippet editor to allow creating your O\ivn s11ippet. It is also possible to edit or delete an existing snippet using the right-click menu.

Packager Funcbons

• -

Parameter Vahdabon



Pester

.4 -

Tlus will re-scan the snippet folder and refresh the s11ippet pane.

Utihties

~ Logfile ~ TestPing ~ Trace\Aflfldow • -

Va dabon

• -

VBScript to PowerShel

lf•••·················· ········ ···••H•OO•" ••••o0o•0o•OO•·•H·•Oo•oo•o••••••••••0..

..••·••••••.. ••·•••••••••................................. ... .... ,,,,,.. ...... ........................ .......... ........ .... ................ ........... ............,,,,,,,.• ,... ... ..... .................... ..................... ...... ............. ............ ........... ........... .... ... ... ............ ..

0000••>•o•oo••·········· ···· ··· ··· ··· ···· ···· ······ ···· ·· ·······•00000~000 000 00•o o•• ••• •owuShel ut sn pp et Snippet Editor ;:; Flit :·:

Edit

Vltw

He,lp

Ci t .

ll llli' 8 .j:[•. D ~ \larlablu :·:tion:

:==============================~ ~ff

Author: ~U:U.:

Language:

Power _ Shel _ _ ___,v

.__I

I

Type:

1

References :-:·:-:-:-:-;:-:-:-:-:-:-:-:·:·:·:{-:·:·:·:·:·:·:·:·:·:·:·:·:·:·:1.·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:-:-:-:-:-c:-:-:-:·:·:·:-:-:-:-:-:-:-:-:-:-:-:-:-:-:·:·:·:·:·:·:·:·:·:-:-:-:-:-:-:-:·:·: .... q. x

+ URL

~

Rdertnces Output Variable Details

Imports

Rtady

tlUM

. ,;

Figure 74 - Snippet Editor

Title: the name of your snippet. Shortcut: the text that when typed in the code editor will invoke the snippet. Description: a short description of "vhat the snippet does. Author: your details. Help URL: If you have help infonnation available for the snippet provide the link here. Language: this must be set to "PowerShell" if you want to use the snippet in PowerShell Studio. Type: this defines the intended use of the snippet, as \.Vell as \vhere PowerShell Studio will display the snippet. v

Expansion

SUrrounds With Both

There are three tv pes selections:

Expansion - use if your snippet is intended to simply be inserted into code. Surrounds With - use if your snippet is intended to surround existing code. Both - use if your snippet can be used for either Expansion or Surround.

If you choose Surrounds with or Both, you must include the placeholder $selected$ so1newhere in your snippet code body, othervvise you may ovenvrite user code vvhen your snippet is used .

PowerShell Studio - Basic Orientation mg\SAPIEN\User Snippets Po erShel test sn ppet • - Sn ppet Editor

m File

Edit

View

1;1 D ~Ill

.·.

Variables

-

::J

I 123

x

Help

Jb ~ I! el T . ...

q. x

.----------------------------Title:

Dowhlle

Shortcut:

DoWhile

Descrt>tion:

Create a Do ~ loop

lwthor:

YOIX Name

Variables

~LRL:

language:

I.....Po_v._erShel ·_ _ _ _ I ___.v

Type:

Both

ldo { 2 SselededS

3I 4 Sends 5 ) w!'llle (Scoodi>onS)

Ret ere n ces :·:-:·:-:-:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·=·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:-:·:·:-:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:-:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:-:·:·:·:·:·:-:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:·:-: .... q. x

+URL

Assembly

References

Output

variable Details

Imports

Figure 75 - Example of Type (Both)

References: This section helps Po\verShell Studio to understa11d any dependencies that your snippet has. The assemblies you list here will be loaded into PowerShell Studio when you use the snippet. Imports: This section is not used for Po\verShell snippets. Variable Details: This section is used to configure placeholder variables used in a snippet. Placeholder variables are added to a snippet when you-right click on the snippet code editor and choose Add Variable. Once you have given the variable naine it will appear in the snippet as $$ (e.g. $co1nputerName$) and you can configure the variable properties. •

• •

ID

The variable's na1ne. Default A default value if required. Function Not used in PowerShell snippets.

124

I PowerShell Studio -A Comprehensive Guide •



• •

Tytle

Not used in PowerShell snippets. Kind Not used in PowerShell snippets. Editable Not used in PowerShell snippets. ToolTip Provides some text eA.'Plaining the purpose of the variable. This helps the snippet user understand how to complete the snippet. PowerShell Sh1dio will display these tooltips as the user navigates bet,veen the placeholders in the PowerShell Studio code editor.

Two built in variables are provided:



$selected$ Allo\.vs you to 1nerge code from the code editor into your snippet when it is used.



$end$ Specifies where the cursor should be placed when a snippet is inserted into the code editor.

--

PowerShell Studio - Basic Orientation

125

2.3.14 Toolbox Pane r CCToolbox .- c ·:

-

' x p

The toolbox pane is one of the most used panes when using the form designer, this is where all the control objects are located that you will use to create functioning GUI forms .

~

@Sutton

Iii 0

Chart Oledlaylllhe-\Jl>daleaon •-.««. ec-p1•t.d Job Stat-va

Lc-.c..

McNee

,..

Sile Code

2.0e.irw..,lludc~onlhe~lhean'O!t

n.... l • >

0

oz

Unjn313Mnsta8 SCCM Clienl Thishn:uon ... _ . . , _ l h e SCCJI den 1 AeancoPodloallylOlhe_e_llion. 3

M

~ Delete &t..-ee.tlcaeo Hot>Oool< Tooll ~ V... Tooll

Ent4r COllllJIUt.er

4 The repootayla..tlul• .-.d VII!! ~lapedooned

SCCM Cfien1 Beoair Tholool"'1-lhe SCCM0...10 pofomi • . _ n- aa 7......,.........., onlhe "'1'W1 a.t..-..Y"'ll>e--.lhl ISIO-lhe talie ,_,,_.,..., St.aw.

l'J MoboTooll

[•~SCCMO...

Han!lr'llSCCMTaolc~can-ll•C>oeo*".a-110""'ll-SCCMl.ll>dltea0tWSUS This1ool ... doar"'f laoi< _,.,,.,..lhll moyhoYelaledlatone,_ at onolhet. ~- SCCM _,.,

cllance IO.....,. l>U!l"'!I \Jl>dales

Java Tooll

BenewSCCM Ce!l!fica!e Tho !ool ,........,., an frwllldceolic:Memlhe _ _.,_a,_ """'1cMebe muodbylhe Sile S..-. In ""'*lc:ert6c:id,....

®

0 ........ 111... -

oa - ~. """" :,

:

- ""''*"'On U-l Q ..

w--.. u ..- , _,..

Oofo.A ·6mn

°"' :l t""' r..,

0 1o1.o~...........,

hlt-.IMt.x~~?

® y., . Sidt

:s-

._@ s30_ __,

·~t~

. . . . ..

............

~-----~

i*'ltUMl'·IOdtao.~toM;Q't

,



® NoclyustrkCOft:Sl'.att.._ 15~ How

AutoScroUMargin - [Width/Height] determines the 1nargin around a control during auto scroll. This is set in pixels. AutoScroUMinSize - [Width/Height] detennines the Ininim1un logical size for the auto scroll region. Tllis is set in pixels. AutoSize - [True/False] determines if a control will automatically size itself to fit its contents. For example, using a button control, in tllis case "buttonl" and tl1e button text is changed "vitlrin the script code results would be as f ollo\vs:

$buttonl .Text = 'The button will auto size to fit ' 115' My Form

0

I The button v.ill auto size to fit I AutoSize is True

x

fl9

0

MyForm

x

I The button l AutoSize is False

AutoSizemocle - [GrowOnly/Grow And Shrink] deten1lines is a control can only grow to fit its contents or if it can also shrink to fit its contents. AutoSize nzust be set to "True "

47

https://msdn.m icrosoft .com/ en-us/library/system .windows.forms.conta inercontrol.autoscalemode (v=vs. 110) .aspx

158

I PowerShell Studio -

A Comprehensive Guide

In this example, \!Ve have a button control, buttonl, \!Vith default text of "My First Button", within the script code we change the button text to "Button". 4i

I

$buttonf·tyFirstButton . Text = 'Button'

You can see that with GrowOnly the button stays relatively the sa1ne size when we reduce the size of its contents, ho"vever, with GrowAndShrink the button size \vill also shrink when the contents are reduced.

'QIJ lv1y Form

I

Button

0

x

0

x

I GrowOnly

'00 My Form

I Button I GrowAnd Sh rink

Location - [X,Y] this is the X,Y coordinates of the control relative to the upper-left of the container. (X) is the distance fro1n the left border of the display area and second nu1nber (Y) is the distance from the upper border of the display area. For this property to have any effect on a form, you must also set the "StartPosition" property of the form to Manual. MaximumSize - [Width/Height] determines the maxiinu1n size the form can be resized to. You 1nust be using a FonnBorderStyle that allows resizing, such as "Sizable" and "SizableToolWindow", or this will have no effect on the form. MinimumSize - [Width/Height] determines the minimum that a form can be resized to. The same requirements for FonnBorderStyle that applied to MaximumSize also apply to this property. Padding - detennines the INTERIOR spacing within a control; left, right, top, bottom. If all sides will be the same, then you only need to specify the padding value in the "ALL" property . Do not confuse this \Vith space around outside of the control. In the example on the right, the dark gray area is a large button, the padding is for the interior text nanie of the button, not exterior of the button. Size - [Width/Height] determines the size of the control in pixels. You could also use a script command to automatically

~

My Form

0

My First Button

x

PowerShell Studio - Form Design and Projects

I 159

inake the control the saine size as a background image with the followiI1g: Fonn.Size = Fonn.Backgroundlmage. Size; StartPosition - detemlines the starting position of the fonn when it first appears after execution~ there are five positions ~ Manual, CenterScreen, WindowsDefaultLocation, WindowsDefaultBounds, and CenterParent

CenterParent

The form is centered \vithin the bounds of its parent form.

CenterScreen

The form is centered on the current display, and 11as the dimensions specified in the form's size.

Manual

The position of the form is determined by the Location property.

Win clo,vsDefaultBounds

The fom1 is positioned at the Windo\VS default location and has the bounds detennined by Windo,vs default.

Winclo,vsDefaultLocation

The form is positioned at the Windows default location and has the dimensions specified in the fonn's size.

Winclo,vState - [Normal/Minimized/Maximized] determines the initial visual state of the fonn upon execution.

3.3.8 Misc AcceotButton - by selecting a button control on your form, if a user hits tl1e ••enter" key on the board it will react as if the selected button \¥as "clicked". CancelButton - by selecting a button control on your form, if a user hits the "esc" key 011 the board it \Vill react as if the selected button was "clicked''. 48

KeyPreview - [Tn1e/False] detennines \Vhether keyboard events for controls on the fonn are registered vvith the form. This property was inherited from back in the Visual Basic 6 days \Vhen you needed Key Preview to implement short-but keys, however th.is isn't needed anymore in Windows Fonns. The whole point of Key Preview is to allo\.v tl1e UI to respond to a sho1tcut keystroke. Normally keyboard messages are sent to the control that has focus. Setting tltis to True doesn't cause any proble1ns, if the fonn's Key Down event will n1n, however it doesn't have any affect if tl1ere is no code associated \Vith it.

3.3. 9 Window Style ControlBox - [Tn1e/False] deter1nines if the form has a Control/system inenu box, this consists of the Minimize, maxi1nize, and Close buttons, as well as the fonn icon.

48

https://msdn.microsoft.com/en-us/library/system.windows.forms.form.keypreview{v=vs. l l 0) .aspx

160

I PowerShell Studio -

A Comprehensive Guide

HelnButton - [True/False] detennines \Vhether the form has a Help button on the caption bar. Both MaxilnizeBox and MinimizeBox properties inust both be set to "FALSE" for this to work properly . This \Vilt display a s1nall (?) mark button to the left of the (X) close button in the caption bar.

9 - $forrrif-tyform_He lpReque s ted= [System. t-JindO\'IS . Forms . He lpEventHand le r] { 10 #Event Argument: $_ = [System. Windows. Forms. HelpEventArgs] 11 #TOOO: Place custom script here 12 13

}

You can use a HelpRequested event handler like the one above to executes specific code if the (?) Help button is clicked.

YProperties

JJ

x

w sformMyForm: System.Windows.F.•• ~ I~ '.El ( J ~

""'------

Mou~apnre




x

QueryAcces:sib

IsMidContainer - [True/False] determines if the fonn is a MDI container. A multiple document interface (MDI) is a GUI in which multiple \Vindows reside under a single parent \Vindow. This allo,vs you to create an application that maintains n1ultiple fonns \Vitlrin a single container form. Some exa1nples of MDI are Microsoft Excel and Microsoft Word. In the example belo\v I have created a si1nple form (Test_MDIFom1.psf) \Vith an object name of (fonnl). IsMidContainer is set to True, and a MenuStrip (1nenustripl) has been added, \:vith a menu ite1n of (Forms) and a child item of (Child Form). 11...J

Form

Forms Child Form

Event code ($childToolStripMenuiten1) was generated for the child menu item (Child Fonn) by double-clicking on the menu ite1n within the desig11er.

PowerShell Stu dio - Form Design a nd Projec ts 71? $childToolStripMenuitem_Click={ 8~ $child = NeH-Object System. Hindows.Forms.Form 9~ $child .MOIPar ent = $forml 10; $child . Text='Child Form' 11 ~ $child . Show() 12 ~

}

As you can see I have added in four different lines of code: ../ ../ ../ ../

Line 1 Line 2 Line 3 Line 4 -

generates a new windows fom1 . designates t11e parent of the child fonn . gives the form a name . shows the fonn. The results are shovvn below, a child fonn is novv sho\.vn within a parent form: 09 Form 0 x Forms

-- aSJ Child Form

--

§300~

----

! I

I

I

In this example, there are two child forms, one is open and the other is 1ninimized within the parent fonn.

a9

0

Form

Forms

rl:

Child Form

x

I

161

162

I PowerShell Studio -

A Comprehensive Guide

Even though several years ago, MDI was all the rage and every developer vvas using it, Tabs are the preferred inethod today. There are still some specific uses for MDI so it has been included here to demoinstrate that you can build the1n with Po,verShell Studio.

SAPIEN Lead Developer - David Corrales PowerShell Studio doesn't support MDI because it doesn't work well in PowerShell due to the nature of the code. This doesn't mean it can't be done, but it will require manual coding. You can use another psf to design the chi ld form, but you must modify the exported code because it generates a function that returns the form's DialogResult, which will not work for MDI. Therefore, you would have to modify the code by: 1. 2. 3.

Making sure the form variables do not go out of scope. Use script scope and make sure you don't use the same names across forms. Change the Form's ShowDialog() method call to Show() Pass the MDI parent to script so you can assign it to the form.

Interesting enough, you can also use this method to display multiple forms at the same time (non-modally). The obvious downside is that after making changes to the GUI in the designer, you must repeat the steps above. The manual manipulate is the reason we don't encourage people to go this route.

MainMenuStrip - if you have added a 1nenustrip control to your fonn it will be selectable. This specifies which menustrip will be the primary for the form. This used for keyboard activation and automatic 1nerging in MDI. MaximizeBox - [True/False] determines if a Maximize control is presented on the form caption bar. MinimizeBox - [True/False] determines if a Mini1nize control is presented on the form caption bar. Opacitv - [Oo/o-100%] determine the transparency (opacity) of the fonn. Sho'v Icon - determines if an icon is displayed in the far-left of the title bar. ShowlnTaskbar - [True/False] detennines if the form "\vhen executing will appear in the Windo,vs Taskbar. SizeGripStyle - [Auto/Sho,v/Hide] determines if the sizing grip will show on the form. TopMost - [True/False] if set to True the form will always be displayed above other windows that do not have this property set. Normally this is set to False to avoid user frustration.

PowerShell Studio - Form Design a nd Projec ts

I 163

TransnarencyKev- sets the color that will appear as transparent when painted onto the fonn. Default is white.

3.4 CREATING A NEW EMPTY FORM In this section, we will walk through the process of creating your first fonn, configuring fonn properties, adding controls, events and script code to 1nake a functional fonn. Jfyou have already installed PowerShell Studio you can perform these steps as we go. First create a new empty fonn.

,. -b3

D

Nl'W

~

Open Open Project Save

~.

Save As

Ed

Save All

®

Create Template...

g

Create File Group.•.

@ -.±:-

Print

~

~ @j

New PowerShell Script Creares a new PO\\erShel Scr1lt (.psl). New Form Cr~tes a new GUJ

ra ra ra ra ra

based SCJ'1)t (.psf).

New Project Pro)«!S ate~ to "'Orie v"tn rrlibilie !>es. New Form ProJect Creares a new GUI based pro)«t. New Module Project Creates a new PowerShel saipt mocUe pro)Kt. New Module From Functions Creates a SO'lPI mocUe by seleell>O fi..ncbons from e>OS!JlQ SCJ'1)ts. New Module From Help File Cr~tes a S0'1Pt mocUe by denvng

fi..ncbons from a Powe-Shel help fie.

Oose Close Pr0Ject OpllOnS

x Eiat

Figure 90 - New Form After selecting "New Form" you will be presented with the fo r1n selection dialog x

Select a Form Template

Preview:

Templates: rt"'" \.-

~

)(

:0

(I

Empty form Creates an Errc>ty Fonn

ifo 1

Dialog Style Template Creates a fixed border f'orm that has no minmze 0< maxm.ze buttons

Explorer Style Template Creates an Explorer style layout with a Tree and List Control Full Grid Search Template

ifo J to

I~

Creates a form with search capabities and a gnd that fils the wndow

;liQil

~t: s~.Wrrdows.Fotta.F... v

et ' Id


j;l-.

O eon•a1

-.....-o v-1

CGn~~lrlP

,Po.-

Sedcg'our'id:lfta Tk Onor \V•IOnor

,,_J O.lOG

f'altc

'1t.110Vlicltll:

~roa..c

-

id3 FOtlOaloo 1" -

Coo

Poollion

--------------------------~· y ~ope~

i

El

·~! 1 1 1 v

Cheddlox

v

~Tl
ftont for.colo!

Convo!T'ocroo>oft sans Serif, l!fil Maosoft Sans •

Sue

8.25

Bold

FoiSe:

GciOlal'~I

1 GGVerbcall False

Italic

Faioc

S!nkl!OUt

F~

~False

For~ • Conlrorrext Forrri!orderStyl Sizable Rlghtroleft No

- '·- . ""

-.

v

Bad" GU!baw«r$hell 5.'J)lore the different types of scopes as related to PovverShell and how scopes are used to isolate a script's modifications. When we are talkil1g about Po,verShell, a ''scope" refers to the current environment in which a script or command shell is n1nning. Scopes can be used to protect certain objects from being unintentionally modified by scripts or other functions, unless explicitly told to do so. The follo\ving are protected frorn modification by cornmands run from another scope: • Variables • Aliases • Functions • PSDrives Ne\v scopes are created \vben a script is executed or ' :vhen a ne\.v sessio11 or instance of PovverShell is created. There are some scopes that have a special meaning: • Global Scope - is the scope created when PowerShell starts, and includes variables, aliases, functions, and PSDrives that are built into PowerShell as \Veil as ones made by your PowerSbell profile. • Local Scope - refers to whatever the current scope is. When PowerShell is started, it refers to the Global scope, when you execute a script it refers to the Script Scope internal to the nUUling script. • ScriJlt ScOJle - created \vhen a script runs. Tl1e only conuna11ds that operate \Vithin this scope are those conunands within the script. • Private Scopes - can be defined within the current scope to prevent con1111ands in other scopes from being able to read or modify items you do not want thern to have access to. As vve mentioned, co111lllai1ds executed within one scope does not affect items in a11other scope unless we specifically tell them to do so. As an example, if \¥e create a variable named $ThisVar in the Global Scope and a script executes which nms a co1nmand to change the value of $ThisVar. A copy of $ThisVar ' vill be created in the Script Scope and the value altered. If I checked the value of $ThisVar fron1 within the script, it vvould appear that the value had been changed, hovvever once the script bas ended and you check the value in $This Var you \Vill notice tbat the value is the same. Why is that? Because remember within a script you are using the Script Scope, and a Global Scope variable \.Vill not be affected frorn a script corrnnand UNLESS you explicitly request it. To cha11ge a Global Scope variable fro111 witllin the .Local Scope (remember ,;vhen a sc1ipt is executing the Local Scope refers to the Script Scope), you only need to add the scope name at the start of the variable name, and put a colon betvveen the scope and variable na1ne. $global:ThisVar $script:Th is Var $1ocal:ThisVar

This comruand within a script would change the Global Scope variable $ThisVarvalue: l

$global:ThisVar

='Changed the global scope variable value'

PowerShell Stu dio - Form Design a nd Projec ts

I

171

It is very colTilnon for a parent form to collect data fro1n a child form, and PowerShell Studio handles this remarkably well. For exa1nple, a main fonn opens a child fonn where a user inputs data into a text box and clicks OK on the child form, which closes the clrild fonn and control is returned to the parent fonn. But you need the data that the user entered (text property value) of the Text Box. When you add the reference function for the child form (Call-ChildForm_psf) to the MainForm.psf script, PowerShell Studio will automatically 1nake the values of the control properties of the child form available to the inainfonn. You can create a script-scoped variable in a child fonn, for exainple to create a script-scoped variable for the text in a Textbox, you can use something like: $script:ChildForm_Text = $textbox.text.trimO 49

June Blender of SAPIEN has written an excellent article on Multi-Form Projects which includes a great explanation ofScript-Scopes and Return Variables.

3.5.3 Collection Project Collection Projects were introduced with Po,verShell Studio 2014, and allowed you to create a new project to keep track of groups of files, including psl script files.

x Project Types:

lrr I !liJ

j

I

1

I

I I

Vi~

I rd

Collection Project Creates a project that alows you

to group files.

Empty Project Creates an empty project. Used

to create a script appkabon.

Form Project Creates a Sl'lgle form pro,Ject.

Used to create a 501>t appkabon.

Module Project Creates a PowerShel 501>t modUe.

Project Name:

My Colecbon

Locabon: ~Create Project Folder

I

Create

ICcanceJ ]

Figure 95 - Collection Projects

49 http:/ /info .sapien .com/index.php? option=com_c ontent & view=article &id=246 :how-do-multi-form-projects-

work&c atid=27 <emid=2656

172

I PowerShell Studio -

A Comprehensive Guide

There is no Startup.pss file generated with a Collection Project because each file is considered individual content and therefore tl1ere is no need for an entry point. Each file can be nm individually using the "Run" co1n1nand on the Ribbon Bar. New options were added to the Collecbon Project in oi-der to accommodate yotrr deployment needs by controlling the behavior of the Packager, MSI, and Deploy1nent as a whole or as individual files . Two new project properties were added: ~~epcrtcl

:O cro...-o off

C]l l g)

.

"De~

~-Pr-yHc ~



fl

,.

Scrjpt ~l

Hbc ~hr.le

.. OJC"'l .....

Groepof f!An ~::

OejloyAt Ol:lb to-dul\s,_-,t b- 6 lfe •Ni dtd WI

••u

De1Jlov As: This determines tl1e deploy1ne11t behavioi- of the Project as a \¥hole. There are two Deploy As options to choose fro111: (File) - Tells the project to handle each file individually when it comes to deploy1nent. Each project file will maintain its O\Vll independent settings. When to use: Use this setting when you are using the Collection Project to group individual files that don't i1ecessary interact with each other. Witl1 this setting you can package and deploy (pubbsh) eacl1 script independently.

d'>t ~

(Project) - Tells the project to handle the deployment of all the files. You inust define a primary file for the purposes of the Packager and MSI builder. When to use: Use this setting when you have a group of files that interact and have a start I entry point script. For exan1ple, if you have a priinary script that dot sources various secondary scripts. In this case, tJ1e pri1uary script \Viii get converted into an executable and you can create an installer that includes the primary packaged script and all the supporting files I scripts. The project files are also deployed (published) as a whole.

Primarv File: This property tells the project, wllich file is tl1e pri1nary file \vhen Deploy As is set to Project. The pri1nary file will be the file that is packaged into an executable. All other files will be considered external " Content". Previously the deployn1ent options were unavailable in the Collection Project t1nless you opened tl1e files independent of the project. These nevv deploy.ment settings no\v allow the Collection Project to fit your deployment needs.

3.5.4 Module Projects A script module is a file (.psn1l) that contains any valid Windows PowerShell code. Script developers and ad111inistrators can use this type of module to create 111odules whose members i11clude fm1ctions, va1iables, and more. At heart, a script 1nod11le is simply a Windows PowerShell script vvith a different eA.1ension, which allovvs administrators to use i1upo1t, export, and 1nanage1nent fm1ctions on it.

PowerShell Studio - Form Design and Projec ts

I

173

In PovverShell Studio you can also add a form (.psf) in the 1nodule vvhich is vvhy the final script has to be generated before it is included in the module' s script. A PovverShell Module consists offot1r components: ..;' ..;' ..;'

Code File (.psml) - either a script or 1nanaged cmdlet assembly . Support Files - additional files that the Code File might need like assemblies, help files, or scripts . Manifest (.psdl) - vvhich describes the Code File and Support Files, as well as store metadata such as

..;'

author and version. Manifests are not required for a 1nodule. Modules can reference script files (.psl ), sc1ipt module files (.psml), inanifest files (.psdl ), formatting and type files (.pslxnll), cmdlet and provider assemblies (.dll), resource files, Help files, localization files~ or any other type of file or resource that is bundled as part of the inodule. For an internationalized script, the module folder also contains a set of message catalog files. If you add a 1nanifest file to the module folder, you can reference tl1e mt1hiple files as a single unit by referencing the manifest. Directory - a location that contains all the above files in a location that Po\verS.hell can reasonably find.

None of t11ese co1nponents, by the1nselves, are actually necessary. For example, a module can teclmically be only a script stored in a .ps1nl ftle. You can also have a module that is nothing but a manifest ftle, vvhich is used mainly for organizational ptu-poses. You can also w1ite a script tba t dyna1nically creates a n1odule, and as such doesn' t actually need a directory to store anything in. 50

Jv!icrosoft offers a great article on flow to 1vrite a Pov11erShell Script Module. You create a script module by saving a valid Po"verSbell script to a .ps1nl file, and then saving that file in a directory located \Vihere Po,verShell can find it. In that folder you can also place any resources you need to run your script, as \¥ell as a n1anifest file that describes to PowerShell ho\:v youJ n1odule works. 1

It can be confusing when using "Build Module" because all the .psl files within the Project will be merged into one script and inserted into the Module .psn1l file. Again, tllis is because of the ability to add a .psf fonn file, wllich needs to be generated by Po\verShell Studio to create all the code needed to Sl1ppo11 the form. 'I' Properties

c " x

" _ _..'--' ff;J~ I M v

Mls 00

J(e~

Delete

Del

Select All

Ctrl +A

Bring to Front

Ctrl + B

Send to Back

Ctrl + Shift + B

Properties View Code

Document Outline

[ ' Layoot lJ leave t'1ouseClick

D l [

MouW!over

l D

M~ve

MousellP

[_ Move [ Prev~wl AccessibleDescription > AccessibleName --- > AccessibleRole $buttonl .

A~~~~i.t;fiit:yoi;j~ct...................................................................

~

._

._ _.

._._

G add_AutoSizeChanged

G G ·G :G

add_BackColorChanged add_BackgroundlmageChanged add_Backgroundlmagelayout(hanged add_BindingContextChanged

v

PowerShell Studio - Form Controls

I

183

In the Script Editor, as you start to type the control ruune ending with a period (.), a dropdo"vn will open showing you all the methods and properties that you can apply to the control.

#TODO: Initialize Form Controls here $buttonl.Text = 'Does ~.Ork' } 6

'

$buttonl . Text = 'Does Not

~lork'

8

9

function Change-Button - {$buttonl.Text = 'Does

~rk' }

Control manipulation cormnands 1nust be executed either directly or indirectly by a raised event to work . The example on the left t11e $button! .Text demonstrates 11ow co1nmand will work \vhen the Load Fonn event (direct) is raised or "vitllin the Function when it is called by the buttonl_click event raised (indirect), but will not be executed if no raised event has acted upon it, as in the middle example.

- $buttonl_Click={Change-Button} 14

When you type the control na1ne within the editor and enter a period at the end (.) you will see a pop out menu to sho"v you all the available properties and inethods available for t11at control.

> > > > >

$button.'ly8utton.

.....,_,_,........_..._,_,..._._..._,_,,............_,,] I\ ·A~~·~~·it;·i~o~i~~liActi~~o~~~i.P'ti·~~......................... fA~~-~~ibiiitYQb}~ct

tj

AccessibleDescription AccessibleName AccessibleRole add_AutoSizeChanged add_BackColorChanged add_Backgroundlm ageChanged add_BackgroundlmagelayoutChanged

0

add_BindingContextChanged

0

0 0

$buttonMyButton .text

After typing the property or method, there will be another pop out tl1at provides you n1ore infonnation about tl1e selected property or inethod "vit11 links to vanous resources.

>Size }

"

> >

Suspendlayout Tablndex TabStop

>Tag JI

~

JI property Text

JI TextAlign JI Text.lmageRelation JI Top

>

Topleve!Control

class System.String

[iilvie.· v

n Browse

[iilv'"-'' Type 0

"

MSON Hep

184

I PowerShell St udio -A Comprehensive Guide

Change Button Text

I

Your Button

I

$buttonMyButton.Text ="Your Button"

Change Button Text Color

I

My Button

I

$buttonMyButton.ForeColor = 'DarkRed'

t1o

Enable or Disable Button

Button Visible or Hidden

~

Change Button Text Color

I

$buttonMyButton.Enabled = $false $buttonMyButton.Visible = $true Of course, it would be hard to shovv' you if the button were invisible, however the comma11d would be: $buttonMyButton.Visible = $false

~

My Button

-

My Button

I

$buttonMyButton.BackColor = 'White'

ox

ili Af11!1ottor.s

)( lltlo"

~ Atc-l P

.

QJI

CIC>boord

A

f.3Staso~

-

t

.. ~ -

1':

l±J Centct ltonronlllr

:

1±1 centct v..DQilr

Sitt •Q CO"lttd Yid:!'!

(;I

Cct12n



Ed!

1 •

c... Su•

I

~

ii

p

~ ~ ""'*'«

e:

>It>•

Giifl e

o0 "'•" c..,1101

~

..El °"''

Chedc8ox

100

-

TllbS""'

-Series!

'ij~x

!IU eonit.-...s..,

60

IP o...and .o-JOatar-""Mow Oa!e-

0

>-

...

>--

>- -

.__

)

Legends Senes

(Co8eclllon) (Collnol

Heb

, °""'

0

-

D-

Oer·-lfJ

m

.., Chart

80

:Sc~

':JI -

r-..

~s..

Amo .."""

o~!Sox

'Cw

l!l ~

~J ~

0

~

••

0

...

. . -11: S.,.Stem.Vlndow$J'orms....

·~

A

' @a.-

·

"°"""" . vPropertJes

)(

t cm c=i:-r-:--•--..

:



ch•rU F.is.

focus

I

C:......V.adotic Truo

1 2 3 •

5 6 7 8

.., tmaoe

o-

An!!A..,,,._.,,

0

Text

· ®~

..

"

Thi! lbox

J>

i

til:

l fi1]

gi g

Li _..,,

!

@ .,non

11'

i

~

Heb

-Con•al

,.. • . ...,6

V....

fif Ill ....,.,a...... t1t "'0'1.,_..

£5 S'tt

~

~Jl

~

x llci
:

lli ...., Bottoms

.'.;! ...., CJi>board

EJ ~

fdt

::IToolbox

~

-

=

83 ~ID CCN"ol

. . ...., _

.........

Sae To Coi:rof Width

~

¢"1 -·

\lg! '"''""

..

" 5:1

"°"- .

l'il

[!]

...,,. m r...,..,.. fi~

"«'•

"'-IYStl

y Properti?s

• x

ii

~ '"'"b,-_,.,.,----'-1~ rR-. !l'

.

1. Select the Chart control. " Series 2. Open the Collection Editor" .

~

p

@

~

l±J Con:.< Hon:an"'v f±I Cen1«Veuo ,t,fft!R..Ut> f)Hcl> [l~!Z>Ut

--

- -1-1- +

m lAYout5.

Au'lol11vout

ie""fi>r'""""' >. I

AIJto:..l\'cdat9·'46PM

N UM

I VTF-S I tnc:232

Col: l

Ow: I

.1

1.

Change the series naine to "Process WS"

x

7

Series Collection Editor

Process ws properties:

Meni>ers: Process \•IS

::

~· J

1 YAxis Type PMlaiy ...,. Olalt OiartArea OiartType v Data lsXVM!elndexed False Poirts

(Collection)

XVM!eType f'Uo YVakiesPerProvlclor

-

1

True Truo

1. Now add a ComboBox control to the form by dragging and dropping it fro1n the toolbox to the fonn area. 2. Select the Co1nb0Box in the designer, tl1en in the properties open the "Items Collection".

C......V-bc T"'°

7

The otens on .,. combo box.

1._.-

---"'---------

I- + - - -

_J D Fa15"

Dobl (Dotollo11d191) O.:aSource (!>one) o..da)'Mefrb« (!>one) l_, (Collection) Tog

v

0 ....

i;z) F--Modemt>olog t;i3 Fontlloaiog

v

-

20 ....

~ Flcw.U)'MPon: to IC¥cl'

Lt

d-:...

..,

t.;j Sze to eon=-ot

ffl

L

x

A • -;ai o

Edt

Preview

ii:Toollox

4'

View

i'tolp

0

+



- - - --

-~

>-

'"'"' L•yout '"'"' ""'IO..T.. I\, ...._

6 WSUSll>dd• T°"'

'llt ....,.,..,_..,.

lk] OSA.9-T°"'

'

F\o_P....

-- - _,...- __ .. --- .. ---

!!! .....o..i96

IOCll£flC9l Param ( [Parameter(Mandatory=$true)] (System.Windows.Forms.ComboBox]$ComboBox, [Parameter(Mandatory=$tru e)] $Items,

PowerShell Studio - Form Controls 27 28 29 30 31 32 33 34

I 203

[Parameter(Mandatory=$false)] [string]$DisplayMember, [switch]$Append ) ~(-not$Append)

{ $comboBox.ltems.Clear()

35

}

36 37 38 39 40 41 42 43 44

if ($Items -is [Array]) { $comboBox.ltems.AddRange($1tems) } e lse { $comboBox.ltems.Add ($Items) }

45 46 47

$comboBox.DisplayMember = $DisplayMember }

Example of loadiI1g a ComboBox 1nanually with multiple ite1ns: Update-ComboBox $comboboxl "iteml ", " item2", " item3"

To add additional ite1ns to ai1 existing ComboBox list use the append parameter: Update-ComboBox $comboboxl " item4" -Append

Loading a Co1nb0Box programically with script:

Update-ComboBox $comboboxl (Get-Process) "ProcessName"

4.7 CONTEXTMENUSTRIP CONTROL

0-

54

The ContextMenuStrip is used to create a right-click menu for a control that you choose. For convenience, 'vhen you drop a ContextMenuStrip on top of any control in the Designer it vvill be automatically assigned to that control. v Behavior

To manually assign a ContextMenuStrip to a control, you need to set the control 's ContextMenuStrip property to the desired ContextMenuStrip control..

54

>

ABov..Orop

False

AutoEl!rpsis

False

ContextMenuSf

extmenustriptG)

3::~.,,,

I

https://www.sapien.com/blog/2011/l2/l 6/primalforms-2011 -spotlight-on-the-contextmenustrip-control/

204

I PowerShell Studio -

A Comprehensive Guide

You can also assign the ContextMenuStrip to a control within the script editor, for example: $button l .ContextMenuStrip = $contextmenustrip l

4.7.1

ShowCheckMargin and ShowlmageMargin

The ShowCheckMargin property determines whether a space for a check mark is shown on the left edge of tl1e ToolS tripMenultem. The ShowImageMargiI1 property detennines whether space for an i1nage for each menu item is displayed.

----------0

ShowCheckMargin

-----------

! Edit items...

If you enable the Sho\vCheckMarginyou also need to set the property for each rnenu item' s Behavior/CheckOnClick to "True" or the check inark will not display for the selected menu item. This is typically used when creating an option that remains enabled for a user until deselected. If you are sin1ply creating a right click menu item that executes once each time selected, then you \.Vill not have a need for using the check inark.

PowerShell Studio - Form Controls

205

4.7.2 ContextMenuStrip Example In this example, we \¥ill add a single Button Control, then add a ContextMenuStrip Control, add three inenu items, and assign it to the button.

I< _,..,>

I@

!t.ltton

.. °""'

~ Chtd;Bol(

....

~-..

~~ ilt~ic

00

Contex~Slr(I

Add the Button control to your empty form. 2. Drag/Drop the ContextMenuStrip control directly on top of the Button control, this will automatically associate the menu with the button control. NOTE: the contextmenustrip will appear in the pane beneath the form, it will not appear directly on the form. 1.

I~ 0.taGod

1ri:io.-.. lilt .....-

[!-

10 - -

z;l Flt>Sy~6tdler ~ Aoafo9

cc Yon::i..log

LJ Gro.4*x

®-•..idot I~~

1.U-·• A

Ube!

I I I ••

8-

~u.-

I

~!' Utt'l!Of

r•- ~txlSox ~;ii-......

rt:ii-~

:;;;1 ...,,.,,_

la,...,.,_

\fl - ,. Moo

O•""'

I

'~""""""" GD

IJroO't:~:::e.

f.iil~r~y

'!! .......~

e. " A.lc:hTtXl8oX li .!ll(Il $p1~

Click on the s1nall triangle in the upper right corner of the Context1nenuStrip, check both the " ShowimageMargin" and " ShowCheckMargin" .

? · ·· .. .. .. .

.... ·1 RenderMode:

ShowlmageMargin

E2J

ShowCheckMargin

Ed'rt Items ...

Items Collection Editor

ToolStripMeoobem

Select item and add to ist bek-" · ~

[

Md

J

Right ToleftAIAoMirrorln False ShortcutKeyOisplayStrir

conteidmenu~ 1

~

t~em1

ct:: ~ J I _J

Members: '

x

?

'

[ImnagerRenderMode .

_____...,. E2J

Then click on "Edit Items".

I~~ Merultem

©ContextMe.nuStrip T~

contextmeoustrip1

to~enuitem

~ toolstripmenUtem2 ~ toolst~erutem3 v

Teld Teld~ TeldOtrection TeldfmageRelation Behavior

Disable ClalQeS MiddleCeder Horizontal ImageBefore Teld

PUo~ze

True False True False

AIAoToolTip

OoubleOckEnabled Enabled ToolTipTeld

v

True

~sble

True

Daa Drop Down

Q-lone}

OK

1. Leave tl1e ite1n type set to Menuite1n, then click the Add button to add three 11e\;v toolstripmenu items.

2. You should now see a parent contextmenustrip ite1n and three child 1nenu items.

bd

3. For each toolstipmenu item click on the Text property and cl1ange the name. Th.is \¥ill be the text that is displayed for the menu item. In this exa1nple, we used "Disable Changes", " Stop" and "Ti1ner".

206

I PowerShell Studio 4.

If you "vant a check mark to appear or disappear each time the menu item is clicked, then you can set the ClieckO nClick· oroperty to 1RUE. When you are finished your right-click meny should look like the Disable Changes example on the left.

~-

[

A Comprehensive Guide

Stop

I

Timer All three menu items can have an image assigned to the1n using the Items Collection Editor (see bel0Vi1). The "Disable Changes" menu item Behavior/CheckOnClick is set to True so that when the user selected this menu ite1n it will remain checked until the user re-selects the menu ite1n to uncheck it. Both the "Stop" and "Tuner" menu ite1ns Behavior/CheckOnClick property is set to False because these are to execute only once per user click.

4.7.3 Important Events Item Clicked This event occurs when a 1nenu iten1 is clicked. Use this event as a general catch all event fo r the 1nenu items. It allo,vs you to react to the menu ite1n clicks without having to set each individual menu ite1n' s click event. You can access the clicked iten1 by accessing the event's argument Clickite1n property: $ .Clickedltem The follo"ving is an exa1nple of how to respond to the ItemClicked event 1 2 3 4

5

$contextmenustripService_ltemClicked=[System.Windows.Forms.ToolStripltemClickedEventHandl er]{ #Event Argument:$_ = [System.Windows.Forms.ToolStripltemClickedEventArgs] if($_.Clickedltem -eq $startToolStripMenultem)

{

6

7

Write-Host 'Start'

}

8 e lseif ($_.Clickedltem.Text -eq 'Stop') 9 { 10 Write -Host 'Stop' 11 } 12 }

Opening This event occurs when the ContextMenuStrip is opening. Use this eve11t as a trigger to initialize the inenu ite1ns such as enabling I disabling or ltiding menu items. You can prevent the ContextMenuStrip from opening by cancelling the event: $_.Cancel = $true

PowerShell Studio - Form Controls

The follo"ving is an exainple demonstrating the use of the Opening event to initialize the menu ite1ns: l $contextmenustripService_Opening=[System.ComponentModel.CancelEventHandler]{ 2 #Event Argument: $_ = [System.ComponentModel.CancelEventArgs] 3 4 $pauseToolStripMenultem.Enabled =$fa lse 5 $startToolStripMenultem.Enabled =$false 6 $stopToolStripMenultem.Enabled =$false 7 8 if($treeviewServices.SelectedNode -ne $null) 9 { l0 $service= $treeviewServices.SelectedNode.Tag ll 12 if($service -ne $null)#ls there is a service object? 13 { 14 $pauseToolStripMenultem.Enabled =$false 15 $startToolStripMenultem.Enabled =$false 16 $stopToolStripMenultem.Enabled =$false 17 18 $service.Refresh() #Update the status 19 20 if($service.Status -eq 'Running') 21 { 22 $stopToolStripMenultem.Enabled =$true 23 $pauseToolStripMenultem.Enabled = $service.CanPauseAndCon tinue 24 } 25 e lseif($service.Status -eq 'Paused') 26 { 27 $startToolStripMenultem.Enabled =$true 28 $stopToolStripMenultem.Enabled =$true

29

}

30 31 32 33 34

e lse { $startToolStripMenultem.Enabled =$true } }

35

}

36 37 38

e lse { $_. Cancel= $true #Don't show th e context menu

39 40

} }

I 207

I PowerShell Studio -

208

A Comprehensive Guide

Closed This event occurs \vhen the ContextMenuStrip has closed. You can use this event to handle state cl1anges or selection changes in a combo box 1nenu ite1n if you do not handle their state changes as they occur.

To detennine why the ContextMenuStrip closed, you can access the event's argmnent CloseReason property : $_.CloseReason

Values:



• • •



AppFocusChange Specifies that the ContextMenuStrip control was closed because ai1other application has received the focus. App Clicked Specifies that the ContextMenuStrip control \Vas closed because an application was launched. Item Clicked Specifies that the ContextMenuStrip control was closed because one of its items \vas clicked. Keyboard Specifies that the ContextMenuStrip control was closed because of keyboard activity , such as the ESC key being pressed. CloseCalled Specifies that the ContextMenuStrip control \Vas closed because the Close method was called.

Example of the Closed Event: 1 2 3 4 5

$contextmenustripService_Closed=[System.Windows.Forms.ToolStripDropDownClosedEventHandl er]{ #Event Argument:$_ = [System.Windows.Forms.ToolStripDropDownClosedEventArgs] Write-Host "Close Reason: $($_.CloseReason)" if ($_.C loseReason -eq 'ltemClicked')

6

{

7 8 9 10

Write-Host 'ComboBox Value:' $comboBoxMenultem.SelectedText Write-Host 'TextBox Value:' $textBoxMenultem.Text

} }

4.7.4 Important Methods Close This 1nethod closes the ContextMenuStrip control. $contextmenustripService.Close()

PowerShell Studio - Form Controls

I 209

Show This method displays the context menu. Use this method when you wish to 111anually trigger the context 1nenu. Example use of the Sho\v inethod: l 2 3

4

$treeviewServices_NodeMouseClick=[System.Windows.Forms.TreeNodeMouseClickEventHandler] { #Event Argument:$_= [System.Windows.Forms.TreeNodeMouseClickEventArgs] if($_.Button -eq 'Right')

{

5

$treeviewServices.SelectedNode =$_.Node

6

7 8 9 1O 11 12 13 14 15 16 } 17 }

#Display a context menu for any node without setting #each individual contextmenustrip property #Show the context menu relative to a control $contextmenustripService.Show($treeviewServices, $_.Location) #Alternative: Show context menu using a screen location #$truePoint = $treeviewServices.PointToScreen ($_.Location) #$contextmenustripService.Show($truePoint)

4.8 DATAGRID AND DATAGRIDVIEW CONTROLS Data Grid is the predecessor to DataGridView, in tllis section we \.vill be discussing the Data Grid View however there are 111any similarities between the both. Below are the major differences: DataGuid~iCll

Control

fcah1res Multiple column types

Multiple ways to clis1>lay data

Multi1>le ways to customize the display of data

The DataGridView control provides 1nore built-in column types than the DataGrid control. These. column types 1neet the needs of most conunon scenarios, but are also easier to exte11d or replace than the column types in the DataGtid control. The DataGrid control is limited to displaying data from an external data source. The DataGridView control, however, can display m1bound data stored in the control, data fro1n a bound data source, or bound and unbound data together. You can also imple1nent virtual mode in the DataGridVie\v control to provide custom data n1anage1nent. The DataGridView control provides inany properties and events that enable you to specify ho\v data is formatted and displayed. For example, you can change the appearance of cells, rows, and colu1mis depending on the data they contain, or you can replace data of one data type with equivalent data of another type.

I PowerShell Studio -

210

A Comprehensive Guide

Multi11Ie options for changing cell, row, column, and header appearance and behavior

The DataGridView control enables you to 'vork with individual grid components in nu1nerous ways. For example, you can freeze rows and colmnns to prevent the1n from scrolliI1g; hide ro,vs, colUIIll1s, and headers; change the way row colu1nn, and header sizes are adjusted; change the way users make selections; and provide ToolTips and sho1tcut rnenus for individual cells, rows, and colunms.

The DataGrid coutrol is retained for back\vard compatibility and for special needs. For nearly all purposes, you sl1ould use the DataGridVie"v control. The only feature that is available in the Data Grid control that is not available il1 the DataGridView control is the hierarchical display of information from t\VO related tables in a single control. You 1nust use two DataGridVie\v controls to display iJlfonnation from hvo tables that are in a tnaster/detail relationship.

4.8.1

Dynamic Populated Example


@ Defaul - 5 min.

0

Custom Mirues

'Select Mrues :

Pl.ow user lo decide when to restart

@ Notiy user alio~slart in 15 mi'Ues How often to check f0< new ~es1

@ Every 22 hous

0 1

Custom Hous

Select Hotn :

I

PowerShell Studio - Form Controls

5.7

I 231

HELPPROVIDER CONTROL

The HelpProvider Control is a unique tool that allow you to provide popup help for any control.

x

0

o_. Form

button1

First, Drag/Drop the HelpProvider Control to your form, you will notice that it has very little properties associated with it, and there is no code generated in the editor. However, it is very simple to getting runrung. In this exainple, I have created a si1nple fonn with one button ai1d one combobox to demonstrate how to setup the HelpProvider, this will work the same for any control.

First you need to tell the form which control you are initiating the HelpProvider for: l

$helpproviderl .SetShowHelp($button l)

Second, you need to set the string that you \Vant to display when the user clicks on the control and presses Fl : l

$helpproviderl .SetHelpString($button l, "Help for button l ")

In this example I used four lines: l 2 3 4

$helpproviderl .SetShowHelp($button l) $helpproviderl .SetHelpString($button l, "Help for button l ") $helpproviderl .SetShowHelp($comboboxl) $helpproviderl .SetHelpString ($combo box l, "Help for combobox")

110 Form

0

~Help for Wton 1 &11 I

x

~9 Form

I

0

x

buttonl

::

...

I PowerShell Studio -

232

A Comprehensive Guide

5.8 IMAGELIST CONTROL

0-..

61

The hnageList Control is used to store a group of in1ages that can be accessed by other controls. linages that are included in the I1nageList are stored as bina.J.}1 data 'vithin the form. Example below:

l 2

# imagelistl $Formatter_binaryFomatter = New-Object System. Runtime .Serialization.Formatters. Binary. BinaryFormatter

3

#region Binary Data

4

$System_IO_MemoryStream = New-Object System.10.MemoryStream (, [byte[]] [System.Convert] ::FromBase64String ('

5

AAEAAAD///// AQAAAAAAAAAMAgAAAFdTeXNOZWOuV21uZG93cy5Gb3JtcywgVmVyc21vbjOOLjA

u 6

MC4wLCBDdWxOdXJIPW51dXRyYWwslFB l YmxpYOtleVRva2VuPWl3N2El YzU2MTkzNGUwODkFAQA A

7

ACZTeXNOZWOuV21uZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJIYW l lcgEAAAAERGFOYQcCAgAAAAk

D 8 9

AAAADwMAAAAaCAAAAklTRnQBSQFMAwEBAAEIAQABCAEAARABAAEQAQAE/wEJAQAl/wFC AUOBNgEE BgABNgEEAgABKAMAA UADAAEQAwABAQEAAQgGAAEEGAABgAIAA YADAAKAAQABgAMAA YA BAAGAAQAC

10

gAIAA8ABAAHAAdwBwAEAAfABygGmAQABMwUAATMBAAEzA.Q ABMwEAAjMCAAMWAQADHA EAAylBAAMp

11

AQADVQEAAOOBAANCAQADOQEAAYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB lgHvAQAB

12

l glnAQABkAGpAaOCAAH/ATMDAAFmAwABmQMAAcwCAAEzAwACMwlAATMBZglAATMBmQIA

ATMBzAIA 13 ATMB/wlAA WYDAAFmATMCAAJmAgABZgGZAgABZgHMAgABZgH/AgABmQMAAZkBMwlAAZkBZg IAApkC 14 AwcAAQMHAAEBBwABAQcAAQEnAAEHBwABBwcAAQcHAAH/BgAL')) 15 $imagelistl .lmageStream = $Formatter_binaryFomatter.Deserialize($System_IO_MemoryStream) 16

17

$Formatter_binaryFomatter =$null $System_IO_MemoryStream =$null

18

$imagelistl .TransparentColor = 'Transparent'

19

#endregion Generated Form Code

There are five different bit depths to choose fro1n for the images in the hnageList; 4Bit, 8Bit, 16Bit. 24Bit, and 32Bit.

61

https://www.sapien.com/blog/2011/10/19 /primalforms-2011 -spotlight-on-the-imagelist-co.ntrol/

PowerShell Studio - Form Contro ls

5.8.1

I 233

Comparing Image Bit-Depth

Bit depth refers to the color infonnation stored in an itnage. The higher the bit depth of an image, the more colors it can store. Tl1e si1nplest i1n age, a 1 bit i1nage, can only shovv two colors, black and \Vhite. That is because the 1 bit can 01tly store one of tw o values, 0 (white) and 1 (black). An 8 bit image can store 256 possible colors, vvhile a 24 bit i1nage can display about 16 million colors. Keep in mind that the larger the bit-depth and size of yo1rr images, the larger tl1e finished .psf or .ps l file will be, I recoilllnend using the s1nallest bit-depth that you can get away with.

Bits per Pixel

Number of available colors

4

16

8

256

16

65,536

24

16,777,216

32

16,777,216 +Transparency

The human eye can only discern about 10 nzillion different colors, so saving an inzage higher than 24-bit is excessive ifthe only intended purpose is for vie1'11ing, unless you need transparency. Also, standard JPEG and 1'/FF.files can only use 8-bit and 16-bit, respectively. a·

j

··

.. ffii lmagelist Tasks ~ unagelistl

...

..

·; Image Size Image Bit Depth

1

To add ilnages sitnply click on the triangle in the upper right con1er of the I1nageList control, then select the iinage size, bit-depth, and click the " Choose Images" .

~t:Wt3

IDepth8Bit

v

J Choose ·mages

In tl1e image on the right you can see how an i1nage with a lower bit-depth will have a relatively graiitier look to it than an image w ith a higher bit-depth. Typically for 1nonitor viewing 8-bit provides a liappy medium between size savings and great looking hnages. When ii1creasi11g i1nage bit-depth you also exponentially increase the size of the ilnage file, in the case of 8-bit to 24-bit, it increases from 420k to 12MB.

24-BIT COLOR 16MILLIONCOLORS

8-en COLOR

8-en e/w

I-en B/w

256 COLORS

256 GRAYS

1.2 MB

420 K

320 K

2COLORS 42 K

234

I PowerShell Studio -

A Comprehensive Guide

5. 9 LABEL CONTROL

Q

62

The Label Control is a clickable text string display. Typically used to provide labeliI1g for other controls.



Analysis Meter

--

0%

---

Here we use a Label Control (Analysis Meter) to indicate what the ProgressBar is used for.

Ttflhenyou change the text in a label PowerShell Studio will change the nan1e of the variable of the Label Control. For instance, ifyou change the name ofthe Label Control to "Exit ,, then PowerShell Studio will change all references in the script code to $LabelExit.

TIP: To direct Windows PowerShell to evaluate an expression before inserting the result in a string, use a sube:Kpression. The syntax is$(

~

• lktYltwTMb tcBltt~

(cfjC~~ ((fi Gr~

()pcm _ _t_ h t_C_ olumns _ _c_ oC_ fl:_ tlOn _ ~ ,

V'icw:

Ood: 11'1 Parcn= Ccnwndate This 1nethod prevents the control from drawing until the EndUpdate 1nethod is called. Use this 1nethod vvhen you are updating or adding a large number of ite111s. 1

$1istviewl .Begin Update()

EndUpdate This method resumes drawing of the list view control after drawing is suspended by the BeginUpdate method. 1

$1istviewl .EndUpdate()

PowerShell Studio - Form Controls

I 249

Exa1nple use of the BeginUpdate and EndUpdate: l 2 3 4 5

$1istviewl .BeginUpdate() $1istviewl .Items.Clear(); foreach ($itemin$array) { [void]$1istviewl .Items.Add ($item.Text)

6

}

7

$1istviewl .EndUpdate();

6.2.3 Important Events AfterLabelEdit This event occurs when the label for an ite1n has been edited by the user. Label editing must be enabled for this event to be called (See L abelEdit property). AfterLabelEdit event uses the following argument, which is accessible via the $_ variable:

(System.Windows.Forms.LabelEditEventHandler] t

CancelEdit Label Item

Gets or sets a value indicating whether the edit has been canceled. Gets the ne\v text assigned to the label of the ListViewlte1n. Gets the zero-based index of the ListVievvItem containing the label to edit.

Use this event to react to name changes. For example, if the represents a file, you can use this event as a trigger fo r renaming the file. You should also perform any validation and reject the na1ne change if there is a failure.

l 2 3 4 5

$1istviewl _AfterlabelEdit=[System.Windows.Forms.LabelEditEventHandler]{ #Event Argument:$_ = [System.Windows.Forms.LabelEditEventArgs] if(-not (Validate-File Name$_.Label)) { $_.CancelEdit =$true

6

}

7

e lse

8

{

9 #Rename the file l0 } ll }

BeforeLabelEdit This event occurs vvhen the user starts editing the label of an ite1n. This event uses the [System.Windovvs.Forms.LabelEditEventHandler] argument. See AfterLabelEdit for more information about this argument.

250

I PowerShell Studio -

A Comprehensive Guide

Use this event to prevent users fro1n rerunning specific ite1ns. 1 2 3 4 5

6 7

$1istviewl _BeforelabelEdit=[System.Windows.Forms.LabelEditEventHandler]{ #Event Argument: $_ = [System.Windows.Forms.LabelEditEventArgs] if (-not$1istviewl .ltems[$_.ltem].Checked) { $_.CancelEdit =$true

} }

ColumnClicli This event occurs when the user clicks a colmnn header within the list view control. Typically you \Vill use this event to sort the list by the selected colm1m. ColmnnClick event uses the follo,ving argu1nent, which is accessible via the $_ variable:

[System.Windows.Forms.ColumnClickEventArgs] 1 2 3 4

$1istviewl _ColumnClick=[System.Windows.Forms.ColumnClickEventHandler] { #Event Argument:$_= (System.Windows.Forms.ColumnClickEventArgs] Write-Host ("Column '{O}' was c lic ked" -f $this.Columns[$_.Column].Text) }

Item Activate This event occurs when an item is activated. One or more ite1ns can be activated by the user, depending on the Activate property.

Activating an item is not the same as selecting an item. For exaniple, you may want to display a webpage when the user activates an item in the ListView. Use the Selectedltenis or Selectedlndices property to referenced the activated iteni. 1 2 3

$1istviewl _ltemA ctivate={ Write-Host "Activate Item" $1istviewl .Selectedltems[O].Text }

Item Checked This event occurs when the checked property of a ListVievv ite1n changes. ltemChecked event uses the followil1g argument, winch is accessible via the $_ variable :

[System.Windows.Forms.Item ChecliedEventArgs] 1 2 3 4

$1istviewl _ltemChecked=[System.Windows.Forms.ltemCheckedEventHandler]{ #Event Argument:$_= (System.Windows.Forms.ltemCheckedEventArgs] if ($_.Item.Checked) {

PowerShell Studio - Form Controls 5

I 251

Write-Host "Checked Item: $($_.Item.Text)"

6

}

7

e lse

8

{

9 10

Write-Host"Unchecked Item: $($_.Item.Text)" }}

SelectedlndexChan ged This event occurs when the Selectedlndex collection changes. Use the event when you \¥ant to react to a change in the selection. 1 2

$1istviewl_SelectedlndexChanged={ Write-Host "Selection Changed"

3

}

ltemSelectionChanged This event occurs when the selection state of an item changes. Use this event instead of the SelectedlndexChanged when you want to kno,;y the which item was selected or unselected. ItemSelectionChanged event uses the follo,ving argument, "vhich is accessible via the $_ variable:

[System.Windows.Forms.ListViewltemSelectionChangedEventArgs] 1 2 3 4

$1istview l _ltemSelectionCh an ged =[System.Windows. Forms.ListViewltemSelec tio nC hanged EventH andler]{ #Event Argument:$_ = [System.Windows.Forms.ListViewltemSelectionChangedEventArgs] if ($_.lsSelected) {

5 6 7

Write-Host"Selected: $ ($_.ltem.T ext)"

} e lse

8

{

9 Write-Host"UnSelected: $ ($_. ltem.Text)" l0 } 11 }

252

I PowerShell Studio -

A Comprehensive Guide

6.3 MASKEDTEXTBOX CONTROL 64

0-...

The MaskedTextbox is an enhanced text box control that supports a declarative syntax for accepting or rejecting user input. Use the MaskedTextBox to distinguish between proper and improper user input. By using a mask, you can specify the fonnat of the input without custom validation.

6.3.1 Important Properties Mask This property sets the string governing the input for this control. Why use the Mask property? Use the Mask property to limit the textbox' s input to a specific format. You can define your O\Vn custo1n 1nask or preferably select from a predefined set using the desig11er. The designer has a useful set of predefined masks such as date time formats, phone numbers, and zip codes.

Input Mask

?

X]

Select a predef1ned mask description from the list below or select Custom to define a custom mask. Mask DeSCliption

Data Format

Validating Type

Numeric (5-digi!s)

12345 (574} SSS-0123 SSS-0123 12111/2003 12/11/2003 11:20 000-00-1234 23:20 11:20 98052..()399

lnl32

Phone number Phone number no area code Short date Short date and~ (US) Social secuity nunber Time (fu'opean/Military) Tune (US) Ql)Code

Mask:

6ione) 6ione)

You can access the predesigned masks either via the Property pane, or by clicking the sn1all triangle in the upper right comer of the MaskedTextBox control.

OateTme DateTime

6ione) OateTme DateTime 6ione)

6ione>

0

Use ValidatingType

Preview:

If you need to create your O\Vn format, please refer to the follo\.ving table:

0 9 #

L ?•

&

64

Digit, required. This element will accept any single digit between 0 and 9. Digit or space, optional. Digit or space, optional. If this position is blank in the mask, it will be rendered as a space in the Text property. Plus (+) and minus (-)signs are allowed. Letter, required. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z] in regular expressions. Letter, optional. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z]? in regular expressions. Character, required. If the AsciiOnly property is set to true, this element behaves like the "L" element.

https://www.sapien .com/blog/2011 /09 /27/primalforms-201 1-spotlight-on-the-maskedtextbox-control/

PowerShell Studio - Form Controls

c A

a •

)

••

I 253

Character, optional. Any non-control character. If the AsciiOnly property is set to true, this element behaves like the"?" element. Alphanumeric, required. If the AsciiOnly property is set to true, the only characters it will accept are the ASCII letters a-z and A-Z. This mask element behaves like the "a" element. Alphanumeric, optional. If the AsciiOnly property is set to true, the only characters it will accept are the ASCII letters a-z and A-Z. This mask element behaves like the "A" element. Decimal placeh~older. Th e actual display character used will be the decimal symbol appropriate to the culture. Thousands placeholder. The actual display character used will be the thousands placeholder appropriate to the culture. Time separator. The actual display character used will be the time symbol appropriate to the culture.




Shift up. Converts all characters that follow to uppercase.

I $

Disable a previous shift up or shift down. \

All other characters

Escape. Escapes a mask character , turning it into a literal. "\\" is the escape sequence for a backslash. Literals. All non-mask elements will appear as themselves within MaskedTextBox. Literals always occupy a static position in the mask at run time, and cannot be moved or deleted by the user.

An example mask for a US phone nu1nber is as follows: (999) 000-0000

In this inask the first three digits are optional and the last seven are required. The parentheses are considered Literals, which means the user ca1mot altered the1n. BeeDOnError

This property indicates ' vhether the iuasked text box control raises the syste1n beep for each user key stroke that it rejects. Values (Default: $False) Culture

Tllis property sets the culll1re infom1ation associated with tl1e 1nasked text box. Set this property if you are specifically targeting a culture that is not the current default (English (United States) for US 1nachines). This effects the fonnat of the date tin1e entries and these changed will be reflected when selecting predefined 111asks as n1entioned above.

254

I PowerShell St udio -

A Comprehensive Guide

MaskComuleted This property indicates whether all required inputs have been entered into the input mask.

The MaskC01npleted property can be useful \¥hen it comes to validating the data. See the MaskFull property for an example. MaskFull This property indicates \.vhether all required and optional inputs have been entered into the input 1nask.

This property is si1nilar to MaskC01npleted property \.Vith the exception that it also enco1npasses optional inputs specified in the Mask property. To compare these properties and to de1nonstrate their usefulness when it co1nes to validating, \Ve \¥ill look at validating a phone number. The predefined Mask for a US phone nmnber specifies that the area code (first three digits) is optional and the re1naining seven digits are 111andatory . The following examples will help de1nonstrate the difference between the two properties: Partially co1npleted phone nu1nber: Phone:

(555)555-_

I

False False

MaskCompleted MaskFull

Phone Number without an area code: Phone:

(

) 555-5555

I

True False

MaskCompleted MaskFu II

Co1npleted Phone Number: Phone:

MaskCompleted Masl{Full

(555) 555-5555

I

True True

Text The prope1ty gets or sets the text as it is currently displayed to the user.

PowerShell Studio - Form Controls

I 255

The value rett1n1ed may include formatting characters specified in the Mask property. See the TextMaskFormat property for more infon11ation. TextMaskFormat Tllis property detenrunes whether the string returned by the Text property includes literals and/or prornpt characters.

Use the TextMaskFonnat if you need to 1nodify the fonnat of the string that is returned by the Text property of the MaskedTextBox control. Values (Default: IncludeLiterals): The example values displayed are based on he following MaskTe>..1Box: Pho:ne:



• • • •

• • •

(

) 555-5555

I

JncludePrompt Return text input by the user as well as any instances of the pro1npt character. Text: " 5555555" lncludeLiterals Return text input by the user as well as any literal characters defined in the rnask. Text: "( ) 555-5555" lncludeProniptAndLiterals Return text input by the user as well as a11y literal characters defined in the mask and any instances of the pro1npt character. Text: "(_) 555-5555" 1:!,xcludePromptAndLiterals Return only text input by the user. Text: " 5555555"

ValidatingType Thls property contains the data type used to verify the data input by the user.

You need not set tllis property nonnally, since the preset Masks already set this property appropriately . Tllis ensures data types are \Vithin the correct range. For example, "77/77/7777" is a valid format for a date, but the value is not. You must set the ValidatingType property to a type, wllich in PowerShell is defined by the full class name surrounded by brackets. For exan1ple, to set the ValidatingType to a DateTitne you will need to do tl1e following: l

$maskedtextboxBirthDate.ValidatingType

=[System .DateTime]

6.3.3 Important Methods ValidateText Tllis method converts the user input string to an instance of the validating type.

I PowerShell Studio -

256

A Comprehensive Guide

Use this method to determine if the content of the MaskTextBox is valid. This 1nethod requires that a co1npatible type be set in the ValdiatingType property. If the ValidateText fails it "vill return a $null value otherwise it will ren1n1 an object of the corresponding type. Example: if($maskedtextboxBirth Date.ValidatingType -ne $null) { if($maskedtextboxBirthDate.ValidateText() -eq $null) { #Validation Failed

1 2 3 4 5

6

}

7

else

8

{

9

A •

#Validation Successful }

}

The A1askTextBox will automatically validate the text 1~1hen it loses focus.

6.3.3 Important Events MasklnputRejected

This event occurs when the user's input or assigned character does not match the corresponding fonnat element of the input mask. Use this event when you want to react to invalid input:

2 3

$maskedtextboxPhone_MasklnputRejected=[System.Windows.Forms.MasklnputRejectedEventHa ndler]{ #Event Argument:$_ = (System.Windows.Forms.MasklnputRejectedEventArgs] $1abe1Error.Text ="Failed input -Postion ({O}): {l }" -f $_.Position, $_.RejectionHint.ToString()

4

}

1

The event passes a para1neter variable $_ . Use this variable to access the follo"ving properties: • •

$ .Position

Returns the position in the 1nask corresponding to the invalid input character. $_.RejectionHint Returns an enumerated value [Systein. ComponentModel.MaskedTextResultHint] that describes "vhy the input character "vas rejected. Please see the MSDN MaskTextResultHist Help page for 1nore infonnation.

TypeValidationCompleted

This event occurs when MaskedTextBox has finished parsit1g the current value using the Validatit1gType property . Use this event to react to \Vhen a type validation fails or succeeds. This event is also fired \Vhen the ValdiateText method is called.

PowerShell Studio - Form Controls 1 2 3 4 5 6

I 257

$maskedtextboxBirthDate_TypeValidationCompleted=[System.Windows.Forms.TypeValidationEv entHandler]{ #Event Argument:$_= [System.Windows.Forms.TypeValidationEventArgs] if($_.lsValidlnput -eq $false) { $_.Cancel= $true# Keep the focus on the control $errorproviderl .SetError($maskedtextboxBirthDate, "Invalid Date Format");

7

}

8 e lse 9 { 1O $errorprovider 1.SetError ($maskedtextboxBirth Date, ""); 11 } 12 }

The TypeValdiationCompleted passes a parainetervariable $_.The following are important properties you can access with this variable: •





$ .Cancel

This property indicates whether the event should be canceled. Set it to $true to retain the focus on the MaskTextBox. $_.Is Validlnput This property indicates whether the fonnatted input string was successfully converted to the validating type. $ .Retun1Value This property returns the object that results fro1n tl1e conversion of the fonnatted input string.

6.4 MENUSTRIP CONTROL The MenuStrip control allo\¥S you to place a drop-do\.vn style menu on tl1e form, with custom parent a11d child menu items. oSJ f-orm

I

D

Type Here

The default docking position is at the top as in the example on the left.

I PowerShell Studio -

258

o

09 Form

J

A Comprehensive Guide

---~---------

~ El .

El_

L-ffi MenuStrip Tasks

T peHere ' - - · - - - - - - - - - - - - - - - - - - - - - - - - - - Embed in ToolStnpConta1ner Insert Standard Items Re.nderMode:

ManagerRenderMode

v

l 1

Dode

[TOP

v

GripStyle:

[ Hidden

~

Edit terns . •

There are two options for entering 1nenu items, you ca11 type directly into the text boxes in the control, or you can click on tl1e small triangle in the upper right con1er of the MenuStrip control to access the MenuStrip Tasks, then click "Edit Items". Once you enter menu items as parent ite1ns and child ite1ns it 'vill look like the exainple on the right.

..

aO

File

I

The default event for each 1nenu ite1ns is a Click Event. To add the Click Event si1nply doubleclick on the appropriate menu item.

For example, if we double-click on the Printer 1nenu item, PowerShell Studio will create a Click Event for the menu iten1 and add the following code in the editor:

1 2 3

$printerToolStripMen u Item_Click={ #TODO: Place custom script here }

I

Here

I

•I

Print

Printer

Save

PDF

Exit

I

I "

Here

I

'

'

_Here

I

PowerShell Studio - Form Controls

6.4.1

Add Icon to Menu Item -

rJ] Form Fil~

Many tiines, you might need to add images to your menu ite1ns for a 1nore professional looking menu. This cai1 be easily accomplished by doing the following:

x

0

I Print



Sav~

0

I 259

Exit

In this example, we have added a red exclan1ation image to the Exit menu ite1n.

:Ji[:ic:>;--Gl~~ M . . .St1nriplosb

(



-

.

EmHd

ToolStnpCon1t1ner

In.kit St•l°fdltd ltitm5 RitndttModr:: ,~ M..,gtrRtndm.t -od•-. v

l>o N:ri

>

x

ForeColor Image

Segoe UI. ~ • CorirolText

l!i2J

System.Drawing.Bit

lmageMgn MiddeCenter lmageSca&ng Siz.eToR ImageTransparertColor

D

~Tol.eft

No ~ Tol.eftAioMirorln False Shocto.AKeyf)splaySllT Text Em TextA&gn MiddeCenter OK

vj I

L

Cancel .1:

260

I PowerShell Studio -

A Comprehensive Guide

6.4.2 Adding Standard Menu Items MenuStrip Tasks

If you \Vould like to quickly add many of the standard application

Embed 1n Too Str:pContainer

1nenu ite1ns quickly, you can do that by clicking on the "Insert Standard Items" link within the MenuStrip Tasks window.

Insert Standard Items

-

RenderMode:

ManagerRenderMode

Dacie:

Top

GripStyle:

Hidden

I v I -

File

v

v

lJ

j

Edit Items...

Edit

Tools

New

Ctrl+ N

Open

Ctrl+O

Save

Ctrl+S

Help

Save As This will populate the MenuStrip with standard menu items along with 1nany associated standard 1nenu icons. This will not generate any of the necessary code in the editor that is needed to make the menu itenis functional, you will need to insert the code yourself

Print

Ctrl+ P

Print Preview Exit

6.5 MONTHCALENDAR CONTROL The MonthCalendar control is used to provide a user the ability to select a date. The resulting selected date can be used in many different scenarios to fit fonn processes. a9

=

orm

El

JI ~ -~ To obtain the user selected date use: $1nonthcalendar1.SelectionStart

December 2016 Sun Mon Tue Wed Thu Fri 27 28 29 30 1 2 4 5 6 7 8 9 11 12 13 14 15 16 18 19 20 21 22 23 25 26 21 28 29 I 30 I 1 2 3 4 5 6 I Today: 12/30/2016

• Sat 3 10 17 24 31 7

To obtain the ending selected date use: $monthcalendar1. SelectionEnd To obtain the date range selected use: $monthcalendar l. SelectionRange

There are several coilllnon co1mnands such as the ones above that are handy to know, so we will go over a few of those here:

PowerShell Studio - Form Contro ls

I 261

Circle today 's day on calendar: $monthcalendar 1.ShowTodayCircle =$true Li1nit the amount of days that can be selected in a date range (ex. 20 days): $n1onthcalendarl .MaxSelectionCotmt = 20 For flexibility, the only limits on date display and ret1rrn for your calendar are the ones the Cale11dar control itself has. This ineans you can select as large a ra11ge of dates as the Calendar control is willing to let you choose (10 years' worth) over any date range between January I, 1752 ai1d Dece1nber 31, 9998. There has been some confusion over the differences ii1MaxSelectionCou11ta11d SelectionCount. The main difference is the SelectionC01mt limits the nu1nber of days ill the retlrrned date rai1ge beginning \Vith the first date selected, however the user vvill still be able to select a larger rru1ge on the calendar in the fonn. MaxSelectionCount limits the size of the date range selectable on tl1e calendar by the user. This vvould be the reco1mnended n1ethod when you are restricting date range sizes because it doesn't make sense to restrict the size of a date range if the user is unaware a restriction is imposed. Remove the today banner: $monthcalendarl .Sho,¥Today = $false Set day of vveek to begin calendar on (ex. Monday): $monthcalendar l .FirstDayOfWeek = Sy stem.windows.Fornis.Day .Monday If you vvant to obtainjust the Month, Day or Year of the selected start date use: $monthcalendarl . selectionstart.day $monthcalendarl . sel ect i onstart. month $monthcalendarl. sel ectionstart.year

When you are getting the start, end or ra11ge of dates, it a11toniatically includes the tune, and since your user doesn't have the ability to set ti1ne from the calendar control, time will always show a start tin1e of 00:00:00 (12:00:00AM).

Luckily, the Mo nthCalendar control bas a ToString so tl1at we cai1 fonnat the date: $monthcalendarl . Select i onSt art . ToString( 'MM/ dd/ yyyy') \Vill return a date formatted for example 12/30/2016.

Notice that the Month Jv!M is capitalized, nzm is for niinute, so care_fui with your capitalization here! 65A coniplete list ofCusto1n Date and Time Forn-zat Strings are available on MS'DN 66For niore resources on the 1\1!onthCalendar Class, Jv!SD1V is an excellent resource that lists every constru.ctor, niethod, and event.

65 66

http s://msdn.microsoft.com/en-us/libra ry/8kb3ddd4.as px https://msdn. microsoft.com/en-us/lib rary/ system.windows.forms.monthcale nd a r.aspx

262

I PowerShell Studio -

A Comprehensive Guide

6.6 NOTIFYICON CONTROL

0-...

67

Use the NotifyIcon control, to alert users of special events, such as when a task is co1npleted. Typically, this control is used for infonnational purposes, but it cai1 also be used as a source for user ii1teraction.

6.6.1

Important Properties

BalloonTi11Text

This property sets the text associated with the balloon ToolTip. Use this property to display a 1nessage in the Balloon Tooltip.

This is the balloon text.

Setting the BalloonTipText in the script editor: 1

$Notifylcon.BalloonTipText = 'This is th e balloon text"

BalloonTipTitle

This property sets the title of the balloon ToolTip. The title text is displayed above tl1e balloon text.

Balloon Title ~ x This is the balloon text.

BalloonTiplcon This property sets the icon to associate witl1 the balloon Tooltip. In other words, the icon displayed inside the tooltip itself. Note: The BalloonTip Title property must be set in order to view the balloon icon. Icon: None "\ x

Icon: Info "\ x

Icon: Error "\ x

Icon: Warning "\ x

Balloon Icon

Balloon Icon

Balloon Icon

Balloon Icon

:::/)

None - No Icon

~

t;J •4)

Info Icon

2:04

:::/)

~ t) •4>

2:04 Pl

Error Icon

Warning Icon

Icon This property sets the icon to display in the syste1n tray.

Importai1t: This property niust be set; otherwise the tool tip balloon will not sho\;v ! The designer vvill allow you to bro,;vse and select an icon to display \¥hen the tooltip is shown.

67

https://www.sapien .com/blog/20 12/05/08/spotlight-on-the-notifyicon-control/

PowerShell Studio - Form Controls

I 263

Click on the bro\vse button in the Property Panel: .

" Window 5',to

CoierolBox Het>&.con

True fel:e

- -13

'ldCortoncr Man~Strc>

. - . .. . ..

(bin)

f~

t'ione)

...... ...



I£:



-

··-........... ...".._

·-

Or use the inenu in the designer: o ..... ··· ·· ·· .... ·· ID Notifylcon Tasks · ~ notifyicon 1 ~ ·· I Choose icon~

~

..

;sq

... ,

' ..

----1



Note: If a "phantom" icon re1nains in the system tray after closing the form, then it is recoilllnended set the Visible property to False in order to clear the icon before closing form.

L

Exit

ContextMenuStrip This property sets the shortcut inenu to show when the user right-clicks the icon. Set this property to an existing ContextMenuStrip to assign a menu to the syste1n tray icon.

Visible This property indicates ,;vhether the icon is visible in the notification area of the taskbar. Values (Default: True): True I False

6.6.2 Important Events BalloonTipClicked This event occurs when the balloon tip is clicked. Use this event to react to user clicks in the ToolTip balloon. 1 2

$notifyicon 1_BalloonTipClicked={ Write-Host 'The Balloon Tip was Clicked'}

264

I PowerShell Studio -

A Comprehensive Guide

~ x

Click Me

Please click on this balloon!

Clicked & DoubleClicked

These events occur "vhen the syste1n tray icon is clicked. If you need more infor1nation such as "vhich inouse button was used, then it is reconunended to use the MouseClick events (See belo"v). MouseClick

This event occurs when a user clicks on the system tray icon. [System.Windows.Forms.LabelEditEventBandler]

Button Clicks Delta Location

x y

Gets \Vhich inouse button was pressed. Gets the nu1nber of times the inouse button was pressed and released. (Not applicable) Gets the location of the mouse during the generating inouse event. Gets the x-coordinate of the mouse during the generating 1nouse event. Gets the y-coordinate of the mouse during the generating inouse event.

l 2 3

$notifyicon l_MouseClick=[System.Windows.Forms.MouseEventHandler]{ #Event Argument: $_ = [System.Windows.Forms.MouseEventArgs] Write-Host "System Tray Icon Mouse Click: $($_.Button) Clicks: $($_.Clicks)"

4

}

MouseDoubleClick

These events occur when a user double clicks on a system tray icon. This event has the same arguments as the MouseClick event. l 2 3 4

$notifyicon l_MouseDoubleClick=[System.Windows.Forms.MouseEventHandler]{ #Event Argument: $_ = [System.Windows.Forms.MouseEventArgs] Write-Host "System Tray Icon Mouse Double Click: $($_.Button) Clicks: $($_.Clicks)" }

6.6.3 Important Methods ShowBalloonTip

This 1nethod displays a balloon tip in the taskbar for the specified ti111e period.

PowerShell Studio - Form Controls

I 265

The method uses the properties of the Notifylcon to display the balloon tip. Therefore, they must be set before calling this method. l

$Notifylcon.ShowBalloonTip(O)

This variation, displays a balloon tip with the specified title, text, and icon in the taskbar for the specified time period. You need not set the Notifylcon 's properties ifyou use this method variation. l

$N otifylcon.ShowBalloonTip($Timeout, $BalloonTipTitle, $BalloonTipText $BalloonTiplcon)

Helper Function: The following is a helper function that allows you to display the Notify Icon. The help function also assigns the calling executable ' s icon) if the Notify Icon's Icon property hasn' t been assigned. l

function Show-Notifylcon

2

{

3 4 5

8 param( 9 [Parameter(Mandatory =$true, Position = 0)) 1O [ValidateNotNull()] 11 [System .Windows.Forms.Notifylcon]$Notifylcon, 12 [Parameter (Mandato ry =$true, Position= l )] 13 [ValidateNotNullOrEmpty()]

I PowerShell Studio -

266

A Comprehensive Guide

14

[String]$BalloonTipText,

15 16

[Parameter(Position = 2)] [String]$BalloonTipTitle = ",

17 18

[Parameter(Position = 3)] [System.Windows.Forms.ToolTiplcon]$BalloonTiplcon ='None',

19

[Parameter(Position = 4)]

20 21

[int]$Timeout = O )

22 23

if ($Notifylcon.lcon -eq $null)

24

{

25 26

#Set a Default Icon otherwise the balloon will not show $Notifylcon .lcon = [System. Drawing. Icon]:: ExtractAssociated Icon ([System. Windows. Forms.Application] :: ExecutableP ath)

27

}

28

29

$Notifylcon.ShowBalloonTip($Timeout, $BalloonTipTitle, $BalloonTipText, $BalloonTiplcon)

30 }

Exainple Use: l 2

Show-Notifylcon -Notifylcon $notifyicon l -BalloonTipText $textboxText.Text' -BalloonTipTitle $textboxTitle.Text - BalloonTiplcon $comboboxl .Selectedltem

There is a sa1nple form de1nonstrating the Notify Icon available in SAPIEN's Download section at (https://\V\V\v.sapien.com/downloads#Sample%20Scripts/Prilna1Fonns%2020 l l/NotifylconSan1ple.zip)

6.7 NUMERICUPDOWN CONTROL The NumericUpDown control is like the DomainUpDown control, except in this case we are only \vorking with nu1nerical nu1nbers.

6.7.1

Important Properties

v

Data (Da1ta8indings) DecimalPlaces

O

Increment

1

Maximum

100

(2) Deci1nal Places

Minimum Tag

O

(0) Decilnal Places

lhousandsSeparator False

Decimal Places:

[P.00

[f

:l IJ

PowerShell Studio - Form Controls

I 267

Increment:

This detennines the amount to increment or decre1nent on each button click. I.E. if tl1e increment is set to (5) tl1en each button click \ivould increase by 5, 10, 15, 20, 25, and so on. Maximum:

This liinits the 1naxiJ.num value that the control can be increased. Minimum:

This li1nits the 1nini1num value that the control can be decreased. Thousands Separator: If set to Tn1e, this \ivill auto1natically insert a "," separator for numerical values over 999. For example, 1000 would read 1,000.

To get the current selected value fro1n the Nu1nericUpDown control use:

$numericupdownl.value

6.7.2 Important Event .ValueCbanged

For the ValueChanged event to occur, the Value property can be changed in code, by clicking the up or do\ivn button, or by the user entering a new value that is read by the control. The new value is read when the user hits the ENTER key or navigates away fro1n the control. If tl1e user enters a new value and then clicks the up or down button, the ValueChanged event will occur twice.

6.8 OPENFILEDIALOG CONTROL The OpenFileDialog control operates with the saine principles as the FolderBrowserDialog, except instead of select a folder location it is used to select a specific file(s). If enabled, the OpenFileDialog can allow multiple files to be selected.

6.8.1 aO

Form

OpenfileDialog Example In tllis exainple, we created a ne\v form with a textbox and a button, looks fa1niliar doesn't it. We then added tl1e OpenFileDialog control to the form by drag/drop tl1e control from the toolbox on top of the fonn. Silnple enough rigl1t!

I PowerShell Studio -

268

A Comprehensive Guide

Now right-click on the button and add the " Click" event. This generate the event and a fevv lines of code: 1

$button l _Click={

}

But that does nothing on its own~ we need to insert so1ne code to inake everything work togetl1er: 1 2 3 4 5 6

$button 1_Click={ #This is looking for the OpenFileDialog window to close successfully, meaning a valid file was selected and OPEN was clicked. if ($openfiledialogl .ShowDialog() -eq 'OK') { #this populates th e text box with the selec ted file. $textboxl .Text= $openfiledialogl .FileName

7 8

} }

If you want the user to be able to select inultiple files:

2) 3) 4) 5)

1 2 3 4 5 6 7

Set the MultiSelect property for the OpenFileDialog control to TRUE. Instead of a TextBox, I suggest using a RichTe:x.1Box. Add a button and create a CLICK event for the button Insert code similar to the exa1nple belovv into the CLICK event. This ti1ne instead of using $open:filedialog.FileNa1ne you will use $OpenFileDialog.FileNa1nes ( ~notice the son the end).

$button 1_Click={ if ($openfiledialog 1.ShowDialog() -eq 'OK') { $filenames= $openfiledialog 1.filenames foreach ($file in $filenames) { $textbox 1.AppendText("$file 'n") }}}

The ForEach loop is used to collect each file name that ' vas selected, then each is appended to the RichTextBox, use a ' n to insert a line retum a'9 Form

0

x

C:\Users\Jeff\Docunerts\eel-box.pg C:\Users\Jefl\Docunerts\Oieckist .pd C:\Useis\Jeff\Docuneris\dc~.pcf

[]

.:i

It should look so1nething like the example above when you are done!

PowerShell Studio - Form Controls

I 269

6.9 PANEL CONTROL The Panel control is like the GroupBox control, in that it is used to provide grouping for other controls. The difference being that a Panel control can have scroll bars, and GroupBox has a caption at the top. When you move a Panel control around on a fo11n, all control within the Panel control vvill 1nove \¥ith it. In this exa1nple, you can see the Panel Control (dark grey box), \¥ith three different controls contained within it. If you don't need the caption at the top, as in a GroupBox, then the Panel is usually the best choice especially when adding color to the panel. ag

F

m

However, if the GroupBox background will be the same as the for1n background, it can be a great way to organize controls and offers a caption ability. Notice in the form in the next page, showing before and after BackColor, the color on a GroupBox tends to bleed over the top of the GroupBox which doesn' t inake a very professional looking design.

09 Form My Tile

-·--

-- - -

·--

- ----

-- --

-

·--

-

.

Keep in mind that with the Panel Control or the GroupBox Control, if you disable the control by setting .enable = $false, then all controls within the Panel or GroupBox will also be disabled. You can use this to yotrr advantage by disabling or enabling an entire group of controls vvith one com1nand.

I PowerShe ll St udio -

270

A Comprehe nsive Guide

7.0 PICTUREBOX CONTROL 6

0-..

8Represents a Windo,vs picture box control for displaying an i1nage. Use a PictureBox when you need to display an image either located on a disk or the internet. Sin1ilar to other controls, you can also imbed an i1nage in your form \vith the PictureBox.

-

Image and hnageLocation properties. the difference betvveen tJ1ese two properties determines how you p'lan to load the in1age. Image property i1nbeds the ilnage in the form so that it is self-reliant \¥hen displaying an image, no internet or file

share connection required. The image is converted to a Base64String \Vhich is then imbedded into the form. Which looks sinlilar to the code belo,v: l

$pictureboxl .Image = [System.Convert] ::FromBase64String(' /9j/4AAQSkZJRgABAQEASABIAAD/7gAOQWRvYm UAZAAAAAAB/+ ESnEV4aWYAAE l NACoAAAAI AAcBEgADAAAAAQABAAABGgAFAAAAAQAAAGIBGwAFAAAAAQAAAGoBKAADAAAAAQACA AABMQACAAAA HAAAAH IBM gAAAAAAEAAEFkb2JllFBob3Rvc2hv c CBDUzUgV21uZG93cwAyMDE 1 OjAzOjlylDEzOjM 1OjAwAAACoAIABAAAAAEAAAM goAM ABAAAAAEAAALOAAAAAAAAAAYBAw ADAAAAAQAGAAABGgAFAAAAAQAAARABGwCAgAEAAAAAQAAEXMAAAAAAAAASAAAAAE AAABIAAAAAf/Y / +OADEFkb2J IXONNAAH/7gAOQWRvYmUAZIAAAAAB/9sAhAAM CAglCQgM CQk M EQsKCxEVDwwM DxUYExM VExM YEQwM DAwM DBEM DAwM DAwM DAwMDAwM DAwMDAwM DA w MDAwM DAwM AQOLCVv()ODRAODhAUDg40FBQODg40FBEM DAwM DBERDAwM DAwM EQwM D AwMDAwM DAwM DAwMDAwMDAwM DAwMDAwM DAz/wAA RCACXA KA DAS IA==')

lmagelocation property is used to load an image asynchronously from eiU1er a \Vebsite or disk location. I.his is used mainly to either decrease the overall file size of the fonn or if you \vant the ability to edit an image at a later tilne that w ill display next time the fom1 is Joaded. lnitiallmage. tllis refers to the image that you \Vant to display \Vhile the main image is loading, used if you are using lmageLocation and it might take a fe,v seconds for the main iJnage to do\vnload. Errorlmage. is the image that you 'vant to display if an error occurs during the image-loading process, or if

tl1e i1nage load is cancelled. Works 'vith In1ageLocation property. SizeModc, this propert)1 controls how the PictureBox \Vill handle the image placeme11t and sizing. Tl1ere are five

different settings. 1. 2. 3. ~.

Normal! The image is placed in the upper-left comer of the PictureBox. The image is clipped if it is larger than the PictureBox it is contained in. Stretchlmage: The image \Vithin the PictureBox is stretched or shn1nk to fit the size of the PictureBox. AutoSize: The PiclmeBox is sized equal to Ule size of the linage that il contains. Centerlmage: The image is displayed in the center if the PictureBox is larger than the i1nage. If the image

is larger than the PictureBox, U1e picture is placed in the center of the PictureBox and lhe outside edges are clipped.

68

http s://www.sapien.c om/blog/20 1l /08/05/primalforms-201 1-spotlight-on-the-picturebox-control/

PowerShell Studio - Form Controls 5.

I 271

Zoom: The size of the image is increased or decreased maintaining the size ratio .

The PictureBox support file types *.gif, *.jpg, *.jpeg, *.bmp, *.w1nf, *.png, tl1ere is a .NE'T source available to allo"v mai1y other file types, it is called 69DevIL. 70

High0nCoding has an excellent article on using this type of i1nage inse1tion from a database. The article demonstrates how to fetch data from tl1e database using PowerShell, and how to display ilnages in the windows form using data from the database.

7.1

0-..

-

PROGRESSBAR AND PROGRESSBAROVERLA Y 71

The ProgressBar represents a Windows progress bar, ProgressBarOverlay also has tl1e added ability to display percentage co1npleted or ai1y specified text within tl1e ProgressBarOverlay. Use a ProgressBar when you need to show the user that progress is being made in so1ne operation, such as copying files. ProgressBar

ProgressBarOverlay (o/o)

Directories ...

7.1.1

ProgressBarOverlay (text)

Important Properties

Maximum: The Maximu111 is the upper bound of the ra.nge this ProgressBar is working with.

Why use the Maxinium property?

Use the Maxi1num property when you have a known limit for your ProgressBar. When the Value property is equal to tl1e value of the Maxiinu1n property, the progress bar is co1npletely filled. Exa1nple of setting the Maximum property in the Script Editor: $progressbarl .Maximum= $files.Count

Values (Default: I 00):

69

http://openil.sourceforge.net/ 70 http://highoncoding.com/ Articles/235_Accessing_Database_And_Displaying_lmages_Using_Windows_P owerShell.aspx 71 https://www.sapien.com/blog/20 l l /07 /l 4/primalforms-20 l l -spotlight-on-the-progressbar-control/

272

I PowerShell St udio -

A Comprehensive Guide

Minimum: The Minimu1n is the lower bound of the range this ProgressBar is working \Vith. When the Value property is equal to the value of the Minimum property , the ProgressBar will be empty . Values (Default 0) Step : The Step is the ainount to increment the current value of the ProgressBar by when the PerfonnStepQ method is called. Why use the Step property?

Use the Step property to specify the amount that each co1npleted task in an operation changes the value of the progress bar. The Step property default value is 10, so you inay want to set the step to 1 'vhen necessary. Values (Default: 10) Value: The current value of the ProgressBar, in the range specified by the Minimu1n and Maximrun properties. Why use the Value property?

Use the Value property if you \Vant to set the progress at a specific point or to obtain the current position of the ProgressBar . Values (Default: 0)

7.1.2 Important Methods Increment: This inethod advances the current position of the ProgressBar by the specified a1nount. Why use the Increment method?

Use the Incre1nent method \Vhen you need to increment the value of the ProgressBar by varying a1nounts. This method of incrementing the ProgressBar is silnilar to using the Step property with the PerformStep method. Setting the Step property is not necessary \Vhen using the Increment method. Exa1nple of using Incre1nent 1nethod in the script editor: 1

$p rogressbarl .lncrement(l)

PerformStep: This 1nethod advances the current value of the ProgressBar by the amount of the Step property . Why use the PerforniStep method?

Use the PerformStep inethod when repeatedly incrementing the ProgressBar by the same amount (i.e., the value set in the Step property). Here is a sample script block triggered by a button, that displays its progress as it creates a backup of all t11e text files located in a folder specified by the user: 1 2

$b uttonBa c kup f iles_C lic k={ #Back up Text files from a selected directory

PowerShell Studio - Form Controls 3 4 5

I 273

if($fo lderbrowserdialogl .ShowDialog() -eq 'OK') { $selectedPath = $folderbrowserdialogl .Selected Path

6

7 8

#Get all the text files in the folder $files= Get-Childltem $selectedPath -Filter *.txt

9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

if ($files -eq $null -or $files.Count -eq 0) { #No files to backup return } #Initialize the Progress Bar $progressbarl .Maximum= $files.Count $progressbarl .Step= 1 $progressbarl .Value= 0 #Create the Backup Folder $destination = ('{O}\ \Backup' -f $selectedPath) [System.IO.Directory]::CreateDirectory($destination) #Copy the files and update the progress bar foreach ($file in $files){ Copy-Item ('{0}\\{l }' -f $selected Path, $file) -Destination $destination $progressbarl .PerformStep() } }}

7.2 PROPERTYGRID CONTROL o

~ Form

:: ~ ! I.J >

Fla!Appearance FlatStyle

> Font ForeColor Image lmageA!ign Image Index lmageKey

lmagelist Righ!Toleft Text

button1

Standard Microsoft Sans Seri. 8.25pt • CortrolTexl

D ~> r.NdcleCerter

-

-

D ~> D ~>

x

J

The PropertyGrid control \¥as designed to edit the properties collection of another control. In the form on the right, we have a PropertyGrid control with the " SelectedObject" set to our button "Buttonl" . This provides tl1e ability to edit Buttonl witltin the form itself.

tione> No bulton1

This is a great way to add customization capability to -any fonn without having to rebuild the fonn offline and reload the form. Now, tl1at said tllis beco1nes some\.vhat unfeasible if you are trying to change many different controls because you \.Vould need a ' - - - - - - - - - - - - - - - - - - - - - - = " · Property Grid for each control you \.Vanted to edit. -

.

l

You can use the ReadOnly attribute to keep specific control properties fron1 being editable. The Browseable attribute detennines whether a control's property is show n in the grid or hidden.

I PowerShell Studio -

274 •

A Comprehensive Guide

DescriptionAttribute. Sets the text for the property that is displayed in the description help pane belo\v the properties. This is a useful "vay to provide help text for the active property (the property that l1as focus). Apply this attribute to the MaxRepeatRate property.



CategoryAttribute. Sets the category that the property is u11der in the grid. Tltis is useful when you want a property grouped by a category naine. If a property does 11ot have a category specified, then it will be assigned to the Misc category. Apply this attribute to all properties.



BrowsableAttribute - Indicates whether the property is sho\vn in the grid. This is useful \>vhen you \Vant to hide a property from the grid. By default, a public property is always shown in the grid. Apply this attribute to the SettingsChanged property.



ReadOnlyAttribute - Indicates \¥hether the property is read-only. This is useful vvl1en you wai1t to keep a property from being editable in the grid. By default, a public property vvith get and set accessor functions is editable in the grid. Apply tltis attiibute to the App Version property.



DefaultValueAttribute - Identifies the property's default value. This is useful when you want to provide a default value for a property and later detennine if the property's value is different than the default. Apply this attribute to all properties.



DefaultPropertyAttribute - Identifies the default property for tl1e class. The default property for a class gets the focus first "vhen the class is selected in the grid. Apply this att1ibute to the AppSettings class.

No':v I know \>vhat you are thinking, why not just add a second Property Grid(2) control with its " SelectionObject" set to the first PropertyGrid(l) control so that you could change the "Selection.Obj ect" of the PropertyGrid(l) tl1en you could easily switch to other controls? Wouldn't that be nice! Unfo1tunately, it doesn' t work that \!Vay , in fact you can control every other property except the "SelectionObject" property. As you can see i11 the exa1nple belo,v, the only selection available in the " SelectionObject" is (none).

ii9

PropertyGrid(l)

PropertyGrid(2)

·~=; ~ l I_j >

x

0

Form

bultonl 1"crosoft Sans Senf. 8.~ • CortrclTell!

Font FOl'eColor Image

D

Mddeeerter

tmagetndex. tmageKev lmagelsst

D Vionel

RightToleft Tex:t

No bt.Cton1

l:l!JAfjan_

~1 :~ 1l

Con!extMenuS!rip Enabled lmeMode

Se!ected0b1ect Tablndex. TabStop

t>onel

~)

~ec__ -

1~---0-~

..--

I..:J

.--~-------------.

~)

lmage.AJign

D

"'

J

v

J "

tionel

True

NoCorirol

!tione>

j

...,,nrm:ue,-------~

UseCompatibleTextRendeon True Visible True Data

Oa.ta6iDdinsl.s L Selec~

Sets the currently selected object that the grid v.i ll brO'...'Se.

"

I 275

PowerShell Studio - Form Controls

7.3 RADIOBUTTON CONTROL

0-

72

The RadioButton control is used when you want to present multiple choices to a user but only allow one selection. RadioButtons work in co1tjunction \Vith other RadioButtons located within the same container, that can be a form, a groupbox or a pai1el. 0

o'} RadioButton

x

Example #1 In this exainple, there are t\vo groupbox's \Vith three radiobutton's in each groupbox. The radiobuttons in eacl1 groupbox are independent of each other. The user can only choose either Option A, B, or C in each groupbox.

groupbox2

groupboxl

@Option A

Q OptionA

Q Option B

@Option B

Q OptionC

Q OptionC

.::

Example #2 There is one Panel control on the left with three radiobuttons, one GroupBox control on the right with three radiobuttons, and three additional radiobuttons on the fon11 itself. The radiobuttons in the Panel control, in the GroupBox control, and on the Form, all work independently of each other. This allows you to group RadioButtons together in three different ways.

•?

0

Rad108utton

@OptimA

Q OptionA

Q OptionB

@OptionB

Q OptionC

Q OptionC

x

Q OptionA Q OplionB

In this scenario, the user can make one selection from three different areas, for a total of three selections.

7.3.1

@OplionC

Important Properties

Checl{ed: This indicates whether the RadioButton is checked or not. Use the Checked property to determine the state of a specific radio button or -vvhen you want to check or uncheck a radio button. When you set this property to True, the previously checked radio button in the group \Vill be unchecked. $radiobuttonl.checked =$true

7.3.2 Important Events CheckChanged: Occurs whenever the Checked property changes value. Use the CheckChanged property \iv hen you wish to respond to the user checking a radio button. Tllis event also fires when the previously checked radio button is unchecked due to the user checking a different radio button.

72

https://www.sapien.com/blog/20 l l /07 /08/primalforms-20 l l -spotlight-on-the-radiobutton-control/

I PowerShell Studio -

276 •'J

Rad10Button

0

Panel A

0

Panel B

0

@PaneJC

Panel C is selected

x

A Comprehensive Guide 111 this exainple, we demonstrate how to use the checked property of a RadioButton by checking the state of each RadioButton when the mouse moves over the Panel control, if option Panel A, B, or C is selected \¥e set the text for the Label control below. l $panell _MouseMove=[System.Windows.Forms.MouseEventHandler]{ 2 If ($radiobuttonPanelA.Checked -eq $true) 3 { $1abell .Text= "Panel A is selected"} 4 elseif ($radiobuttonPanelB.Checked -eq $true) 5 { $1abell .Text= "Panel Bis selected"} 6 elseif ($radiobuttonPanelC.Checked -eq $true) 7 {$label l .Text = "Panel C is selected"} 8}

7.4 RICHTEXTBOX CONTROL The Ricl1TextBox provides a multi-line text display, which allows you to format different pa11s of text differently, and include itnages, tables, or other rich content. Unlike the standard Textbox "vhich only allo\¥ one font, forecolor at1d fonnatting for all text. The equivilant co1nparison would be between Notepad (TextBox) and Wordpad (RichTextBox). Another point to re1nember is that R.ichTextBox does not support DataBinding, however the standard Textbox does. Ahnost everyone will tell you that formatting for RichTex.1box is at best very drrficult, \vhich is why most of the industry tends to output to either Out-GridView or if more flexibility is needed then html reports are usually used instead. There is a Web Vie"v control, however unfortunately it is one of the fe"v controls that are not offered in the default toolbox. The nicest thing about a RichTextbox is that a nicely fonnatted RTF docun1ent can be loaded into the RichTex.1Box \lvitl1ol1t losing any of the formatting. l

$richtextbox l .LoadFile('c:\Users\Jeff\Desktop\ARMS\EULA.rtf')

19 MyFc>1m

X

This is an exa1nple of a .RTF file loaded into a RichTex.1Box. IMPORTANT: Please read the terms and conditions of product application set out below carefully prior to download, Installation, copy or use. THROUGH DOWNLOADING, INSTAWNG, COPYING OR USING lliE SOFTWARE YOU ARE EXPRESSING YOUR CONSENT TO THESE TERM SANO CONOm ONS.

"

oftware End-User License Agreement. Under the terms e>f this Software End User License Agreement (lierelnafter referred t as "the Agreement") executed by and between Jeffery Holder (hereinafter referred to as '"Jeffery Holder" or "the Pre>vlder") and you, a physical perron or legal entity (hereinafter referred t as "You" or "the End User"), You are entitled to use the Software defined In Artlcle 1 of this Agreement. The Sftware defined in Artlde 1 of this Agreement can be stored on a data carrier, sent via electronic mail, downle>aded from the Internet. downloaded from the Provider's servers or obtained from o ther sources, subj ect to the terms and conditions specified below. THIS IS AN AGREEMENT ON ENO.USER RIGHTS ANO NOT AN AGREEMENT FOR SAlE. The Provider continues to own the COPV of the software and the Phvsical "

PowerShell Studio - Form Controls

I 277

Auto Scrolling If you have a RichTextBox and you ,;vould like for it to auto1natically scroll to the last entry as text is displayed, this example will do it for you: 1

$richtextbox 1_T extChanged={ $richtextboxl .SelectionStart = $richtextboxl .Textlength; $richtextbox 1.ScrolIT oCaret() $richtextboxl .Focus() }

Start a ne''' line If you \.Vould like to start a ne"v line when sending text to a RichTextBox use the backtick n (' n) 1

$richtextboxl .text= "Start a new line after this text' n"

Send RichTextBox contents to Wordpad 1 2 3

$filename= [System.10.Path]::GetTempFileName() $richtextbox30.SaveFile ($filename} Start-Process wordpad $filename -ErrorAction 'Stop'

Co)}y RichTextBox contents to Windows Cli)}board 1 2 3 4 5 6

7

8

function Add-ClipBoard ($text}

{ Add-Type -AssemblyName System.Windows.Forms $tb =New-Object System.Windows.Forms.TextBox $tb.Multiline = $true $tb.Text =$text $tb.SelectAll() $tb.Copy()

9 } 10 Call the function with 11 $text= $richtextbox 1.text 12 Add-Clipboard -text $text

7.5 SAVEFILEDIALOG CONTROL Many times, the SaveFileDialog control is misunderstood, it only saves a file, it does not create the file to be saved. You must first output the file to be saved. For example, let's say you have a report contained in the variable $report and you want to save that to a file, you \.Vould use the SaveFileDialog FileOK event: 1 2

$savefiledialog 1_FileOk= [System.ComponentModel.CancelEventHandler]{ $report I Out-file $savefiledialog l .FileName}

278

I PowerShell Studio -

A Comprehensive Guide

To show the dialog box so that the user can select the directory and filename of the file to be saved you would use: 1

$savefiledialog 1.ShowDialog ()

x

a MyForm

.,___~~~~~~~~~~~~~~~~~~ !

In this bask: example we have a text box where a report is displayed. and a Save ~on located below that will open the SaveAle dialog so the user can selec:t the location and name ol the file to be saved I

In this basic example, we added a TeA1box, a Button, and

the SaveFileDialog control to an empty form. Our goal is we vvant to be able to save the teA1 that is displayed in the box to a file . This is sunpliest method and works in most all instances.

Save

1 2 3

$buttonSave_C lick={ $report= $textboxl .Text# Put the text into a variable, but we could just use the $textboxl .text and no variable in this case. $savefiledialog 1.ShowDialog () # Open the Dialog Box

4 5

}

6 7 8

$savefiledialog 1_F ileOk=[System.ComponentModel.CancelEventHandler]{ $report I Out-File $savefiledialog l .FileName }

7.6 SPLITCONTAINER CONTROL The SplitContainer creates two pai1els on a fonn which cai1 be presented as either horizontal or vertical. I've seen in many discussions that the SplitContainer only supports two panels, however you can add more two panels by sin1ply dragging more SplitContai11er controls to the fonn.

a;J

yForm

--

i!

I

;

I !I •



--·-----·--··-----------------------·-----"~' !

SplitContainer control to an e1npty for1n, you can see it create two panels ~ Panell ai1d Panel2. You I.i can easily adjust the Panel percentages by : placing your inouse pointer on the dividing line ' !I between the two panels and dragging to resize. ~

;H l

;.I;:'

I I;

---------------...;'':·--

•:

I: I:

Panel1

i:

I'

Panerz

1• ' ;:

I.:

i , ! I

i:

.:' : .i

JL_______________

l

I: ;':'

I:

In the example to the left we have added the

i

i

PowerShell Studio - Form Controls

You can also switch between horizontal and vertical orientation by clicking on the s1nall arrow in the upper right of the control.

!~~-------~~·-~------. - - - --------------------- - ----- -- -- - --- -------- -- ----- ---------~I SpfrtContainer Tasks Vertical Splitter Orientation Undock in Parent Container

I II

I 279

Panel1

'

I Il________________________________________________________________________________________________________ j! r·------------------------------------------------------------------------------------------1

L-

------

~--

-----

I

;·-··-------···-----·-··----------··--·--·-----! r-----···-·--·--·-·. . . . . . .___. . _. . . . . . . . .-.. . --.. . . . . . . . . _. .___ . ._. .... . .---·-···--·1 11

i

;

!' '

Panel1

I.: :

o

.................................. ~......................... ....................... .................................................. t

:

:'

ii

'

! i t

: I'

:

t

I

I

f

It

i ''

!l

j

I

i

'I ;

I

t

!'

t

:' !'

: ' ' ,''

'

I

'I 'f 1''

I

'J

I

i ,, "

"

;

'

'1

I

!i

I

1 I

:

Panel2

pane12

i• t

H

!j

: I

:

: ;

•J

, I

" I

I

I

I

:

'

f

:

'

f f

:

:

'

I

I

:' I

:

:

I' ! i ; !

I• '1

- :·-------------------------------------------1 :

!

I

I '

i

'1

•I

!

~i

:

: 1'

: :

! If I

:I

:, ' I

I I

:

:

':

t

I

~J ;'I:

:

:

This is an example of dragging TWO SplitContainer controls to an e1npty form, resulting in three panels.

i

I

f

I

j

II J

I

i

I I

I

: :I , ··--·----·----·--------·--·--·-----..·---··- .._·----··-··----------·-·- -·-··--------·-·--------·--··-·----..----·J

LJ!. r··------···----··---··--·-·-·--··1 ,---·--------------··-------·-----1 ·.--·---·--·--· ______r··-··-·---··---·-·-:_ _~-~I;,l II Form

1! !I

I '

Pllnet1

!11

Il

1

1

11

I

!

l

i

ii

I

I

I

II Panell

•1

Ii i

1

I

1

1

:

I

i

l____J[_________ll_____ Example A

II II

-

J

_______________

ExampleB

I PowerShell Studio -

280

A Comprehensive Guide

In example A, we drag a new SplitContainer onto Panel2 on the left, this results iI1 Panel2 being split into two panels, exainple B .

-

-

.....

7.7 SPLITTER CONTROL Windows For1ns Splitter controls are used to resize docked controls at nm ti1ne. The St>litter control is often used on fonns vvith controls that have varying lengths of data to present, like Windows Explorer, whose data panes contain information of varying widths at different ti1nes. When the user points the mouse pointer at the m1docked edge of a control that can be resized by a splitter control, the pointer changes its appearance to indicate that the control can be resized. The splitter control allows the user to resize the docked control that is i1nmediately before it. Therefore, to enable the user to resize a docked control at run ti1ne, dock the control to be resized to an edge of a contaiI1er, and then dock a splitter control to the sa1ne side of that container. rlJ ~t

F

1m

In the example on the left \.Ve have created a text box (white area) and docked it to the left. The rest of the fonn is empty (grey area). We drag and drop the Splitter control onto the TextBox and inake sure it is docked to the left as \.veil.

PowerShell Studio - Form Controls Now vvhen we run the fonn you vvill notice that if you 1nove your 1nouse over the splitter bar, you can hold and drag to resize the TeA1.Box.

281 x

This will '¥ork vvith any control that you want to give users the ability to resize the undocked side of a control. To ensure that the Splitter control does not resize controls docked to a size that is too small to be useful to the user, you use the MinEA1ra and MinSize properties. The MinExtra and MinS.ize properties determine the minimum size that controls docked to the left ru1d rigl1t (or top and botto111 if a horizo11tal SJJlitter control) can be sized to. If the otl1er controls on yotrr fonn tl1at the Splitter control is docked to display a specific style of border, you can use the BorderStyle property to n1atch the border sty le of the controls that are docked to it. You inight find it desirable to set a max:immn size limit on controls that the S1>1itter control is docked to. The SplitterMoved and SplitterM.oving events enable you to detennine vvhen the user is resizing a docked control. You can use the SplitPosition property in an event handler for the S11litterMoved or S11litterMovin.g events to detennine the size of the control that the Splitter control is docked to and set the SplitPosition property to a different value to linrit the docked control's vvidtb to a specified maximum vvidtl1 (or height if a horizontally aligned Splitter control).

7.8 STATUSBAR CONTROL

0-

73

Use the StatusBar control, to display status iufonnation to the user. The StatusBar can also be used for user interaction but typically plays an inforn1at:ive roll.

There are two options when using the Statusbar, you can ejtJ1er sho'v only the StatusBar text or you coo show StatusBar panels tl1at you have added. This is controlled by the "ShowPanels" property. ShowPanels set to True - displays the panels that you have set. ShowPanels set to False - displays only the StatusBar teA1. o;} My Form

-

This is the Statusbar Text ertered into the text property

73

x

The exainple on the left has "ShowPanels" set to false, \V hich displays only the text property of the StatusBar control. This is useful if you only need to display one line of infonnation at a time.

.::

https://www.sapien .com/blog/20 12/07 /05/spotlight-on-the-statusbar-control/

282

I PowerShell Studio -

A Comprehensive Guide

x In this exainple, "ShovvPanels" is set to True, and - - - - - - - - - - - - - - - - - - - - - -, vve have added three panels. if) MyForm

Panels

(Collection)

The text of each panel can be controlled by:

Version 2.2.1

Pdhor: Your Name Processing tasks...

$statusbarpanell.Text - "Version 2.2.1" $statusbarpanel2.Text - "Author: Your Name" ~~~~~~~~~1 $status barpanel3.Text - "Processing _________.-. . . Tasks ... "

7.9 STATUSSTRIP CONTROL

0-... aSJ

I

74

Use the Stat11sStrip control, to display status infonnation to the user. The StatusStrip serves as a replace1nent to the StatusBar and offers more support for user interaction than tl1e StatusBar by allowing you to add buttons, progress bars, and other controls. It's like StatusBar on Steriods! Form

El

NOTE: The progressbar in a statusstrip does not contain a refresh prop erty. StatusStrip also does not support the newer ProgressBarOver lay.

......

j ·I

A

Statuslabel

(ffiJ

ProgressBar

~ - OropOownButton

03

74

Split Button

https://www.sapien .com/blog/20 12/09 /12/spotlight-on-the-statusstrip-control/

PowerShell Studio - Form Controls

7. 9.1

I 283

Important Properties

AllowltemReorder -This property allows the items in the StatusStrip to be reordered when the ALT key is pressed.

SizingGrip - This property indicates whether a sizing handle (grip) is displayed in the lower-right corner of the control. This property is mainly cos1netic and should be set to False \erties: MultiLine - FALSE ReadOnly - FALSE TabStop - 1RUE Enabled - TRUE WordWrap - FALSE

Labell Properties: MultiLine - FALSE ReadOnly - FALSE TabStop - FALSE Enabled - TRUE WordWrap - FALSE Text - Starting IP Address

Label2 Pro11erties: MultiLine - FALSE ReadOnly-FALSE Tab Stop - FALSE Enabled - 1RUE WordWrap - FALSE Text - Ending IP Address

Label3 Properties: MultiLine - FALSE ReadOnly - FALSE Tab Stop - FALSE Enabled - TRUE WordWrap - FALSE Text- Use the format: x.x.x.x

GroupBoxl Properties: Text - IP Range Scanner Enabled - TRUE

PictureBoxl 11roperties: Choose a picture you want

ButtonScanIPRange Properties: TeA1 - &Scan IP Range UseMne1nonic -1RUE Enabled - FALSE TabStop - 1RUE

PowerShell Studio - Example Projects

I 309

Next, \Ve will add a DataGridView that will be used to display our results. I also added an additional image on the left just for design purposes but it isn't necessary.

~ e :~

~IP Scanner

--------------------------~

IP Range Sc..mer

Tho tool wl scan al IP addi moo wilwl the fiW190 spedied to ldertfy activemonilCIJVe IPs and lll!en.,i 1 pmvlde device/system rlonnmon•

r·--·······-·1

.____~ . I.____~

I

EndroglP-

I•

I

l

the'""""''

:icon IP Range Use '-·- - - = - - - - - " - - - - - ' u.xx (192.168.1.1)

I

! :

L--····--.i

DA TAGRIDVIEW

Now, we want to add three columns to our DataGridView; IP Address, Name, Open Ports.

-·· ··-·· ..... •••-···

c+--------------------------.,,.,......~· o...c;ridVlOl'O'ride ~I'll~

c= -----i . c ~ IP -

-----i

...... IP -

I~ • s_c., IP Rongo I . -~--~

UM"'°-

-..x.xx (192.1681.l)

r·--

1

l ' i --···J

_i

C~Ott:1Source

(f'IOl'l t J

Edit Col1.1,,,nJ.

AddC~

:.'

d"lt/ro-i«*l'O""'"...,,. ~ Dl!V¥dc ~- ~

!tt1 "' "'

~·-

'

-·-

@ Gt I ll

l

- - - ' - ---'I •~"''""" U.l (1!11$111) ,·'--'..- - --·-

·-

1'2.168.12

-NoNo--

w,....._~-~h:ll'!lt

1'2.161' 10

No...No ,.._ ,.,_ -3 ,.,_ No-

t!l.1'8.111

M W-

1'2.168 ll 192168 14

ltl.168 1, 192.1'8.I' 1!2.161.17

1'2.16811 1'2.168

1'

Finished! You now have a working IP Scanner! Try it out!

Ooen Port• 2llO.UltDIO

NIA WA WA "-A HIA

HIA WA WA

ao 1»"6

0

x

PowerShell Studio - Example Projects

I 315

DISPLAY AND KILL RUNNING PROCESSES REMOTELY This form will allow you to display all running processes on a re1note computer and kill any process.

aO

Running Processes

---------------

Get Processes

[

~[§]~ Refresh

J

First, you n.eed to add the follo,ving controls to the form: (3) TextBoxes

Button Button

TextBox

l'EXTBOX

(3) Buttons

For the "Kill Process" button and its associated text box to the right, set the property "Enabled" to FALSE. We do tlus because we don' t want a user to be able to use those controls until we have first gotten a list of all the running processes.

Next, we create a click event for each button, "Get Processes'', "Kill Process" and "Refresh". PowerShell Studio will insert the event wrapper in the code editor for you.

Below is the code for each button tl1at you will need to enter:

Get P rocess button: 1 2 3 4 5 6 7 8 9

$buttonGetProcesses_Click = { $computer= $computer.Text # Get running processes from computer and display in TextBox. $Processes= Get-Process -ComputerName $computer $process_text.Text =$Processes # Enable "Kill Process" button and associated textbox. $buttonKillProcess.Enabled = $true $killbox.Enabled =$true }

I

Out-String

316

I PowerShell Studio -A Comprehensive Guide

Kill Process button: 10 $buttonKillProcess_Click = { $computer= $computer.Text 11 12 $kill box = $killbox.Text 13 $kill_process = gwmi -comp $computer win32_process I ? name -like *$killbox.exe [void] $kill_process. terminate() 14 $process_text.T ext= "'' 15 $Processes= Get-Process -ComputerName $compu ter I Out-String 16 17 $process_text.Text =$Processes 18 }

Refresh button: 19 $buttonRefresh_C lick = { 20 $computer= $computer.Text 21 $Processes= Get-Process -ComputerName $computer 22 $process_text.Text =$Processes 23 24

I

Out-String

}

rlfJ

0

Running Processes

Get PrCe$$es

1 1~-hp

x

Refresh

Ente< CQml'Uter name

Kill Proces$

Ra.ndles

J

NPM CK>

PM (K)

WS CKl

CPU ( s )

Id

1140 1960 760 6896 23192 1928 1820 11072 19S6 2148 11592 S932 1896 S940 116476 3508 82624 3496 206980 3UOO 742008 804 8264 2476 2700 4 1504 3068 3048

21.28

11 4 13 29 8 8 14 10 16 23 19 10 9 129 13 S4 18 364 SS 213

7S44 1840 S96 3908 17100 1792 1280 8772 1672 1840 2492 S320 2380 2712 151768 2044 86316 3008 243428 21500 790736 760

16148 8044 3020 2164 8132 16048 2152 lU64 4636 S76 676 2036 1680 11412 7360 3844 960 6684 2796 6580 9020 11988 6368 2080 21S6 0 2108 9188 6660

------· - ---·-23 37S 137 48 232 SS7 137 121 213 107 561 588 363 122 173 2832 185 778 244 2448 780 1848 37 195 129 200 0 118 308 328

Enter Process Name i.e. NotePad

s 27 11 14 0

a 15 16

asn 2772 2444 0 1128 2580 3016

-----o.os 0.00 S.77 2.36 0 . 02

o.os

2.38 4.84 10.86 96.53 0.2S 0.00 0.34 411 . 73 0.78 s. 871. 28 0.28 429.92 26.33 3# 022·. 48 0.02 0.33 0.05 0.09 0.00 0.23 0.16

SI P:oc•••Na:•

--

------------

1 AAM

U~e••

Noeifier

1 ac.roc:z:•y 0 0 l l 0 O l

AESTSr64 AGSS•rvic:• Applic:oeion?ram&l!ose AppVShNoei!y 8 -rm9VC:

audiod9 Bea-c•64

0 c:sr•• 1 c1r•• O dasHose O ObxSvc: 1 dl.lhon 1 Oropbox O DropboxUpdaee ldwi

E::=vent.M&naqer l .xplor•r 1 explorer l

1 fix.fox l

tcnt.d.--vh.osc

1 ron.xSTM

O

HPClie.n~S•rvic••

l hpi.naclld2 0 Idl.e

O jhi_••rvice 1 juchec:lt l JUJc:hed

That's it, run the fonn, enter a computer name and click "Get Processes" . I added a couple of labels for the text boxes to give users more clarification. This doesn' t include error trapping tl1at should be included in every script.

PowerShell Studio - Example Projects

I 317

FILESHARE ANALYZER In this example, we will create a form that recursively analyzes the parent folder that you specify and all child folders to obtain the total nmnber of files in each directory, total size of each folder, last accessed, attributes and the specified folder owner if exists.

oD Fil.share Analyze
er cl fies In eoch dinoctOI)', total size"' eoch folder. m tne spedoecl folder ovmer I - ·

Button

PictureBox

I . I !........................................! Label

DataGridView

TextBox

In this example, vve are going to be using several different controls, as you can see from the image above. 1. 2.

Drag/Drop each control onto a new empty form, you can use the layout above or create your own layout. Let's start with the TextBox (textbox50) located in the upper left comer of the form, this vvill be vvhere the user will enter the file path they want to analyze. a. Set BackColor property to "MintCream" b . Set MultiLine property to FALSE c. Leave the text property blank. d. Create three different events (right-click on textbox and choose Add Events, fron1 the selection box check "TextChanged", "Enter" and "Leave", then click Create. e. In tl1e editor for the TextChru.lged event insert the follo,ving code:

l 2 3 4

$textbox50_TextChanged={ If ($textbox50.Text-ne "") { $buttonAnalyzeFileShares.Enabled =$true } }

5 6

318

I PowerShell Studio f.

A Comprehensive Guide

In the editor for the Enter event insert the following code:

7 $textbox50_Enter={ 8 $WatermarkText_dir ='Enter Path (example\\server\myfiles or v:\myfiles)' '9 if ($textbox50.Text -eq $WatermarkText_dir) 10 { 11 #Clear the text 12 $textbox50.Text = "" 13 $textbox50.ForeColor = 'WindowText' 14 } 15 16

}

g.

In the editor for the Leave event insert the following code:

17 $textbox50_Leave={ 18 $WatermarkText_dir ='Enter Path (example\ \server\myfiles or v:\myfiles)' 19 if ($textbox50.Text -eq "") 20 { 21 #Display the watermark 22 $textbox50.Text = $WatermarkText_dir $textbox50.ForeColor = 'DarkGray' 23 24 $buttonAnalyzeFileShares.Enabled =$false } 25 26 27

}

The Enter and Leave events are designed to display the WaterMark "Enter Path (exa1nple \\server\1nyfiles or v :\nl)'files)" when the textbox is e1npty, and also to disable the "Analyze FileShares" button if empty. 3.

Next let's work on the "Analyze FileShares" button (buttonAnalyzeFileShares). In this example, I 've added an arrow iinage to the button but it isn't necessary, you ca11 add do this using the "linage" property of the button, and adjusting the "IinageAlign" property. a. Create a Click event for the button (right-click and choose Edit Default Event). Then go to the editor and use the follo\viI1g code \Vithin the $buttonAnalyzeFileShares_ Click Event.

28 29 30 31 32 33 34 35 36 37 38

$buttonAnalyzeFileShares_Click = { # First we clear the contents of the DataGridView $datagridview22.Rows.Clear() # Disable and change the text of the "Analyze Fileshares" button $buttonAnalyzefileShares.Enabled =$false $buttonAnalyzeFileShares.Text = " ... Processing" $ErrorActionPreference = 'SilentlyContinue' # Set the ProgressBarOverlay step and set value to O $progressbaroverlayl .Step= l $progressbaroverlayl .Value= 0 # Clear the Status Messages box

PowerShell Studio - Example Projects 39 40 41

1111

$rich textbox81 .Text = $richtextbox81.AppendText("Analyzing Directories .... Please Wait ' n") 42 [System.Windows.Forms.Application]::DoEvents() 43 # Grab the parent folder file path from the text box 44 $item = $textbox50.Text 45 $every= "-Every" 46 $FormatNumbers = "-Forma tNumbers" 47 # Script-level variables used with -Total. 48 [Ulnt64]$script:totalcount = 0 49 [Ulnt64]$script:totalbytes = O #region Get Directory 50 51 function Get-Directory

52 53 54 55

{ param ($item) if (Test-Path -Path $item -PathType Container)

56 57 58 59 60 61

{ $item = Get-Item -Path $item -Force } if ($item -and ($item -is [System.10.Directorylnfo])) { return $item }

62 63 64 65 66 67 68 69 70 71

72

} #endregion #region Format-Output # Filter that outputs the custom object with formatted numbers. function Format-Output { process

{

73 74 75 76

$_

@{ Name ="Files"; Expression = { "{O:NO}" -f $_.Files

77

} },

78 79 80 81

@{ Name = "Size"; Expression = { "{O:NO}" -f $_.Size }

82 83 84

I Select-Object Path,

}

}

I 319

320

I PowerShell Studio -

A Comprehensive Guide

85 86 87

} #endregion #region Get Stats

88

# # # #

89 90

Outputs directory statistics for the specified directory. With -recurse, the function includes files in all subdirectories of the specified directory. With -format, numbers in the output objects are formatted with

91 92

the Format-Output filter. function Get-DirectoryStats

93 94 95

{ param ($directory, $recurse,

96 97 98

$format) $1astaccess = $directory.LastAccessTime

99

$attrib = $directory.attributes $directoryname = $direc tory.Fu11Name I Out-String $files= $directory I Get-Childltem -Force -Recurse:$recurse

100

l0 l

I

Where-

Object { 102

-not $_.PSlsContainer } [System.Windows.Forms.Application]::DoEvents()

103 104 105 if ($files)

106

{

107 108 109

$richtextbox8 l .A ppendText("Calculating $directoryname") [System. Windows.Forms.Application] ::DoEven ts() $output= $files

110

I

Measure-Object -Sum -Property Length

I

Select-Object '

lll

@{ 112 113

Name ="Path"; Expression = {

114 115

}

$directory.Fu11Name

},

116

@{ Name ="Files"; Expression = {

117

$_.Count; $script:totalcount +=$_.Count

118 119 120

} },

121

@{ 122 123

Name = "Size"; Expression = {

124

}

125

$_.S um; $script:totalbytes += $_.S um }

PowerShe ll Studio - Example Projects

I 321

} else {

126 127 128

$output=""

129

I Select-Object ' @{

130 131 132

Name ="Path"; Expression = {

133 134

}

$directory. FullName },

@{

135 136

Name = "Files"; Expression = {

0

137

}

138 139

},

@{

140 Name ="Size"; Expression = {

141 142 143

0 } }

144 145

}

146 147

if (-not $format)

{

148 149

$dir =$output.Path $File_count =$output.Files

150 151

$Dir_size = ([System.Math]::Round($output.size /1 MB, 4)) $owner= Get-Acl $dir I select -expand Owner If ($File_count -eq "O" -and $Dir_size -e q "O")

152 153 154

{ $datagridview22.Rows.Add("$dir", "Access Denied or Empty

155

Fo Id er, " '"', "'I) 156 157 158 159

} else { $datagridview22.Rows.add ("$dir", "$File_counf', "$Dir_size MB", "$1astaccess", "$attrib", "$owner")

160

}

161 162 163 164 165 166 167 168 169

[System.Windows.Forms.Application]::DoEvents()

} else { $dir =$output.Path $File_count= $output.Files $Dir_size = ([System.Math]::Round($output.size /1 MB, 4)) $owner= Get-Acl $dir I select -expand Owner If ($File_count -eq "O" -and $Dir_size -eq "O")

322

I PowerShell Studio -

A Comprehensive Guide {

170 171

$datagridview22.Rows .Add ("$dir", "Access Denied or Empty Folder", "", '"')

172 173 174 175

} else { $datagridview22.Rows.Add ("$dir", "$File_counf', "$Dir_size MB", "$1astaccess", "$attrib", "$owner")

176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 21O 211 212 213

} [System.Windows.Forms.Application] ::DoEvents() } } #endregion # Write an error if the item is not a directory in the file system. $directory= Get-Directory -item $item if (-not $directory) { $itempath = $item I Out-String $richtextbox81 .AppendText("$itempath is not a directory in th e file system.") $buttonAnalyzeFileShares.T ext= "Analyze FileShares" $buttonAnalyzeFileShares.Enabled =$true $textbox51 .Text = "Finished" return } # Get the statistics for the first-level directory. Get- DirectoryStats -directory $directory -recurse:$true -format:$true # Get the subdirectories of the first-level directory and get the statistics # for each of them. $Targets= ($directory I Get-Childltem -Recurse -Directory I Measure-Object $_.Count }) $progressbaroverlayl .Maximum= $Targets $textbox5 l .Text= $targets $directory I Get-Childltem -Force -Recurse I Where-Object { $_.PSlsContainer } I ForEach-Object { Get- DirectoryStats -directory$_ -recurse:$true -format:$true $progressbaroverlayl .PerformStep() $Targets= ($Targets - l) $textbox51.Text =$targets }

I

%{

PowerShe ll Studio - Example Projects 214 215 216 217 218

4.

I 323

$progressbaroverlayl .Value= $targets $bvttonAnalyzefileShares.Text ="Analyze FileShares" $buttonAnalyzeFileShares.Enabled = $true $textbox51.Text ="Finished" }

Click on the small triangle in the upper right comer of the DataGridView, select Add Column. Add the following columns; FileShare Path, Total Files~ Total Size, Last Accessed, Attributes and Owner. For each colum11 check both the Visible and Read Only check boxes.

~ -~ ~ Sliare -P_alh _ __.==~-Tclal -Res --==~-Tdal -S -z-o--==~-lasl ~Q~ ----====---i'tttb.t --M---======--OWnor ---===~-~jl' ~rldV'iewTllSks ,,.;ijl

Choose Data Source: f{nOn'el

x

7

-'dd Column

~-----==:___===,

'

Oat~~

~nlhePa~

t

Edll! Columns...

tf'dd Co!um_n_ ... _ 0

Enable Adding

0 0 0

Enable Editing Enable Deleting Enable Column Reordering

OocJc an Parent Container @~colrM

6

Name:

leoum1

Type:

IDetaG!esktop\JEFF+IP. CadieExport

ID

Local Cache Status PowerSheD V2 32 B.it: - Building •.• PowerSheU V2 64 Bit: -Building •, • PowerShell V3 32 Bit: - Building •.• PowerSheU V3 64 Bit: - Building •.• PowerSheU V4 32 Bit: - Building •.. PowerShell V4 64 Bit:

-Bu~ding

•.. -

PowerShell VS 32 Bit: - Building •.. PowerSheU VS 64 Bit: - Building •.• -

Save

Close

Depending on platform and PowerShell versions installed this process takes a fe,v minutes to co1nplete. Once finished, you should see so1nething like this:

I 329

PowerShell Studio - Reference Guide

Click on the "Save" button to save the newly built cache files to an export file. The default location for this is your desktop. The file is na1ned with your computers name and a .CacheExport extension. Please do not modify the name of the file, because this naine is \V hat PowerShell Studio will use to fi11d that remote 1nachine on a network. The CacheE>q)ort utility \Vill automatically close after you click "Save". Take that file a11d copy it back to your flash drive, network share or whatever location you can access fro1n your develop1nent macltine.

IMPORTING REMOTE CACHE FILE After you have exported the remote cache from your target remote system, the next step is to i1nport the remote cache file into PowerShell Studio located on your development syste1n. Click on the "Import Remote Cache" button located in the Platfonn section of the Ribbon Bar.

LocalMadme ~vs

0

- 32Bit

>e'\ ~ P

re II

+~

A dialog window will open, select the previously exported cache file for the remote system.

Platform '

x >

Organize •

This PC

>

Desktop >

v Cl

p

Search Desktop

New folder

£ OneDrive c:3 This PC Desktop

istatus

I-Status Graphics

Jeff

JeffHolder Cloud

knowledgebase2 23

Mastering PowerShell

New folder

New Graphics

ReelSchematic

ReelSchernaticl

Source

status display

SURVIVEOUTDO OR

SurviveOutdoor Backup

Work

JEFF-HP.CacheEx port

~ Documents

..J. Downloads Ji Music

'- I Pictures Videos :;_ OS (C:) -

HP_RECOVERY (

_ Secondary (F:)

fj

f

CD Drive (G:)

_ Data locker (H:) _ Datalocker (H:)

o.;

SurviveOutdoor Book

SurviveOutdoor Product Labels

File name: IJEFF-HP.CacheExport

Tungstenlube

tungstenlube.co m

v

I

Cache Export Files (".CacheExpc v Open

1•1

Cancel

330

I PowerShell Studio -

A Comprehensive Guide

lrnport Rernote Cache Remote Machine:

JEFF-HP

OK

Remote Connection

Cancel

D Using VVindo'l\•s Pol/\ erShell Remoting D Using RSEE Remoting 1

Credentials

Username:

No"v, you have hvo options for connection to the re1note system, either Windows PowerShell remoting or RSEE Remoting. Depending on your selection so1ne of the following options may not be available to you. If you plan on using Windows Remoting to run scripts on this machine you may have to provide a valid user id and pass\vord for that computer. If you are using RSEE (Re1note Script Execution Engine) to connect to the remote inachine no credentials are necessary. If you plan on just running or testing script on that remote machine and you already have Windo\VS Remoting \ivorking, there is no need to install RSEE there. If on the other hand, Windows Re1noting is not an option or you need to debug on that remote computer, installing the RSEE service on the target 1nachine is reco1nmended.

Local Madine

Local Machine JEFf +iP ~~----_,,,,___ ..___.

""' Platform

Once you have the cache infor1nation imported you can select the machine from the platform combo box: Once you have selected this other machine as your target enviromnent you will see c1ndlets colored according to \Vhat exists on this machine but not your local co1nputer.

If you selected Windows Remoting as the remote connection to this other 1nachine you can use the Re1note Console button to open a console to the re1note machine. This console can co1ne in hand to verify that scripts you ran did the right thing and conditions are what you e>..'J)ect them to be.

JEFF-HP

, ...,

a

vs -

0

»< ~ £11 +~ Fe II ~ Platform /

32 Bit

]

...,

I I

The first time you click on the Remote Console button a new console will be added to your list of embedded consoles. You can al\vays use this button to bring up the corresponding console for your target machine. Additionally, you can also select the remote console fto1n the list even if you are using your local machine or some other computer as target.

PowerShell Studio - Reference Guide

I 331

Both Windovvs Re1noting ai1d RSEE use the highest available endpoint when nmning a script remotely. That 1neaI1S that eve·n if you don't have PowerShell V3 installed locally, it ':vill run in V3 on the remote machine. Likewise, if you have a 32-bit inachine and the remote machine is 64-bit yot1r script will execute in a 64-bit Po\verShell instance . (RSEE depends on whether you installed the 32-bit or 64-bit version of the service.) No':v you can edit and 11111 sc1ipts against re1note systems fro1n the comfort of yotir ovvn development computer.

REMOTE SCRIPT EXECUTION ENGINE (RSEE) The Remote Sc1ipt Execution Engine™ (RSEE™) is an enterprise-level remote script e-xecution e11viro1u11e11t. It consists of two components: The client, ':vllich is built into PowerShell Studio, and a re1note service that must be deployed to each con1puter \vbere you \¥ill remotely run scripts. RSEE is capable of deploying a sc.ript fro1n \vitllin Po\:verShell Studio out to reinote co1nputers where the script is executed, and bringing the scripts' output and results back to PowerShell Studio for yotu review. RSEE is a complex tool a11d it interacts closely with Windows' security subsystems. RSEE is recornme11ded for use only by experienced Windows adn1iitistrators wl10 f1tlly understand service deploy1nent and inanagement, crossco1nputer secmity and authenti.cation and, in the case of don1ain environn1ents, Group Policy objects and Active Directory ad1ninistration. Apart fro1n tl1e guidelines in tllis nianual, SAPIEN Teclu1ologies caiu1ot assist you with security issues caused by improper configuration nor can \Ve assist \Vith Active Directory, Group Policy, or local computer configuration tasks. RSEE is designed only for Windo,;vs Script Host (WSH) scripts in VBS (VBScript) or JS (JSc1ipt) files. It is not designed for otl1er WSH scripts (including WSFs) nor is it designed for scripts \.Vritten in other languages (such as batch KiXtart, and so forth). 7

RSEE DeJlloyment

RSEE's service component is packaged in a Microsoft Windows Installer (MSI) file and is sttitable for deployn1ent via Group Policy. You can also 111anually install it on individual machlnes. Keep in 1nind t11at, once installed, the se1v ice needs to be started in order to be useful. Tllis will occur auto1natically after restartiJ1g the computer on wltich the service is installed (the service is set to strut auton1atically by default). After deploying the service, there are a ntunber of configuration steps that you must take in order to properly configure RSEE in your environment. Identity

RSEE installs, by default, to log in u11der the privileged Loca.lSystem accou11t. This may be s11fficient for your purposes. However when deployi11g scripts in PowerShell Studio, be sure not to specify any credentials in the Launch dialog box. Also, be advised that the LocalSyste1n account may not be able to execute son1e scripts, depending on their security require1nents.

I PowerShell Studio -

332

A Comprehensive Guide

We recommend that you co1tligure the RSEE service to nm under a l1ser account tliat has adntinistrative privileges on the local co1nputer. In a workgroup ei1vironment, this would be a local acco1mt, and we reconunend creating tlle same local accom1t (with tlle same pass,vord) on all of your co1nputers, for consistency. In a don1ain enviro11filent, '1Ve reconm1end creating a single domain. account '1Vhich has local adnunistrative rights on all co1nputers in the do1nain, and using this accolmt to nm t11e RSEE se1v ice. Whenever the RSEE service is nllllling under a user account, you must specify that account (and its pasS\:vord) when deploying scripts in PrirnalScript. When using RSEE, you have the option to specify the credentials 11uder vvhicl1 tlle script should execute. Generally speaking, you need to provide the sa111e credentials that the RSEE service is using to log on. TCP Port

The RSEE se1v ice defaults to using TCP port 9987 for incon1ing com1ections, and TCP port 9988 for outgoing connections. It is your responsibility to ensure that any local firewalls \:vill permit inco1ning traffic on tllis port. Keep in n1ind that the Windoivs Fire\.vall (Windo,:vs XP SP 2 and later. and Windows Seiver 2003 SP 1 and later) can be centrally configlrred via a do1naiI1 Group Policy object. You can specify a different port: •

Via the Registry - The key is HKEY_LOCAL_MACHINE\Soft\vare\Policies\Sapien . The Value nan1e is InPort (for the inco1ning port) and OutPort (for the outgoing po1t). Note that these values are n1ost easily configured by 111eans of a Group Policy object (GPO), and we provide a ten1plate (ADM file) tl1at can be i111ported into a GPO to co1Ifi gure RSEE.

Both Po"VverShe11 Studio (as the RSEE client) and the RSEE service utilize InP01t ai1d OutPort. The service listens to InPort for iI1conling connections and uses OutPort to send script output back to the client. The client reverses this: scripts are sent via InPort ai1d results are received on OutP01t. The registry key above con.figures tl1ese ports for both clients and the service. Domain Tips

While manually configuring a few co1nputers in a workgroup is not a hardship, mai1ually corrfig1rri11g ai1 entire don1ai.n of computers can be burde11So1ne. Al1 Active Directory do1nain environment provides a nu111ber of capabilities for centraliziI1g and auto1nating this configuration, ho'1vever. While this section is not iI1tended as a comprehensive t11torial in Active Directory (we recornmend tllat you consult an e~'Perienced Active Directory ad1ni1tistrator or the appropriate docun1entatio11 if you need inore assistance), the following tips should help you configure RSEE more easily: • •

Create a don1ain accou11t. Name this account son1ething like "RSEEUser" ai1d provide it with a strong password per yo1rr organization's password policies. Deploy the RSEE service. This cai1 be done by meai1s of a Group Policy object (GPO) linked to the appropriate levels in the domain. The RSEE se1v ice defaults to running under the LocalSystem account and it defaults to port 9987. The service's MSI is in tlle RSEE folder under your PrimalScript Enterprise installation folder.

PowerShell Studio - Reference Guide •





I 333

Make the RSEE service account a local Ad1ninistrator. You can do tllis in a Group Policy object (GPO). Bro"vse to Computer Configuration > Security Settings > Restricted Groups. Add a group ("Administrators") ru1d U1en add your RSEE domain account (a11d any other appropriate accounts) to the group. Configure the RSEE service. You need to configure the RSEE service to log 011 ' viU1 tl1e user account (ru1d pass\vord) you created. This can either be done 1nanually or using a script. The book 1if;indoH'S Adn1inistrator's A11ton1ation 1'oo/kit, for example, contains a script that can set the logon account and pass,vord used by services nnming on multiple computers. Utilities like Senice Explorer (W\V\V.scriptlogic.co1n) can perfonn the sa1ne task. Select the TCP port. We provide a Group Policy object (GPO) administrative template (ADM file) that you can import into a GPO a11d use to centrally configure the TCP port used by the RSEE service. Tllis ADM file is located in the RSEE folder under your PrimalScript Enterprise installation folder.

UsingRSEE

RSEE no' v supports Po,versbell. To deploy the current script (only VBS and JS files are currently supported) to one or more ren1ote co1nputers that have the RSEE service installed, click the RSEE button on the Seri.pt toolba.r. or select Run Script on Re1note Co inputer from the Script menu. RSEE perfom1s a quick scan of your script to look for con111umds tliat nrighl create a graplrical user element such as U1e VB Script MsgBox() function. If it finds any of these functions, it displays a wanti11g message. Keep in 1ni nd that scripts \Vill not nonnally be able to interact \·riU1 the desktop en ironment on remote computers, n1eaning there ':vould be no \Vay for someone to respond to graphical elements such as MsgBox() or InputBoxO. Thus. these ele1uents can cause the script to "hang" and stop respo11ding. RSEE does not perfom1 an exhaustive check for graphical ele1nents: it is your responsibility lo ensure they're not used in your scripts. RSEE ' vill allow you lo continue \Vitb graphical elements because you may have configured lhe RSEE service to interact \Vith the desktop of U1e ren1ote computer. It's your decision. Next is the RSEE Lat1nch dialog. The Launch dialog lists the computers \\·here your script \Vill be deployed. Note that tl1e Launch dialog a.l'vays preloads a default list of co1nputer11an1es at startup. Here's '\'hat you can do: • • • •



Click Launch lo run the sc1ipt on the computers "''hicb have a checklnark next to their na1ne. Set or clear the cJ1eckbox next to one or inore computer na1nes. You can .leave nan1es in the list but clearing their checkbox 'rill prevent RSEE f ro1n at1en1pting to run the script on them. Click Close to close the Launc.11 dialog. Ifyou've changed the list of computer nan1es. yo111ll be prompted to save your changes. Use Load List and Save List to load an alternate list of computer names (from a text file) or saYe the current list to a te:\.1 file. By default, Prima.lScript vvill look for a te}.1 file called Default.clt in the \SAPlEN\RSEE Lists folder under your Documents folder. You \ Vill need to create the file youiself if you want a pre-loaded list 'vhen you launchRSEE. Use Select All and Unselect All to set or clear the checkbox next to all computer ruunes currently in the list.

I PowerShell Studio -

334 • • •

A Comprehensive Guide

Select a computer name and click Remove to remove it from the list. Type a computer i1ame (1nust be resolvable to an IP address by your computer) or IP address and click + to add that computer to the list Specify a usernatne (user ID) and password. These will be used to run the script on tihe ren1ote con1puter, and should generally 1natch the usen1a1ne that tl1e ren1ote RSEE senrice is usiJ1g to log in. Note: if the usen1ame you specify is a local account on the remote computer(s). then just type tl1e use1name. If the usen1rune is a do1nain account, specify the name in the fonnat user@domai11 The older domain\user format is not supported.

When you click Launch, RSEE will execute the script on the ren1ote computer(s) . .Any output produced by the script \vill be displayed in the Output tab vvithin the Po,.verSl1ell Stl1dio vvindovv. Note that the message "Socket connection failed" i11dicates that RSEE was unable to connect to the RSEE service on a specified con1puter (eitl1erbecause the co1nputer is not connected to the netvvork, bas a firewall blocking the RSEE service po1ts, or the RSEE seivice is not installed). RSEE deploys scripts asynchronously. That is, RSEE sends the sc1ipts out to th.e remote con1puters you've selected and then displays \Vhatever results co1ne back. If your scripts produce no output, then you won't see any results in PovverShell Studio. It's possible for the RSEE seivice on a remote co111puter to n1n into a problem (particularly secu1ity-related ones) that it can't report back: in these insta11ces, it vvill see1n to you (looking at PovverSbell Studio) as if nothing has happened. Whenever possible, your sc1ipts should incorporate error-checking and -trappil1g: and should produce appropriate output so that you get so1ne res1ilts back if the script executes con·ectly. RSEE cannot be used to deploy a script for later execution. If you need to schedtile a script to execute on a remote computer at a particular tin1e, use Windows' built-in Task Scheduler instead of RSEE. You can even write a script utilizing the SCHTASKS.EXE comnw1d line tool tliat creates re1note scheduled tasks on multiple co1nputers. Also. if an Output tab is already open in Po\verShell Studio, RSEE will utilize it rather tlian creating a nevv one. You \!Vill need to 111anually select the tab to vie'v any RSEE results or error 1nessages.

RSEE Restrictions In order to bring the output of re1note scripts back to your coinputer. U1e ren1ote RSEE senrice captl1res tl1e standard conlffiand-line output of your scripts. That n1eans any sc1ipt output 1nust be created using the WScript.Echo 1nethod. Do not use graphical user interface functions sucl1 as MsgBox() or InputBoxO. Because the RSEE se1vice doesn't interact vvith the desktop, nobody will ever see these functio1is' dialog boxes and tl1e script vvill hang. It is possible, if the RSEE service is .n1nning under the LocalSystem account, to configiue Wil1dows to allow the service to interact with the desktop. You may vvish to e>..rperiment witl1 this configuration, but it is not a recom1nended configuration because of the usual security restrictions on the LocalSystem account. Also, avoid any object inethods-such as WScript.Popup-that create graphical elements.

PowerShell Studio - Reference Guide

I 335

Any objects referer1ced by a script must be installed, registered, arid available on the rernote inachil1e where RSEE executes tl1e script. At tltis time, RSEE can only be used to execute Windo,vs Script Host scripts. RSEE explicitly launches scripts tmder CScript.exe \Vhich must be available on the re1note computers. Most otl1er restrictions in RSEE are actually Windows sectlrity restrictions. When the RSEE service launches, it does so using the credentials you configure in Windo\.vs' service 111anager. When the RSEE service receives a script, it creates a brar1d-ne\.v process usi11g whatever credentials you enter into tl1e RSEE Launch dialog. The following figure illustrates this process a11d tl1e tlrree sets of credentials involved: RSEE LAUNCH DIALOG CREDENTIAL #2

SCRIPT

SCRIPT

CREDENTIAL #2 USED

RSEE SERVICE CREDENTIAL #3

Always bear in mind that your scripts execute under the sectlrit)' credentials you provide (Credentials #2 il1 the diagra1n). Tltis process does require your attention, as several things can go \.Vrong if you're not careful: •

If, in the Lau11ch dialog, you specify credentials (#2 il1 the diagrai11) that the RSEE se1v ice account (#3 in

the diagrain) doesn't have perntission to use in a ne'v process launch, then script execution will fail. Practically speaki11g, the credentials you provide in the Lam1ch dialog (#2 in the diagram) need to be the same as the credentials the RSEE service uses to log in (#3 in the diagTam). •





If the RSEE service accotmt (#3 in the diagra1n) doesn't have appropriate rights (including "Log on as a

service"), tl1en the RSEE service will not be able to start. If your script tries to do so1nething that the Launch credentials (#2 il1 the diagrain) don't have permission to do-such as log into a database or access a file share-then you'll receive an error. Depending on the exact situation, this may or may not be co1mnunicated back to you in PowerShell Studio. If your script tries to pe1fonn an illegal operation-such as specifying alternate credentials in a WMI connectio11 (which is illegal because the script is executing locally on the re1note macltine, ai1d local connections to WMI aren't allowed to use alternate credentials)-you'll receive ai1 error. Again, depending on the exact circumstances, this error inay or n1ay not be fed back to you in Po\verShell Studio.

I PowerShell Studio -

336

A Comprehensive Guide

These and other similar situations are not problems 'vith RSEE; they are inherent conditions of the Windows operating system ru1d its security subsyste1ns. Whenever you encounter an error with RSEE, bear these conditions in inind and think about the possible security ramifications of what your script is trying to do. RSEE encrypts scripts during trans1nission to help keep the1n secure. RSEE does not implement ru1y sort of IP filtering capability ('vhich might, for exa1nple, allow you to ensure that only your co1nputer can utilize RSEE on re1note servers). Instead~ \Ve reco1n111end using Windo\vs' o'vn built-in IP filtering (available as part of Windo,vs' IPSec features) . Using this filtering,.you can ensure that only specified IP addresses are allo\ved to collllnunicate on the TCP ports used by the RSEE service, thus restricting who can contact that service and utilize RSEE.

SINGLE THREADED APARTMENT (STA) STA Mode - Single-threaded apartment. The default is multi-threaded apartment.

STA (Single Threaded Apartment) and MTA (Multi-Threaded Apartment) detennine how a process manages legacy COM objects and tl1eir collllnunication with inultiple threads. I \Vill not go into the detail, but you need not concern yourself 'vith the inner workings of COM objects, other than to reme1nber that STA is required for some of the GUI controls to function correctly. The follo"ving controls require STA mode. Othenvise, they do not appear. • • •

FolderBrowserDialog SaveFileDialog OpenFileDialog

The follo\ving control features require STA mode. • • • •

TextBox with AutoC01npleteSource Co1nb0Box with AutoC01npleteSource DataGridView 'vith Ctrl + C to copy text in cells. Form with TopJ\!fost property set to True.

STA mode is not so1nething you normally have to consider when writing scripts, but it is something that you should be a'vare of if you are creating GUis tools. Most GUis will n111 fine in MTA mode, but as a rule, you should always n1n your GUI scripts in STA You can make sure that your Windows PowerShell scripts require STA vvhen running. If you add the following comn?.ent to your script, Po·werShell Studio and Prima/Script run the script in STA mode: #

o/oForceSTAo/o = True

PowerShell Studio - Reference Guide

I 337

PSSCRIPTANAL YZER ~ Check Syntax '· ~ Venfy Salpt ,, ~ Analyze Saipt

PSSc1iptAnalyzer is a PowerShell 1nodule developed by the PowerSl1ell Tean1 at Microsoft and checks the quality of Windo,vs PowerSl1ell code by n1nning against a set of rules. The ntles are based on PowerShell best practices which have been identified by the PowerShell team and PowerShell Co1n1nunity.

Analyszs

PSScriptAnalyzer is built into Po'\>verShell Studio for convenience of use, located lmder the "Tools" tab, in the Analysis section, and na1ned "Analyze Script". We you click on "Analyze Script", PSScriptAnalyzer will scan your Po"verShell code, and return a report of any findings similar to the report below: >> A!lalyzing Script (test.psf) ••• PSScriptAnalyzer 1.8.1 test.psf (233, 10): Warning: Function 'Update-OataGridView' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. test.psf (70, 12): Warning: The C111dlet 'Get-OirectoryStats' uses a plural noun. A singular noun should be used instead. test.psf (130, 29): Warning: 'select" is an alias of 'Select-Object'. Alias can introduce possible problems and make scripts hard to ~aintain. Please conside test.psf (146, 29): warning: 'select· is an alias of 'Select-Object·. Alias can introduce possible problems and make scripts hard to maintain. Please conside test.psf (177, 81): Warning: 'X' is an alias of "forEach-Object'. Alias can introduce possible problems and make scripts hard to maintain. Please consider ch test.psf (300, 10): Warning: The cmdlet "load-OataGridView' uses an unapproved verb. test.psf (446, 7): Warning: Empty catch block is used. Please use Write-Error or throw statements in catch blocks. test.psf (6, 1}: Warning: The variable 'richtextbox8l_TextChanged" is assigned but never used. test.psf (201, 1): warning: The variable 'textbox56_TextC~anged' is assigned but never used. test.psf (209, 1): Warning: The variable 'textbox50_Enter' is assigned but never used. test.psf (220, 1): warning: The variable 'textbox50_Leave' is assigned but never used. test .psf (12, 2}: Warning: The variable 'buttonAnalyzefileShares_Click' is assigned but never used. test.psf (23, 3): warning: The variable 'every' is assigned but never used. test.psf (24, 3}: warning: The variable 'Fon11at"umbers' is assigned but never used . >> Analyzing Script Cotr.pleted (14 items: 0 Errors, 14 Warnings, 0 Information)

SCRIPTPATH IN HOST Many PowerShell users utilize code as shown belo"v to determine \.Vhere the running script resides: 219 function get-scriptdirectory{ 220 $invocatioh=(get-variable Mylnvocation -Scope 1).Value 22 1 Split-Path $invocation.myinvocation.path 222}

Unfortunately, if the script nms inside a custon1 host, such as PowerShell Studio 's intenlal host, for a good number of debuggers and the SAPIEN PowerShell host from the PowerShell Studio packager, the MyInvocation variable contains an empt)r path member. There is no docu1nented way to set My Invocation fro1n a custom host and any atten1pts contacting Microsoft iI1 this matter only resulted in confinnation that any atte1npt to do so would be ove1writte11 anyway. It see1ns unreasonable to eA--pect the Po,verShell tea1n to change the API anytime soon. And even then, changing the current behavior nlight prove m1desirable since it could potentially break existing scripts. That of coluse leaves everyone implementing a custom host with a dile1nma. The SAPIEN Po"verSl1ell hosts no"v all contain a variable called $Hostlnvocation \Vhich has the same interface as My Invocation and provides the desired infoanation.

338

I PowerShell Studio -

A Comprehensive Guide

So, if you are running your script inside any SAPIEN PowerShell host you can use code like tbis to determine where your script is: 223 function get-scriptdire c tory{ 224 if ($hostinvocation -ne null) { 225 Split-Path $hostinvocation .MyCommand.path 226} 227 else { 228 $invocation=(get-variable Mylnvocation -Scope 1).Value 229 Split-Path $invocation .myinvocation.path 230 }}

CONVERTING HEX# COLOR NUMBERS There are ti1nes, especially when using the ColorDialog control and you need to translate the HEX# color i1m11ber to a usable format for controls and fonns. If only basic colors are used, then the translation fro1n HEX# is not needed. To translate the color picked from the ColorDialog control use the following example: 1 2 3 4 5 6 7 8 9

$buttonChangeColor_Click = { # Open the ColorDialog Box $colorDialogl .ShowDialog() # Grab the color that the user selects $BackColor = $colordialog l .Color.Name #Translate the HEX# to a System Drawing Color for the Form Background $BackColor = [System.Drawing.ColorTranslator]::FromHtml('#' + $BackColor) # Apply the color to the form $form l .BackColor = $BackColor }

REQUIRE ADMINISTRATOR There are many times that you need your form to run with elevated privileges. The standard "vay has always been to place the follo\iving code either at the start of your script, or at the start of the Fonn_Load event. 1

3

If (-NOT ([Security. Principa l. Windows Principal] [Security. Principal. Windowsldentity] ::G etCurren t() ) .lsln Role ( [ Security.Prin cipal. WindowsBuiltlnRole] "Administrator")) {[void] [System.Windows.Forms.MessageBox]::Show('This form must be Run As Administrator!", "Error Message") $FORM l .close()

4

}

2

PowerShell Studio - Reference Guide

I 339

NOTE: this is one of those rare occasions when code does not require that it be started by an event eitl1er directly

or indirectly. If the user is not n1nning tl1e form as ad1ninistrator they will receive an error inessage popup, and the form will

close. Tbis inethod works "vith all PowerShell versions and provides you a ineans to display a custon1error111essage. Beginning with PowerSbell 4.0 you cottld also use: 1

#requires -runasadministrator

NOTE: Keep in mind this will reqttire that all users that run your form '\ivill need to have at least PowerShell

version 4 installed.

CONTROL PROPERTIES BUTTON

AccessibilityObject AccessibleDefaultActionDescription AccessibleDescription AccessibleName Accessible~ole

AllowDrop Anchor AutoEUipsis

AutoScrollOffset AutoSize AutoSizeMode BackColor Backgroundlmage Background Im ageLayou t BindingContext Bottom Bounds

•Gets the AccessibleObject assigned to the control. Gets or sets the default action description of the co11trol for use by accessibility client applications. Gets or sets tl1e description of the control used by accessibility client applications. Gets or sets the name of the control used by accessibility client applications. Gets or sets the accessible role of the control Gets or sets a value indicating \.vhetl1er the control can accept data that the user drags onto it. Gets or sets tl1e edges of the container to \Vhicl1 a control is bound and determines how a control is resized with its parent. Gets or sets a value indicating vt'hether the ellipsis character (... ) appears at tl1e iight edge of tl1e control, denoting that the control text eA1:ends beyond the specified length of the control. Gets or sets where tlus control is scrolled to in ScrollControllnto Vie\.v. Gets or sets a value that indicates whether the control resizes based on its contents. Gets or sets the mode by which the Button automatically resizes itself. Gets or sets the background color of the control. Gets or sets tl1e backgrotu1d image displayed in the control. Gets or sets the background image layout as defined in the lmageLayout ent101eration. Gets or sets the BindingContext for the control. Gets the distance, in pi\:els, benveen the bottom edge of the control and the top edge of its contai11er's client area. Gets or sets tl1e size and location of the control il1cluding its nonclient elements, in pixels, relative to the parent control.

340

I PowerShell Studio -

CanEuablelme CanFocus CanRaiseEvents CanSelect Catlture CausesValidation

ClientRectan gle ClientSize Com1•anyName Container ContainsFocus ContextMenu ContextMenuStrip Controls Created CreateParams Cursor DataBindings DefaultCursor Defau ltlmeMode DefaultMargin

DefaultMaximumSize Defau ltMinimu mSize DefaultPadding DefaultSize DesignMode DialogResult DisplayRectangle

Disposing Dock Dou bleBuffered Enabled

A Comprehensive Guide

Gets a value incticating whether the lmeMode property can be set to an active value. to enable IME support. Gets a value indicating '~hetl1er U1e control can receive focus. Detennines if events can be raised on the control. Gets a value indicating \ V hetl1er the control can be selected. Gets or sets a vaJue indicating \'V heU1er the control has captltred the mouse. Gets or sets a value indicating 'vhether the control causes validation to be performed on any controls that require validation \vhen it receives focus. Gets the rectangle that represents the cliet1t area of the control. Gets or sets the 11eight and width of the client area of tl1e control. Gets the ruun.e of the co1npru1y or creator of the application containing the control. Gets the IContainer that contains the Component. Gets a value indicating \vhether the co11trol, or one of its child controls. currently has the input focus. Gets or sets the shortcut men11 associated with the control. Gets or sets the ContextMenuStrip associated "'-itb thls control. Gets the collection of controls contained \\1ithin the control. Gets a , ralue indicating whether the control bas been created. Gets a CreateParams on U1e base class 'vhen creating a 'vindo,v. Gets or sets U1e cursor U1at is displayed \¥hen the mouse pointer is over the control. Gets the data bit1dings for the control. Gets or sets the default cursor for the control. Gets the default Input Method Editor (IME) mode supported by this control. Gets the space. in pixels. that is specified by default bet,·yeen controls. Gets the length ruid heigl1t in pixels. tliat is specified as U1e default maximun1 size of a control. Gets the length and height in pixels. tliat is specified as the defa1tlt 111inin111m size of a control. Gets U1e internal spacing, in pixels, of tl1e contents of a control. Gets the default size of the control. Gets a value that indicates ivl1ether the Co1nponent is currently in design n1ode. Gets or sets a vaJue that is rettuned to the parent forn1 when the button is clicked. Gets the rectangle that represents the display area of the control. Gets a value indicating \:vbether the base Control class is in tl1e process of disposing. Gets or sets which control borders are docked to its parent co11trol and determines ho':v a control is resized ':vith its parent. Gets or sets a value indicating \·vhether this control should redravv its surface using a secondary buffer to reduce or prevent flicker. Gets or sets a value indicating \Vhether the control c ai1 respond to user interaction.

PowerShell Studio - Reference Guide.

I 341

[

Events FlatAppearance FlatStylc Focused Font FontHeight ForeColor Handle Has Children Height Image ImageAlign lmagelndex lmageKey lmageList lmeMode

ImeModeBase InvokeRequired

lsAccessible lsDefault IsDisposed IsHandleC reated lsMirrored LayoutEngine Left Location Margin Ma.~imumSize

MioimumSize Name Padding Parent

Gets the list of event handlers tl1at are attached to this Component. Gets the appearance of the border and the colors used to indicate check state and 1nouse state. Gets or sets the flat style appearance of the button control. Gets a valu.e indicating whether the control l1as inpt1t focus. Gets or sets the font of the text displayed by the control. Gets or sets the height of the font of the control. Gets or sets the foreground color of the control. Gets the window handle that the control is bound to. Gets a value indicating whether the control contains one or more child controls. Gets or sets the heigl1t of the control. Gets or sets the image that is displayed on a button control. Gets or sets the alig1nnent of the ilnage on the button control. Gets or sets the image list index value of the image displayed on the button control. Gets or sets the key accessor for the i n1age in the ImageList. Gets or sets the ImageList that contains the Image displayed on a button control. This API supports the product infrastructure and is not intended to be used directly from your code. Gets or sets the Input Method Editor (IME) 1node supported by this control. This property is not relevant for this class. Gets or sets the IME 1node of a control. Gets a value indicating \.Vhether tl1e caller must call an invoke 1nethod \;vhen making method calls to the control because the caller is on a different thread tllaD the one the control was created on. Gets or sets a value il1dicating whether the control is visible to accessibility applications. Gets or sets a value indicating wbetl1er tl1e button control is tl1e default b11tton. Gets a value indicating ':vhether the control bas been disposed of. Gets a value indicating whether tl1e control has a 11andle associated v1ith it. Gets a value indicating whether the control is mirrored. Gets a cached instance of the control's layout engine. Gets or sets the dista11ce, in pixels, between tl1e left edge of the control and the left edge of its container's che11t area. Gets or sets tl1e coordilla.tes of the upper-left corner of the control relative to the upper-left corner of its container. Gets or sets the space benveen controls. Gets or sets the size that is the upper lin1it that GetPreferredSize can specify. Gets or sets the size that is tl1e lower Jimit that GetPreferredSize can specify. Gets or sets the name of the control. Gets or sets padding within the control. Gets or sets the parent container of the control.

342

I PowerShell Studio -

A Comprehensive Guide

PreferredSize P roductName ProductVersion Recreatin gHandle

Gets the size of a rectangular area into 'vhicb the control can fit. Gets the product nan1e of the assembly contai ning the control. Gets the ~version of the assembly containing the control. Gets a value indicati11g whether the control is currently re-creating its handle.

Region RenderRightToLcft ResizeRedra\v Right RigbtToLeft ScaleCbildren SholvFocusCues Sbo\\1Keyboard Cues • Site Size TabIndex TabStop Tag Te.~t

TextAJign TextlmageRclation Top TopLevelControl

U seComp atibleTextRendering UseMne.m onic

UseVisu alS tyleBackColo r

U scW aitCursor Visible Width WindowTarget

Gets or sets the \Vi11do'v region associated \Vith the control. Obsolete.This property is now obsolete. Gets or sets a value i.ndicating \Vhether the control redra,vs itseJf ivhen resized. Gets the distance, in pi.xels bet,veeu the right edge of the control and the left edge of its container's clier1t area. Gets or sets a value indicating whether control's elements are aligned to support locales using right-to-left fonts. Gets a value that determines the scaling of child co11trols. Gets a value indicating whether the control should display focus rectangles. Gets a value indicating ~v.hether the user interface is in the appropriate state to show or hide keyboard accelerators. Gets or sets the site of tl1e control. Gets or sets the height and \tVidth of the control. Gets or sets tl1e tab order of the control within its container. Gels or sets a value indicating wl1ether U1e user can give the focus to this control using the TAB key. Gets or sets the object that contaiI1s data about the control. Gets or sets the text associated \Vith this control Gets or sets the alignment of the text on the button control. Gets or sets the position of text and image relative to each other. Gets or sets the distance. in pixels, benveen the top edge of the control and the top edge of its container's client area. Gets the parent control that is not parented by another Windows Fonns control. Typically, this is the outermost Form that the control is contained in. Gets or sets a value that detennines 'vhelher to use U1e Graphics class (GDI+) or the TextRenderer class (GDI) to render te~1. Gets or sets a value indicating whether t11e first character that is preceded by an ampersand (&) is used as the mnemonic key of the control. Gets or sets a value that detennines if the backgrot1nd is dra,;vn using visual styles. if supported. Gets or sets a value indicating \vhether to use the 'vail cursor for the current control and all child controls. Gets or sets a value indicating 'vhether t11e control and all its child controls are displayed. Gets or sets tl1e "vidlh of the control. T.his API supports tl1e product infrastn1cture and is not intended to be ·used directly from your code. This property is not releYanl for this class.

PowerShell St udio - Reference Guide

I 343

CHART • Accessibil~rO bject

AccessibleDefaultActiooDescri1ltioo AcccssibleDescription AccessibleN ame AccessibleRole Allo"·Dro1> Anchor Annotations

Anti Aliasing AutoScrollOffset AutoSize BackColor BackGrad ientS tyle Backgroundlmage Backgrou ndlmageLayout BackBatchStvle • Backlmage BacklmageAlignment BacklmageTranspareotColor BacklmageW ra1>Mode BackSecondarvColor • BindingContext BorderColor BorderDashStyle • Bo rderLineColor BorderLineDashStyle BorderLineWidth BorderSkin BorderWidth

Gets the AccessibleObject assigned to the control. Gets or sets U1e defaull action description of the control for use by accessibility client applications. Gets or sets the description of tl1e control used by accessibility client applications. Gets or sets the name of the control used by accessibility clienl applications. Gets or sets the accessible role of the control Gets or sets a value indicating \vhetller the control can accept data that the user drags onto it. Gets or sets the edges of the container to \Vhich a control is bound and dete.nnines h O\.Y a control is resized '''ith its parent. Gets or sets the name of the control used by accessibility client applications Gets or sets a value that detennines \¥hether anti-aliasing is used \\ihen tex.'t and graphlcs are drawn. Gets or sets ' vhere this control is scrolled to in ScrollControlintoVie,v. Gets or sets a alue that i11dicates \Vhether the control resizes based on its contents. Gets or sets the backgrotmd color of the control Gets or sets the orientation for the background gradient of a Chart control. Also. determines \Vhether a gradient is used. Gets or sets the backgrotmd image displayed in the control. Gets or sets the background image layout as defined it1 the ImageLayout enumeration. Gets or sets the hatching sty le of the Chart control. Gets or sets the background ilnage of the Chart control. Gets or sets the background image alignment used for the Unscaled dra,ving tnode. Gets or sets the color of the Chart control that will be displayed as transparent. Gets or sets the dra\ving rnode for the background image of the Chart control. Gets or sets the secondary color of the chart backgrolUld. Gets or sets tl1e BindingContext for the control. This API supports the product infrastructure and is not intended lo be used directly from your code. Gets or sets the color of the chart border. Gets or sets the style of U1e border. Gets or sets the color of the border line. Gets or sets the style of the border line. Gets or sets the \Vidtl1 of the border fu1e. Gets or sets a BorderSkin object. which provides border skin functionality for the Chart control. This API supports tl1e product infrastructure and is not intended to be ltsed directly from your code. Gets or set s the "'tidth of the chart border.

344

I PowerShell Studio -

Bottom

Bounds BuildNumber

CanEoablelme Can Focus CanRaiseEveots Can Select Capture Cau sesValidation

ChartAreas ClientRectaogle ClientSize CompanyName Container ContainsFocus ContextMenu ContextMenuStrip Controls Created CreateParams Cursor DataBindings DefaultCursor DataManipulator DataSource DefaultimeMode DcfaultMargin DefaultMa1imumSize DefaultMioimu mSize DefaultPadding DefaultSize

A Comprehensive Guide

Gets the distance, iu pixels, benveen the botton1 edge of the control and the top edge of its co11tainer's client area. Gets or sets the size and Location of the control including its nonclient elements, in pixels, relative to the parent control. Tllis API supports the product i1lfrastn1cture and is not intended to be used direcUy from your code. Gets U1e build number of U1e Cliart control. Gets a value indicating \Vhether the ImeMode property can be set to an active value, to enable 1ME support. Gets a value indicating \Vhetber the control can receive focus. Detennines if events can be raised on t11e control. Gets a value indicating whether the control can be selected. Gets or sets a value indicating \Vbether tbe control has captured the 111ouse. Gets or sets a value indicating whether the control causes validation to be performed on any controls that require validation \Vhen it receives focus. Gets a read-only ChartAreaCollection object that is used to store CbartArca objects. Gets the rectangle that represents the client area of the control. Gets or sets the height and width of the client area of the control. Gets the name of the company or creator of the application containing the control. Gets the IContainer that contains the Component. Gets a value indicating ' vhether the control, or one of its cllild controls, currently has the iJ1put focus. Gets or sets the shortcut menu associated \.Vilh the control. Gets or sets the ContextMenuStrip associated \vitl1 tllis control. Gets the collection of controls contained ,;vithin the control. Gets a value indicating whether tl1e control has been created. Gets a CreateParan1s on the base class \Vhen creating a \Vindo,v. Gets or sets the cuJsor lhat is displayed \Vhe11 the n1ouse pointer is over the control. Gets the data bindings for the control. Gets or sets the default ctrrsor for tl1e control. Gets a DataManipulator object that provides methods and properties that handle data. Gets or sets the data source for the Chart object. Gets t11e default Input Method Editor (IME) mode supported by this control. Gets the space. in pixels, that is specified by default benveen co11trols. Gets the length and height, in pL'{els. that is specified as U1e default maximUln size of a co11trol. Gets the length and height in pLxels. that is specified as the default 1ni nin11rm size of a control. Gets the internal spacing, in pixels, of the contents of a control. Gets the default size of the control. 1

PowerShell Studio - Reference Guide

I 345

• DesignMode DialogResult DisplayRectangle Disposing

Dock DoubleBuffercd Enabled Events Focused Font FontHeight ForeColor Handle HasChildren Height Images lmeMode

ImeModeBase InvokeRequiretl

IsAccessible

IsDisposed IsHandleCreated IsMirrored IsSoftSbadOlVS LayoutEngine Left Legends

Location Margin MaximumSize

Gets a value that indicates whether the Component is currently in design n1ode. Gets or sets a val.ue that is returned to the pare11t fonn 'vhen the button is clicked. Gets the rectangle that represents the display area of the control. Gets a value indicating i·vhether the base Control class is in the process of disposing. Gets or sets 'vhich control boiders are docked to its parent control and detenniJ1es ho'v a control is resized 'vitl1 its parent. Gets or sets a value indicating "vl1ether this control should redra,;v its surface using a secondary buffer to reduce or prevent flicker. Gets or sets a value indicating 'vhether the control can respond to user interaction. Gets the list of event hru1dlers that are attached to Ulis Component. Gets a value indicating " ·hether the control has input focus. Gets or sets the font of the text displayed by ll1e control. Gets or sets the height of the font of the control. Gets or sets the foreground color of the control. Gets the ivindo"' handle U1at the control is bound to. Gets a value indicating 'vhether the control contains one or n1ore child controls. Gets or sets the height of the control. Gets or sets fue image that is displayed on a button control. This API supports the product infrast1ucture and is not intended to be used directly from yom code. Gets or sets the Input Method Editor (IME) 1node supported by this control. This property is not relevant for this class. Gets or sets the IME mode of a control. Gets a value indicating 'vhellier the caller n1ust call an invoke method when making method calls to the control because the caller is on a different thread than the one the control 'vas created on. Gets or sets a value indicating 'vhether the control is visible to accessibility applications. Gets a value indicating ':vhelher the control has been disposed of. Gets a value indicating whether the control has a handle associated \ViU1 it. Gets a value indicating whether the control is n'rirrored. Gets or sets a flag that detennines if a smootll gradient is applied when shado,vs are dra,v11 Gets a cached insta11ce of the control's layout engine. Gets or sets the distance, ill pi~els between the left edge of the control and the left edge of its container's client area. Gets or sets a LegendCollectior1 tliat stores all Legend objects 11Sed by the Chart control Gets or sets the coordinates of the upper-left comer of the control relative to the upper-left comer of its container. Gets or sets the space beh~1 een co11trols. Gets or sets the size that is the upper linlit that GetPreferredSize can specify.

346

I PowerShell Studio -

MinimumSize

Name Padding Palette PaletteCustomColors Parent PreferredSize Printing ProductName ProductVersion RecreatingHandle Region

RenderingD1>iX Renderin gDpiY

RenderRightToLeft ResizeRedraw Right RightToLeft ScaleChild ren Scrializer Series Sho"'FocusCues ShowKeyboardCues

Site Size SuppressExceptions TabIndex TabStop

Tag Text TextAntiAIiasingQu ality

Titles Top

A Comprehensive Guide

Gets or sets the size that is the lower limit that GetPreferredSize can specify . Gets or sets the nan1e of the control. Gets or sets padding "vithin the control. Gets or sets the palette for the Chart control. Gets or sets an array of custom palette colors. Gets or sets the parent container of the control. Gets the size of a rectangular area into "vhich the co11trol can fit. Gels a read-only PrintingMru1ager object used for printing a chart. Gets U1e product name of the assembly containing the control. Gets the version of the asse111bly containing the control. Gets a value indicating \Vhelher the control is currently re-creating its hru1dle. Gets or sets the \Vindo\v region associated with t11e contTol. This API supports the product infrastn1cture and is not intended to be used directly from your code. Gets or sets the 11orizontal resolution of the Chart renderer. Gets or sets the vertical resolution of the Chart renderer. Obsolete.This property is now obsolete. Gets or sets a value indicating whether the control redra,vs itself when resized. Gets the distance, in pi.'utScope IsArrangeVaJid

IsChecked IsEnabled lsEnabledCore IsFocused lsHitTestVisible

IsInitialized

lslnputMethodEnabled IsKeyboardFocused IsKe,• 1boardFocu sWithin IsLoaded

IsManipulationEnabled lsMeasu reValid

lsMouseCapmred lsMouseCaptu reWithin

IsMouscDirectlyOver • lsMotiseOver

lsPressed lsSealed

I 349

DESCRIPTION

Gets 01· sets the horizontal alignment characteristics applied to this element when it is composed within a parent element. such as a panel or items control. Gets or sets the ho1izontal alignme11t of the conh·ol's conte11t. Gets or sets lhe scope limits for property value inheritance, resource key loo.k11p. and RelativeSource FindAncestor lookup. Gels Lhe collection of input bindings associated \Vi.th t11is cle1nent. Gets or sets the contex.1 for input used by this FrameworkElement. Gets a value indicating whether the co1nputed size and position of child elements in this element's layout are valid. Gets or sets \Vltelber the ToggleButton is checked. Gets or sets a value indicating vvheU1er tllis elerne11t is enabled in the user interface (Ul). Tllis is a dependency property. Gets the value of the IsEnabled property. Gets a value that detennines \lvhether this element has logical focus. This is a dependency property. Gets or sets a value that declares \Vhether this element can possibly be retun1ed as a hit test result fron1 so1ne portion of its rendered content. This is a dependency property. Gets a value U1at indicates vvbether Lhis e.le1nent has been initialized. either dl1ring processing by a XAML processor. or by e:\.rplicitly having its Endlnit n1ethod called. Gets a value indicating \vhether an input method system. such as an Input Metl1od Editor (Il\1E), is enabled for processing U1e input to this element. Gets a value indicating \Vhether tllis ele1nent has keyboard focus. Tllis is a dependency property. Gets a value indicating \vl1ether keyboard focus is anyvvhere \\rithin the element or its visual tree child elements. This is a dependency property . Gets a value that indicates vvhether this e.le1nent has been loaded for presentation. Gets or sets a value that indicates whether manipulation eve11ts are enabled on this UIElen1ent. Gets a value indicati11g whether the cu1Tent size returned by layout measlrre is valid. Gets a value indicatil1g \Vhether the mouse is captured to tlris elen1ent. This is a dependency property. Gets a value lJ1at detennines whether inouse capture is held by this element or by child elements in its visual tree. Tllis is a dependency property. Gets a value that indicates whether tl1e position of the mouse pointer corresponds to hit test results. which take element compositing into account. This is a dependency property. Gets a value indicating whether the mouse pointer is located over tlris element (including child elements in the visual tree). This is a dependency property. Gets a value that indicates whether a ButtonBase is c1trrently activated. Gets a value that indicates \;vbether this instance is c1uTently sealed (readonly).

350

I PowerShell Studio -

PROPERTY IsS tylusC aptured IsStyJusCaptu_reWithin

lsStvlu sDi rectlyOver • •

lsStylusOvcr • IsTabSto1>

IsTllreeState IsVisible Language

LayoutTransform Logical Child rcn Margin MaxHeight MaxWidth MinHeigbt MinWidth Name

Opacity

OpacityMasi{

OveITidesDefauJtStyle Padding Parent Persistld RenderSize RenderTransform

RenderTransform Origin

Resources Sna1>sT0DevicePixels

A Comprehensive Guide DESCRIPTION

Gets a value indicating "vhether the stylus is captured by this element. This is a dependency property. Gets a value that detem1ines whether stylus capttrre is held by this e1e111ent, or an element \vithiJ.1 the ele1ne11t bounds and its visual tree. This is a dependency property. Gets a value that indicates \vhether the stylus position co1Tesponds to hit test resltlts. \vhich take element compositing into accoWlt. This is a dependency property. Gets a value indicating whether the stylus cursor is located over this elen1ent (including visual child ele1nenls). This is a dependency property. Gets or sets a value that indicates whether a control is included in tab navigation. Dete1nrines \¥hether the control suppo1ts two or three states. Gets a value indicating whether this element is visible it1 the user interface (Ul). This is a dependency property. Gets or sets localization/globalization language illfo11natio11 that applies to an ele1nent. Gets or sets a graphics transformation that should apply to this element when layout is performed. Gets an entunerator to the content control's logical child elements. Gets or sets the outer inargin of an element. Gets or sets the ina~1num height constraint of the element. Gets or sets the maximum '""°idtb constraint of the element. Gets or sets t11e mini1nm11 height constraint of the elen1ent. Gets or sets the m.i:nilnmn width constraint of the element. Gets or sets the identifying name of the element. The naine provides a reference so that code-behind, such as event handler code. can refer to a inark-up element after it is consti11cted duiit1g processing by a XAM1., processor. Gets or sets the opacity factor applied to the entire UIEle1nent when it is rendered in tl1e user interface (Ul). This is a dependency property. Gets or sets an opacity mask, as a Bn1sl1 implementation that is applied to any aJpha-cliannel 1nasking for the rendered content of tltis ele1nent. This is a dependency property. Gets or sets a value that indicates whether tltis ele1nent incorporates sty le properties from theme styles. Gets or sets t11e padding inside a control. Gets the logical pare11t element of this element. Obsolete.Gets a value that uniquely identifies this element. Gets (or sets, but see Remarks) the final render size of tltis element. Gets or sets transform information that affects the rendering position of this elen1e11t. This is a dependency property. Gets or sets the center point of any possible render transfonn declared by RenderTransfonn. relative to U1e bounds of the elen1en.t. This is a dependency property. Gets or sets the locally-defined resource dictionary . Gets or sets a value that detem1ines \Vhether rendering for this ele1nent should use device-specific pixel settings during re11dering. This is a dependency property.

PowerShell Studio - Reference Guide PROPERTY Style • StJlu sPluglns Tab Index Tag Template TemplatedParent ToolTip TouchesCaptured TouchesCaptu redWithin TouchesDirectlyOver TouchesOvcr T rj ggers Uid UseLayoutRounding VerticaJAJignmeut

VerticalContentAlignment Visibility VisuaIBitmapEffect VisualBitmapEffectlnput VisualBitmapScatingMode VisualCacbeMode VisualChildrenCount Visu alClearTypeHint VisualCli1l VisualEdgeMode V.i suaJEffect Visual Offset Visual Opacity VisuaIOpacityMask VisualParent VisuaJScrollableAreaClip VisuaITextHintingMode

I 351

DESCRIPTION

Gets or sets the style used by this element '''hen it is rendered. Gets a collection of all stylus plug-in (custon1ization) objects associated \vith this ele111ent. Gets or sets a value that determines the order in which elements receive focus when tl1c user navigates Ulfough controls by using the TAB key. Gets or sets an arbitrary object value that can be used to store custom infonnation about this ele1nent. Gets or sets a control template. Gets a reference to the template parent of this element. This property is not relevant if the ele1nent was not created through a template. Gets or sets the tool-tip object that is displayed for this element in the user interface (UT). Gets all toucl1 devices tlIBt are captured to this element. Gets all touch devices that are capluTed to this element or any child elements in its visual tree. Gets all touch devices that are over this element. Gets all touch devices that are over this eleinent or auy child ele1nents in its visual tree. Gets the collection of triggers established directly on this eleme11t or in child ele1nents. Gets or sets tl1e turique identifier (for localization) for Uris element. This is a dependency prope1ty. Gets or sets a value that indicates whether layout rounding should be applied to this element's size and position during layout. Gets or sets the ve1tical alig111nent characteristics applied to tllis ele1nent \Vben it is coniposed \Vithin a parent elen1ent such as a panel or ite111s control. Gets or sets U1e vertical alignment of the control's content. Gets or sets the user i11terface (UT) visibility of this elen1enl. This is a dependency property. Obsolete. Gets or sets the BitmapEffect value for the Visual. Obsolete. Gets or sets the Bit:JnapEffectlnput value for the Visual. Gets or sets the BitmapScalingMode for lhe Visual. Gets or sets a cached representation of tl1e Visual. Gets the number of viSl1al child elements \vitllin this element. Gets or sets the ClearTypeHint that deten1rines ho,¥ ClearType is rendered in the Visual Gets or sets the clip regio11 of the Visual as a Geo111etly value. Gets or sets the edge n1ode of the Visual as an EdgeMode value. Gets or sets the bitmap effect to apply to the Visual. Gets or sets the offset value of lhe visual object. Gets or sets the opacity of the Visual. Gets or sets the Bn1sh value that represents the opacity mask of the Visual. Gets U1e visual tree parent of the visual object. Gets or sets a clipped scrollable area for tl1e Visual. Gets or sets the TextHintingMode of the Visual.

352

I PowerShell Studio -

PROPERTY VisuaJTextRenderingMode Visual Transform VisualXSnappingGuidelines VisualYSnap11ingGuidelines Width

A Comprehensive Guide DESCRIPTION ------Gets or sets the TeA-1RenderingMode of the Visual. Gets or sets the Transform value fo r the Visual. Gets or sets the x-coordinate (vertical) guideline collectio11. Gets or sets the y-coordb.1ate (horizontal) guideline collection. Gets or sets tl1e width of the element.

------
ingGuidelines

Gets or sets the x-coordinate (vertical) guideline collection.

VisualYSnap1>ingGuidelines

Gets or sets the y-coordinate (horizontal) guideline collection.

Width

Gets or sets the \Vidth of the element.

I 363

CONTEXTMENUSTRIP

AccessibilityO bject Accessi b l.eDefau ltA.ctio nDescripti on AccessibleDescription AccessibleName AccessibleRole AllowDro1l AllowItemReorder AllowMerge

AllowTransparency Anchor An to Close AutoScroll AntoScrollMargin AntoScrolIMinSize AutoScroUOffset

Gets the AccessibleObject assigned to the control. Gets or sets the default action description of the control for use by accessibility client applications. Gets or sets the description of the control used by accessibility client applications. Gets or sets the nan1e of the co11trol used by accessibility client applications. Gets or sets the accessible role of the control Gets or sets a value indicating \.vhether drag-and-drop and iten1 reordering are handJed through events that you i111ple1uent. This API supports the product infrastructure and is not intended to be used directly fron1 your code. This property is not relevant to this class. Gets or sets a value indicating \Vhether multiple MenuStrip, ToolStripDropDownMenu, ToolStripMenuitem, ai1d other types can be combined. Gets or sets a value indicating "vhether the Opacit)' of the form can be adjusted. This API supports the product infrastrucnue and is not intended to be used directly fro1n your code. This property is not relevant to this class. Gets or sets a value indicating whetl1er the ToolStripDropDown control should automatically close when it has lost activation. This API Sllpports the product infrastructure and is not intended to be used directly fro1n your code. This property is not relevant for tltls class. This API Sllpports the product infrastructLue and is not intended to be used directly fro1n your code. This property is not relevant for this class. This API Sllpports the product infrastructtue and is not intended to be used directly fro1n your code. This property is not relevant for tllis class. Gets or sets where this control is scrolled to in ScrollControllntoView.

364

I PowerShell Studio -

A Comprehensive Guide



AutoScrollPosition AutoSize BackColor

Baclwoundlmage BackgroundlmageLayou t BindingContext Bottom Bounds CanEnablelme CanFocus Can Overflow

CanRaiseEvents CanSelect Ca)lture CausesValidation

ClicntRectangle ClientSize CompanyName Container ContainsFocus ContextMeou ContextMenuStrip

Controls Created CreateParams Cursor DataBindi.ngs DefaultCu rsor DefauJtDock

This API supports the product infrastructure and is not intended to be used directly from your code. This property is not relevant for this class. Gets or sets a value indicatil1g whether the ToolStripDropDown autornatically adjusts its size \Vhen the form is resized. This API supports the product infrastn1cture and is not intended to be used directly frorn your code. Gets or sets U1e backgrow1d color for tl1e ToolStrip. Gets or sets the background image displayed in the control. Gets or sets the background image layoltt as defined irn. the lmageLayout enumeration. Gets or sets the binding contex1 for the ToolStrip. Gets the distance, in pi'{els: between the bottom edge of the control and the top edge of its container s client area. Gets or sets the size and location of the control including its nonclient elements, in pL"els, relative to the parent control. Gets a value indicating whether the ImeMode property can be set to an active value, to enable IME support. Gets a value i11dicating whether the control can receive focus. This API supports the product infrastructure and is not intended to be used directly from yotrr code. Gets or sets a value indicating 'vhether the items in a ToolStripDropDo\vn can be sent to an overflo'\v menu. Determ.ines if events can be raised on the control. Gets a value indicating whether tl1e control can be selected. Gets or sets a value indicating \.Vhether tl1e control has capt1rred the mouse. Gets or sets a value indicating \.vhether the ToolStrip causes validation to be performed on any controls that require validation \.Vhen it receives focus. Gets the rectangle that represents the client area of the control. Gets or sets the height and width of the client area of the control Gets the name of the company or creator of the application containing the control. Gets the IContainer that contains the Con1ponenl. Gets a value indicati11g whether the control. or one of its cJlild controls, currently has the input focus. This API supports the product infrastn1.cture and is not intended to be used direcUy from your code. This property is not relevru1t to this class. This API supports the product infrastn1cture a11d is not intended to be used directly from your code. This property is not relevant to this class. This API supports tl1e product infrastructure and is not intended to be used directly from your code. This property is not relevant for this class. Gets a value indicating whether the control has been created. Gets paran1eters of a ne\v \Vindow. Gets or sets the ctrrsor that is displayed \vhen the mouse pointer is over the ToolStrip. Gets the data bindings for the control. Gets or sets tl1e default cursor for tJ1e control. Gets the docking location of the TooIStrip. indicating which borders are docked to the co11tainer.

PowerShell Studio - Reference Guide

DefaultD.-01>DOl1'nDirection DefaultGripMargin DefaultlmeMode

I 365

Gets or sets the direction in 'vllich the ToolStripDropDo,vn is displayed relative to U1e ToolStrip. Gets the default spacing, in pixels, between the sizing grip and the edges of U1e TooJStrip. Gets the default Input Method Editor (IME) mode supported by the COiltrOl.

DefaultMargin DefanltMaxi:mumSize DefauJtMinimumSize DefaultPadding Defau ltSholvltemToolTips Defau It Size DesigoMode

Displayedltems DisplayRectangle Disposing

Dock DockPadding DoubleBuffered D ropShadolv Enabled Enabled Events Focused Font FootHeight ForeColor GripDisplaySt~1 le

GripMargin

GripRectangle GripStyle Handle HasChildren

Gets the spacing, in pixels, betvveen the ToolStrip and the ToolS trip Container. Gets U1e length and heigh~ in pixels. tl1at is specified as the default maxin11llll size of a control. Gets the length and height, in pixels. that is specified as the default n1inimum size of a control. Gets the internal spacing. in pixels. of the control. Gets a value indicating ' vhether ToolTips are sho\vn for the ToolStripDropDo,vn by default. Gets the default size of the ToolStrip. Gets a value U1at indicates ,;v bet.her the Con1ponent is curre11tly in design n1ode. Gets the subset of items that are currently displayed on the TooIS trip, including items that are automatically added into the ToolStrip. Gets the rectangle that represents the display area of the ToolStripDropDownMenu. Gets a value indicating whether the base Control class is in. the process of disposing. Tllis AP! suppo11s the product infrastn1cttue and is not intended to be used directly from your code. This property is not relevant to tlus class. Gets the dock padding settings for all edges of the control. Gets or sets a value indjcating wheU1er this control should redra"v its surface using a secondary buffer to reduce or prevent nicker. Gets or sets a value indicating "\>vhether a three-dimensional shado""1 effect appears when the ToolStripDropDown is displayed. Gets or sets a value indicating whether the control can respond to user interaction. Gets the list of e,rent handlers that are attached to this Component. Gets a value indicating whether the control has input focus. Gets or sets the font of the text displayed on tl1e ToolStripDropDo"vn. Gets or sets the height of the :font of the control. Gets or sets the foregrou11d color of the TooIStrip. This API suppo11s the product infrastruct1rre and is not intended to be used directly from your code. This property is not relevant to tllis class. This AP! supports tl1e product infrastructtrre and is not intended to be used directly from your code. This property is not relevant to Ulis class. Thls API supports tl1e product infrastructure and is not intended to be used directly from your code. This property is not rele,rantto this class. This API supports the product infrastructtrre and is not intended to be used directly from your code. This property is not relevant to this class. Gets the \Vindow handle tl1at the control is bound to. This API supports the product infrastn1cture and is not intended to be used directly from your code. Tllis property is not relevant for ill.is class.

366

I PowerShell Studio -

Height HorizontalScroll HScroU lmageList lmageScalingSize ImeMode lmeModeBase lnvokeRequired

IsAccessible IsAutoGenerated lsCttrrentlyDragging

IsDisposed IsDropDo,vn IsHandleCreated

A Comprehensive Guide

Gels or sets ll1e height of t11e control. This API supports the product infrastructure and is not intended to be used directly fro1n your code. This property is not relevant for trus class. Gets or sets a value indicating whether the horizontal scroll bar is visible. Gets or sets the iniage list that contains the image displayed on a Too1Slrip item. Gets or sets the size in pixels, of an image used on a ToolStrip. Gets or sets the Input Method Editor (lME) mode of the control. Gets or sets the IME mode of a control. Gets a value i11dicating \¥hether the caller 1uust call ru1 invoke method \Vhen making method calls to the control because the caller is on a different thread than tl1e one tl1e co11trol \Nas created on. Gets or sets a value indicating \Vhether the control is visible to accessibility applications. Gets a value indicating \vhether this ToolStripDropDo,vn \Vas auton1atically ge11erated. Gets a value indicating \Vhether the user is currently moving the TooJStrip from one ToolStripContainer to another. Gets a value indicating 'vhether the control has been disposed of. Gets a value indicating \vhether a ToolStrip is a ToolStripDropDo,vn control. Gets a value indicating \vhether the control has a handle associated \vith it.

IsMirrored Items La you tEngine LayoutSettin gs LayoutStyle • •

Left Location Margin

MaxjmumSize MaxltemSize MinimumSize Name

Opacity Orientation Overflo\\'Button 0\v nerItem

Padding

Gets a \ralue indicating \vhether the control is 11lirrored. Gets all tl1e items tl1at belong to a ToolStrip. Passes a reference to the cached LayoutEngine retl1rned by U1e layout engine interface. Gets or sets layout scheme characteristics. Gets or sets a value indicating how the items of ContextMenuStrip are displayed. Gets or sets the distaJlce in pixels. bet,veen the left edge of the controJ and the left edge of its containe1Js client area. This API supports the product infrastructure and is not intended to be used directly from yo11r code. This property is not rele~r,u1t to this class. Gets or sets the space bet\veen controls. Gets or sets the size that is the upper limit that GetPreferredSize can specify. Gets the maximum height and \Vidth, in pixels. of the ContextMenuStrip. Gets or sets the size that is the lo\i\1er limit that GetPreferredSize can specify. Gets or sets the ruune of the controJ . Delemlines U1e opacity of U1e fom1. Gets the orientation of the ToolStripPanel. This API supports the product infrastructure and is not intended to be used directly from your code. Tllis property is not relevant to this class. Gets or sets the ToolStripitern that is the owner of this ToolStripDropDO\VIl. Gets or sets padding \vilhin the co11trol.

PowerShell Studio - Reference G uide

I 367

t

Parent PrcfcrrcdSizc ProductName ProductVersion Recrcatin gBandle Region Renderer RenderMode RenderRightToLeft ResizeRedraw Right Ri.ghtToLeft ScaleChildren ShowChecliMargin Sho" FocusCues 1

Sho,,·ImageMargin Sho"' Item ToolTi1>s

Sho"·KeyboardCues • Site Size SourceControl Stretch Tablndex TabStop Tag Text TcxtDirection Top TopLevel TopLevelCootrol

Gets or sets the parent container of the control. Gets the size of a rectangular area into \vhich the control can iit. Gets the product name of the assembly contai ning the control. Gets U1e version of the asse1nbly containing the control. Gets a value indicating \Vhether tl1e conlrol is currently re-creating its handle. Gets or sets the \vindo'v region associated with the ToolStripDropDo\vn. Gets or sets a ToolStripRenderer used to customize the look and feel of a ToolStrip. Gets or sets a value that indicates which visual styles \Yill be applied to the ToolStrip. Obsolete.This property is uo' v obsolete. Gets or sets a value i11dicating whether the control redra\VS itself \vhen resized. Gets U1e distance, in pixels, bet\veen U1e ri,ght edge of the control and the left edge of its container's client area. Gets or sets a value indicatiJ1g ':\'hether control's ele1nents are aligned to support locales using right-to-left fo nts. Gets a value that determines the scaling of child controls. Gets or sets a value indicating \Vhether space for a check n1ark is sho,vn on the left edge of the ToolSt:IipMe11ulte111. Gets a value indicating whether the control should display focus rectangles. Gets or sets a value indicating \vhether colu1nns are created automatically when the DataSoruce or DataMemberproperties are set. Gets or sets where this control is scrolled to in ScrollControlintoVie,;v. This API supports the product infrastructure and is not intended to be used directly from your code. This property is not relevant for this class.(Ove1rides Control.AutoSize.) Gets or sets a value indicating how column "vidths are determined. Gets or sets a value indicating how row heights are determined. This API Sl1ppo1ts tl1e product infrastructure and is not intended to be used directly from yotrr code. Gets or sets the background color for the control.(Overrides Control.BackColor.) Gets or sets the background color of the DataGridVie\>v. Tllis API supports tl1e product infrastructure and is not intended to be used directly from yoru code. Gets or sets the background image displayed in the control.(Overrides Control.Backgroundlmage.) This API supports tl1e product infrasuucture and is not intended to be used directly fro1n your code. Gets OI sets the background image layout as defined in the In1ageLayout entuneration. (Overrides Coutrol.BackgroundllnageLayout.) Gets or sets the BindingContext for the control. Gets or sets the border style for the DataGridVie\>v. Gets the distance, in pLxels, between tlle bottom edge of the control and the top edge of its container's client area. Gets or sets the size and location of the control including its nonclient eleme11ts, in pixels, relative to the parent control. Gets a value indicating \Vhether the lmeMode property can be set to an active value, to enable IME support. (Overrides Control.CanEnablelme.) Gets a value indicating \vhether the control can receive focus. Determit1es if events can be raised on the control. Gets a value indicating ~vhether the control can be selected. Gets or sets a value indicating whether the control has captured the mouse. Gets or sets a value indicati11g whether the control causes validation to be perfor1ned on any controls that require validation when it receives focus. Gets the cell border style for the DataGridView. Gets the rectangle tl1at represents tlie client area of the control. Gets or sets tl1e height and width of the client area of the control. Gets or sets a value that indicates whether users ca11 copy cell tex1 values to the Clipboard and whether ro~v and coltllll.11 header tex1 is included. Gets or sets the number of coltnnns displayed in tl1e Data GridView.

370

I PowerShell Studio -

A Comprehensive Guide

ColumnHeadersBorderStvle • ColumnHeadersDefauJtCeUS tvlc • ColumnHeadersHcight ColumnHeadersHeightSizeMode

ColumoHeadersVisible Columns CompanyName Container ContainsFocu s ContextMenu ContextMenuStrip Controls Created CreateParams CurrentCell CurrentCellAdd ress CurrentRo'v Cursor DataBindings DataMember DataSource DefaultCellStyle DefaultCursor Defau ltlmeMode DefaultMargin DefaultMaximumSize Defau ltMinimu mSize DefaultPadding DefaultSize DesignMode DisplayRectanglc

Gets the border style applied to the colunm headers. Gets or sets the default colnn111 header style. Gets or sets the heigh~ in pixels, of the column headers ro\v Gets or sets a value indicating \vl1ether tl1e height of the coltum1 headers is adjustable and whether it can be adjusted by the user or is automatically adjusted to fit the contents of the 11eaders. Gets or sets a value indicating \Nhether tJ1e colu1m1 header TO\V is displayed. Gets a collection tliat contains all the columns in the control. Gets the na1ne of tbe co1npany or creator of the application contai ning the control. Gets U1e !Container that contains tl1e Component. (Inherited fron1 Co1nponent.) Gets a value indicating v.rhether the control: or one of its child controls, currently has the input focus. Gets or sets the shortcut menu associated ' vith the control. Gets or sets U1e Conte>.1.MenuStrip associated \vith th.is control. Gets the collection of controls contained within the control. Gets a value indicating \-vhether the control has been created. Gets the required creation parameters \¥hen the control handle is created. Gets or sets the currently active cell. Gets the ro'v and colunm indexes of the currently active cell. Gets the rO\· containing the current cell. Gets or sets the c1usor that is displayed \-vhen the mouse pointer is over the control. Gets 01e data bindings for the control. Gets or sets the nan1e of the list or table i11 the data source for \;vhich the DataGridVievv is displaying data. Gets or sets the data source that the DataGridVie\v is displaying data for. Gets or sets the default cell style to be applied to the cells in the DataGridVie\v if no other cell style properties are set. Gets or sets the default cursor for the control. Gets the default Input Method Editor (IME) mode supported by the control. Gets the space. in pixels~ that is specified by default bet,veen co11trols. Gets the length and height, in pixels, that is specified as the default 1naximttn1 size of a contro 1. Gets t11e length and height, iJ1 pixels, that is specified as the default ininimun1 size of a control. Gets the inten1al spacing, in pixels, of the contents of a control. Gets 01e default initial size of tl1e control. (Overrides Control.DefaultSize.) Gets a value that indicates \Vl1ether the Component is currently in design mode.(lnherited from Con1ponent.) Gets the rectangle that represents the display area of the control. (Ovenides Co11trol.DisplayRectangle.)

PowerShell Studio - Reference Guide. [

Disposing Dock DoubleBufferecl

EditingControl EditingPanel EditMode Enabled EnableHeadersVisu alSty.les

Events FirstDis1>layed Cell FirstDi.splayedScrollingColumnHiddenW idtb FirstDis1>layedScrollingColumnlndex Fi rstDisplayedScrollingRowIndex Focused Font FontHeight ForeColor GridColor Handle Has Children Height Ho rizontalScrol lBar HorizontalScrollingOffset lmeMode lmeModeBase lnvokeRequired

IsAccessible

I 371

•Gets a value indicating whether the base Control class is in the process of disposing. Gets or sets which control borders are docked to its parent control and detennines how a control is resized with its parent. Gets or sets a value indicating whether this control should redraw its surface using a secondacy buffer to reduce or prevent flicker. Gets the control hosted by the current cell, if a cell with an editing control is in edit inode. Gets the panel that contains the EditingControl. Gets or sets a value indicating ho'\¥ to begin editing a cell. Gets or sets a value indicating whether the control can respond to user interaction. Gets or sets a value indicating whether r0\\1 and column headers use the visuaJ styles of tl1e user's c11rrent then1e if visual styles are enabled for the application. Gets the list of event handlers that are attached to this Component. (Inherited from Component.) Gets or sets the first cell currently displayed in the DataGridVie,v; typically, this cell is in tl1e upper left con1er. Gets the vvidth of the portion of the column that is currently scrolled out of view .. Gets or sets the index of the colunm that is the first col1u1m displayed on the DataGridVievv. Gets or sets the index of the row that is the first row displayed on the DataGridView. Gets a value indicating vvhether the control has input focus. Gets or sets the font of the te)..1: displayed by the DataGridVievv. (Overrides Control.Font.) Gets or sets the height of the font of the control. Gets or sets the foreground color of tl1e DataGridView. (Overrides Control.ForeColor.) Gets or sets the color of the grid lines separating tl1e cells of the DataG1idView. Gets tl1e window handle tliat the control is bom1d to. Gets a value indicating whether tl1e control contains one or more child controls. Gets or sets tl1e heigl1t of the control. Gets the horizontaJ scroll bar of the control Gets or sets the number of pixels by vvhich the control is scrolled 11orizontally. Gets or sets the Input Method Editor (IME) lnode of the control. Gets or sets the IJ\1E mode of a control. Gets a value il1dicating whether the caller must call an invoke method whe11 making method calls to the control because the caller is on a different thread than the one the control vvas created on. Gets or sets a vaJue indicating whether the control is visible to accessibility ap_plications.

372

I PowerShell Studio -

Is Cu 1TentCellDirty IsCurrentCeDinEclitMod.e IsCurrentRowDirty • IsDis11osed IsHancUeCreated IsMirrored Itcm[Int32, lnt32] Item[String, Int32)

LayoutE n gine Left Location Margin MaximumSize MinimumSize MultiSelect

Name NewRowIndex Pad rung

Parent PreferredSize ProductName ProductVersion Read Only Recreatin gHan.dle Region

RenderRightToLeft ResizeRecb·aw

Right

A Comprehensive Guide

Gets a value indicating whether the current cell has uncommitted changes. Gets a value indicating whether the currently active cell is being edited. Gets a value indicating whether the current row has 11ncoIDinitted changes. Gets a value indicating whet11er t11e control l1as been disposed of. Gets a value indicating whetl1er the contTol has a handle associated with it. Gets a value indicating whether the control is inirrored. Provides ru1 it1dexer to get or set ·the cell located at the intersection of tl1e column a11d ro\v \vi th the specified indexes. Provides an indexer to get or set tl1e cell located at the intersection of tl1e row with the specified index and t11e column with the specified name. Gets a cached instance of U1e control's layot1t engine. Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its co11tai11er's client area. Gets or sets tl1e coordinates of the upper-left comer of the control relative to tl1e upper-left comer of its container. Gets or sets the space between controls. Gets or sets the size tl1at is the upper limit that GetPreferredSize can specify. Gets or sets the size that is the lower limit that GetPreferredSize can specify. Gets or sets a value indicating wl1ether the user is allowed to select more than one cell, row, or colunm of the DataGridVievv at a ti111e. Gets or sets the name of tl1e control. Gets tl1e index of the row for new records. This API supports the product infrastructure and is not intended to be used directly from your code. This property is not relevant for tllls control. Gets or sets the parent container of the control. Gets the size of a rectangular area into which the co11trol can fit. Gets the product nan1e of the assembly containing the control. Gets the version of the assembly containing tl1e control. Gets or sets a value indicating \V hether the user can edit the cells of the DataGridVievv control. Gets a value indicating whether the control is currently recreating its handle. Gets or sets the window region associated with t11e control. Obsolete. This property is now obsolete. Gets or sets a value indicati.J1g whether tl1e control redraws itself vvhen resized. Gets the distance, in pixels, betvveen the right edge of the control and the left edge of its contait1er's client area.

PowerShell Studio - Reference Guide

RightToLeft Ro,vCount Ro'vHcadersBorderS tylc • Ro'''HeadersDefaultCeUStyle • Ro'v HeadersVisible Ro,vHeadersWidth Ro,vHeadersWidthSizeMode

Ro\vsDefau ltC ellStyle

ScaJcChildrcn ScrollBars SclectcdCcUs Selected Columns SelectedRoTI S SelectionMode 1

Sbo,vCeUErrors SholvCelJToolTips ShOl\ E ditinglcoo 1

SholvFocusCues SholvKevboardCues • SholvRolvErrors Site Size Sorted Column SortOrder

Standard Tab

TabIndex

I 373

Gets or sets a value indicating v.1hether control's elements are alig11ed to support locaJes using right-to-left fonts. Gets or sets the nwnber of ro,vs displayed in the DataGridVie,v. Gets or sets the border style of the ro'v header cells. Gets or sets the default style applied to the row header cells . Gets or sets a value indicating v. hetl1er tl1e colwru1 tl1at contains ro,;v headers is displayed. Gets or sets the ' vidth. in pi'Cels. of the column that contains the row headers. Gets or sets a value indicating whether the 'vidtl1 of the ro'v headers is adjustable and whether it can be adjusted by the user or is automatically adjusted to fit the contents of the headers. Gets a collection that contains all the rovvs in the DataGridVie'~ control. Gets or sets the default style applied to the ro'v cells of the DataGridVieiv. Gets or sets the ro'v that represents lhe template for all the Iov.·s in the control. Gets a value that determines the scaling of child controls. Gets or sets the type of scroll bars to display for the DataGridView control. Gets the collection of cells selected by the user. Gets the collection of columns selected by the user. Gets the collection of rows selected by the user. Gets or sets a value indicating bo'v the cells of the DataGridVie'v can be selected. Gets or sets a value i11dicating wheU1er to sho'v cell errors. Gets or sets a value indjcating 'vhether or not ToolTips will sho'v 'vhen the molJSe pointer pauses on a cell. Gets or sets a value indicating whether or not the editing glyph is visible in the ro'v header of the cell being edited. Gets a value indicating whether the control should display focus rectangles. Gets a value indicating '\>vhether the user interface is in the appropriate state to shO\V or hide keyboard accelerators. Gets or sets a value indicating \Yhetl1er row headers "vill display error glyphs for each row that contains a data entry error. Gets or sets the site of the control. Gets or sets U1e height and widU1 of t11e control. Gets the colUlnn by \Vhich the DataGridVie'v contents are currently sorted. Gets a value indicating "''bether tl1e items u1 the DataGridVie'v control are sorted in ascending or descending order, or are not sorted. Gets or sets a value indicating ' vhetl1er the TAB key moves the focus to the next control in the tab order rafuer than 1noving focus to the next cell in the control. Gets or.sets the tab order of the control ,vithin its container. 1

374

I PowerShell Studio -

A Comprehensive Guide

TabStop

Tag Text

Top To1>LeftHeaderCell TopLevelControl

UserSetCu rso r UseWaitCursor VerticalScrollBar VerticalScrollingOffset VirtualMode

V.i sible Width Window Target

Gets or sets a value indicating \Vhether the user cai1 give the focus to this control using the TAB key. Gets or sets the object that contains data abot1t the control. This API supports the product infrastructure and is not inte11ded to be used directly fron1 yotu code. Gets or sets the text associated with the control. (Overrides Control.Text.) Gets or sets the distance, in pi.xels, between tl1e top edge of the control and tl1e top edge of its container's client area. Gets or sets the header cell located in the upper left corner of the DataGridView control. Gets the parent control that is not parented by another Windo\.VS Forms control. Typically, this is the outermost Form that the control is contained in. Gets the default or user-specified value of the Cursor property. Gets or sets a value indicating whether to use the wait cursor for the current control and all child controls. Gets the vertical scroll bar of the control. Gets the nnmber of pLxels by which the control is scrolled vertically. Gets or sets a value indicating \.vl1ether you have provided your O\.VO data-1nanagement operations for tl1e DataG1idView control. Gets or sets a value indicating whether the control and all its child controls are displayed. Gets or sets the \.vidth of the co11trol. This API supports the product infrastructure and is not intended to be used directly from your code. This property is not relevant for this class.

DATETIMEPICKER PROPERTY AccessibilityObject

DESCRIPTION

Accessi.bleDefaultActionDescripti on AccessibleDescri1Jt.ion

Gets or sets the default action description of the control for use by accessibility client applications. Gets or sets the description of the control used by accessibility clie11t applications. Gets or sets the name of the control used by accessibility client applications. Gets or sets the accessible role of the control

AccessibleN ame Accessiblellole Allo,vDro1J Anchor AutoScrollOffset

Gets the AccessibleObject assigned to the control.

Gets or sets a value indicating whether the control can accept data that the user drags onto it. Gets or sets the edges of the container to which a control is bound and detenni nes ho'\¥ a control is resized with its parent. Gets or sets where this control is scrolled to in ScrollControllnto Vie\¥.

PowerShe ll Studio - Refere nce Guide PROPERTY Auto Size BackColor Backgroundlmage

Backgrou ndlmageLayout

BindingContext Bottom Bounds CalendarFont CalendarForeColor CalendarMonthBackground C alendarTitleBackColor CalendarTitleForeColor CalcndarTrailin gForcColor

CanEnablelme

I 375

DESCRIPTION

This API supports U1e product infrastructure and is not intended to be used directly from your code. This property is not relevant for this class. Gets or sets a value indicating the background color of the DateTimePicker control. (Overrides Control.Back.Color.) This API supports the product in:frastJ.ucture and is not ir1tended to be used directly from your code. Gets or sets the background image for the control. (Overrides Control.Backgroundlmage.) This API suppo1ts the product infrastructure and is not intended to be used directly from y oUI code. Gets or sets the layout of the background image of the DateTimePicker control.(Overrides Control.Backgro1mdlmageLayout.) Gets or sets the B.indingContext for tl1e control. Gets the distance, in pixels. benveen the bottom edge of tbe control and the top edge of its container's client area. Gets or sets the size and location of tl1e co11trol iI1cluding its nonclient elements, in pixels. relative to the parent control. Gets or sets the font style applied to the calendar. Gets or sets the foreground color of the calendar. Gets or sets the background color of the calendar n1ontb. Gets or sets tbe background color of the calendar title. Gets or sets the foregroru1d color of tbe calendar title. Gets or sets the foreground color of the calendar t railing dates.

CanRaiseEvents

Gets a value indicating whether the lmeMode property can be set to an active value, to enable lME support. Gets a value indicating \vhether the control can receive focus. Detennines if e\rents can be raised on tbe control.

Can Select

Gets a value indicating \Vhetber tbe control can be selected.

Capture

ContextMenu

Gets or sets a value indicating '"·bether the control bas captured the 1nouse. Gets or sets a value indicating \Vhether the control causes validation to be perfom1ed on any controls that require validation \Vhen it receives focus. Gets or sets a value indicating \Vhether tl1e Value property has been set \Vith a valid date/tin1e value and the displayed value is able to be updated. Gets the rectangle that represents the client area of tlie control. Gets or sets the height and width of the client area of the control. Gets the name of the co1npa11y or creator of llie applicati.011 contairling the control. Gets the !Container that contains the Compo11ent. (Inherited from Component.) Gets a value indicating 'vl1elher the control, or one of its child controls, currently has the input focus. Gets or sets the shortcut 1nenu associated witl1 the control.

ContextMenuStritl

Gets or sets tl1e ContextMenuStrip associated 'vitb tllis control.

CanFocus

CausesValidation Checked

ClientRectangle ClientSize ComJJanyName Container ContainsFocus

376

I PowerShell Studio -

A Comprehensive Guide

PROPERTY Controls

DESCRIPTION Gets the collection of controls contained \:Vithin the control.

Created

Gets a value indicating whether the control has been created.

CreateParams

Custom.Format

Gets the required creation parameters when the co11trol band.le is created.(Overrides Control. CreateParams.) Gets or sets the cursor that is displayed when the mouse pointer is over the co11tro l. Gets or sets the custom date/time format string.

DataBindings

Gets the data bindings for the co11trol.

DefaultCursor

Gets or sets the default cursor for the control. Gets the default Input Method Editor (Thffi) mode supported by the control. Gets the space, in pi,"{els, that is specified by default bet\tveen controls.

Cm·sor

DefaultlmeMode DefaultMargin

DefaultPadding

Gets the length and height, in pixels, that is specified as the default maximum size of a control. Gets the lengtl1 ai1d height, in pixels, that is specified as the default nlinimtlffi size of a control. Gets the internal spacing, in pixels, of the contents of a control.

Defau It Size

Gets the default size of the control. (Overrides Control.DefaultSize.)

DesignMode

Gets a value that indicates whetl1er the Component is currently in design mode.(lnherited from Component.) Gets the rectangle that represents the display area of the control.

DefaultMaximumSize DefaultMinimumSize

DisplayRectangle

Focused

Gets a value indicating whether the base Control class is in the process of disposing. Gets or sets wltich control borders are docked to its parent control and determines ho"v a control is resized \:Vith its parent. This API supports the product infrastructure and is not intended to be used directly from your code. Gets or sets a value indicating \:vhether the control should redra"v its surface using a secondary buffer. Setting this property has no effect on the DateTimePicker control. (Overrides Co11trol.DoubleBuffered.) Gets or sets the aligm11ent of the drop-down calendar on the DateTitnePicker control. Gets or sets a value indicating wl1ether the control can respond to user interaction. Gets the list of event handlers that are attached to this Component. (Inl1e1ited fron1 Component.) Gets a value indicating whether the control has input focus.

Font

Gets or sets the font of the text displayed by the control.

FontHeight

Gets or sets the 11eight of the font of the control.

ForeColor

Format

This API supports the product infrastructure and is not iI1tended to be used directly fJon1 yotlf code. Gets or sets the foreground color of the DateTimePicker control. (Overrides Control.ForeColor.) Gets or sets t11e fonnat of the date and tilne displayed in the control.

Handle

Gets the window handle that the control is botmd to.

Dis1>osing Dock DoubleBuffered

DropDo,vnAlign Enabled Events

PowerShell Studio - Reference Guide PROPERTY Has Children

I 377

Height

DESCRIPTION Gets a value indicating whether the control contains one or more child controls. Gets or sets the height of the control.

lmeMode

Gets or sets the h1pt1t Method Editor (IME) mode of the control.

ImeModeBase

Gets or sets the IME mode of a control.

Invol\.eRequired

IsDisposed

Gets a value indicating whether tl1e caller must call an invoke method when making method calls to the control because the caller is on a different thread than the one the control was created on. Gets or sets a value indicating whether the control is visible to accessibility applications. Gets a value indicating whether the control has been disposed of.

IsHandleCreated

Gets a value indicating whetl1er the co11tro1 has a 11andle associated with

IsAccessible

it.

IsMirrored

Gets a value indicating whether the control is mirrored.

Layou tEngine

Gets a cached instance of the control's layout engine.

Left

Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area. Gets or sets the coordi1iates of the upper-left con1er of the control relative to the upper-left corner of its container. Gets or sets the space between controls.

Location Margin Ma."\:Date Ma."timumDateTime MaximumSize MinDate Minimu mDateTime MinimumSize Name

Gets or sets the maximum date and tin1e tl1at can be selected in the control. Gets the maximtu11 date value allovved for the DateTi111ePicker control. Gets or sets the size that is the upper lin1it that GetPreferredSize can specify. Gets or sets the mi11imu1n date and time that can be selected in the control. Gets tl1e 1ni1li111tun date vaJue allo,ved for the DateTimePicker control. Gets or sets the size that is the lower limit that GetPreferredSize can specify. Gets or sets the llafile of the control.

Parent

This API supports the product infrastructure and is not intended to be used directly from your code. Gets or sets the spacing between the contents of the DateTimePicker control and its edges. Gets or sets the parent co11tainer of the control.

PreferredHeight

Gets the preferred height of the DateTimePicker control

PreferredSize

Gets tl1e size of a rectru1gular area into which the control can fit.

ProductName

Gets the product name of tl1e assembly containing the control.

ProductVersion

Gets tl1e version of the assembly co11taining the control.

RecreatingHandle Region

Gets a value iI1dicafu1g whether tl1e control is cturently re-creating its 11anclle. Gets or sets the vvindow region associated ~vith the control.

RenderRightToLeft

Obsolete.This property is now obsolete.

Padding

378

I PowerShell Studio -

A Comprehensive Guide

PROPERTY

DESCRIPTION Gets or sets a value indicati11g \V hether the control redra\.vs itself when ResizeRedraw resized. Gets the distance, in pixels, betwee11 the right edg~ of the control and the Right left edge of its container's client area. Gets or sets a value indicating \.vl1etber control's eleme·n ts are aligned to RightToLef't support locales using right-to-left fonts. Gets or sets \.vhether the contents of t11e DateTi1nePicker are laid out RightToLeftLayout from 1igl1t to left. Gets a value that detennines the scaling of child controls. ScaleChildren

Site

Gets or sets a value indicating wl1etber a check box is displayed to the left of the selected date. Gets a value indicating \vbether the control should display focus rectangles. Gets a value indicating \vhether the user interface is in the appropriate state to show or hide keyboard accelerators. Gets or sets a value indicating whether a spin button control (also known as an up-down control) is used to adjust the date/tilne value. Gets or sets the site of the control.

Size

Gets or sets tl1e height and widtl1 of the control.

Tablndex

Gets or sets the tab order of the control '1vithin its co11tainer.

TabStop

Gets or sets a value indicating \.vhether the user can give the focus to this control using the TAB key. Gets or sets the object that contains data about the control

ShowCheckBox Show FocusCues Sho\vKeyboard Cues Sho\vUpDown

Tag Text Top TopLevelControl

UseW aitCursor Value

Gets or sets the text associated \.vitl1 this control. (Overrides Control. TeA't.) Gets or sets the distance, in pixels, bet'Ween the top edge of the control and the top edge of its container's client area. Gets the parent control that is not parented by a11other Wi11dows Fon11S control. Typically, this is the outer1nost Form that tl1e control is contained in. Gets or sets a value indicating wl1ether to use the wait cursor for the current control and all child controls. Gets or sets tlle date/tiine value assigned to tl1e control. Gets or sets a value indicating vvl1ether the control and a.11 its child controls are displayed. Gets or sets the width of the control.

Visible Width Winclo,vTarget

This API supports the product infrastructure and is not intended to be used directly from your code. This property is not relevant for this class.

DOMAINUPDOWN PROPERTY

--

AccessibilityObject Accessi b leDefaultActionDescription

DESCRIPTION --Gets the AccessibleObject assigned to tl1e control.

Gets or sets the default action description of the control for use by accessibility client ap_plications.

PowerShell Stu dio - Reference Guide. PROPERTY AccessibleDesc1iption

I 379

AccessiblelloJe

DESCRIPTION Gets or sets the description of the control used by accessibility client applications. Gets or sets the name of the co11trol used by accessibility client applications. Gets or sets the accessible role of the control

ActiveControl

Gets or sets the active control on the container control.

AllowDrop

Gets or sets a value indicating whether the control cai.1 accept data that the user drags onto it. Gets or sets the edges of the container to ':vhich a control is botu1d and determines how a control is resized \.vith its parent. Gets or sets the dimensions that the control was designed to. Gets the scaling factor ben;vee11 tl1e Cll1Te11t and design-time auto111atic scaling din1ensions. Gets or sets the automatic sca1ing mode of the control.

Accessible.N"aine

Anchor AntoScaleDimensions AutoScaleFacto r AutoScaleMode Auto Scroll

Auto Scro IIMargin

AutoScrollMinSize

AntoScrollOffset AutoScroJIPosition AutoSize Auto Validate BackColor

Backgroundlm age

BackgroundlmageLayou t

Bin dingContext Borders tyJe Bottom

This API supports the product infrastructure and is not intended to be used directly from your code. Gets a value indicating whether the container will allow the user to scroll to any controls placed outside of its visible boundaries. This API supports the product infrastructure and is not intended to be used directly fro111 yol1r code. Gets or sets the size of the autoscroll margin. This API supports the product infrastn1cture ru1d is not intended to be used directly fro1n your code. Gets or sets the rnitlimun1 size of the auto-scroll area. Gets or sets where tl1is control is scrolled to in Scroll ControllntoVievv. Gets or sets tl1e location of the auto-scroll position. Gets or sets a value indicating whether the control should automatically resize based on its contents. Gets or sets a value that indicates whether controls in tllls contai11er will be automatically ' 'alidated when the focus changes. Tills API supports the product infrastn1cture and is not intended to be used directly from your code. Gets or sets the background color for tlle teA1 box portion of the spin box (also knovv11 as ru1 up-down control). Th.is API suppo1ts tlle product infrastn1cture and is not intended to be used directly from yot1r code. Gets or sets the background irnage for the UpDownBase. This API supports the product infrastn1cture and is not intended to be used directly from your code. Gets or sets the layout of tlle Backgroundlmage of the UpDo,vnBase. Gets or sets the BindingContext for the control. Gets or sets the border sty le for the spin box (.also kno\v-n as an updown control). Gets tl1e distance. in pixels, bet\veen the bott om edge of the control and the top edge of its container's client ai·ea.

380

I PowerShell Studio -

A Comprehensive Guide

CanFocus

DESCRIPTION Gets or sets the size and location of the control including its nonclient elements, in pi,"'{els, relative to the parent control. Gets a value indicating whether the ImeMode pi-operty can be set to an active value, to enable IME support. Gets a ,ralue indicating whether the control can receive foct1s.

CanRaiseEvents

Determines if events can be raised on the control.

CanSelect

Gets a value indicating whether the control can be selected.

Capture

Clie.ntRectan gle

Gets or sets a value indicati11g whether the control has captured the n1ouse. Gets or sets a value indicatil1gwl1ether the control causes validation to be performed on any controls that require validation when it receives focus. Gets or sets a value indicating ~vhether tl1e text property is being changed ii1ten1ally by its parent class. Gets the rectangle that represents the client area of the control.

ClientSize

Gets or sets the height and width of the client area of the control.

CompanyName

Gets the name of the company or creator of the application containing the control. Gets the !Container that contaiI1s the Component.

PROPERTY

Bounds CanEnablelme

CausesValidation

ChangingText

Container

Controls

Gets a value indicating whether the control, or one of its child controls, currently lias the input focus. This API supports the product infrastn1cture and is not intended to be used directly fro1nyour code. Gets or sets the shortcut menu associated with the spin box (also known as an up-dovvn control). Gets or sets the shortcut menu for the spin box (also k11own as an up-down control). Gets the collection of controls contained within the control.

Created

Gets a value indicating whether the control lias been created.

CreateParams

This API supports the product infrastructure and is not intended to be used directly fro1n your code. Gets the required creation paraineters when the control handle is created. Gets the current run-tilne dimensions of the screen.

Contai.nsFocus ContextMenu

ContextMenuStrip

Cu r1·entAu toScaleDimensions

DataBindings

Gets or sets the cursor that is displayed vvhen the mouse pointer is over the control. Gets the data bindings for the control.

DefauJtC'ursor·

Gets or sets the default cursor for tl1e control

DefaultlmeMode

Gets the default Input Method Editor (IME) mode supported by t11e control. Gets the space, in pi,"'{els, that is specified by default bet\veen controls. Gets the length and height, in pixels, that is specified as the default tnaximmn size of a control. Gets the lengtl1 and height, in pixels that is specified as the default minimtun size of a control Gets the internal spacing, in pixels of the contents of a control.

Cursor

DefaultMargin DefaultMaximumSize DefaultMi.nimumSize DefaultPadding

PowerShell Studio - Reference Guide

I 381

PROPERTY

DESCRIPTION

DefaultSize

Gets the default size of tl1e control.

DesignMode

Events

Gets a value that indicates \ivl1ether the Component is c1mently in design mode. Gets the rectangle that represents tl1e virtual display area of the control. Gets a value indicating whether the base Control class is in the process of disposing. Gets or sets which control borders are docked to its parent control and deten1lines how a control is resized with its parent. This API supports the product infrastructure and is not intended to be used directly from yo11r code. Gets the dock padding settings for all edges of the UpDownBase control. Gets or sets a value indicating \:vhetber this control should redraw its surface using a secondary buffer to reduce or prevent flicker. Gets or sets a value indicating whether the control can respond to user interaction. Gets tl1e list of event handlers that are attached to this Component.

Focused

Gets a value indicating wbetl1er the control has input focus.

Font

Gets or sets the font of the teA1 displayed by the control.

FontHeight

Gets or sets the height of the font of the control.

ForeColor

Gets or sets the foreground color of the spin box (also known as an up-down control). Gets t11e vvindo\iv liandle t11at the contro1 is bo1md to.

Dis11layRectangle Disposing Dock DockPadding

DoubleBuffered Enabled

Handle

Height

Gets a value indicati.I1g whetl1er the control contains one or more child controls. Gets or sets the height of the control.

HorizontaJScroll

Gets the characteristics associated \Vitl1 the horizontal scroll bar.

HScroll ImeMode

Gets or sets a value indicating whether the 11orizontal scroll bar is visible. Gets or sets the Input Method Editor (IME) mode of the contTol.

ImeModeBase

Gets or sets t11e IME mode of a control.

lntercepU\rroW'l(eys

Gets or sets a value indicating ,;vhetl1er the user can use t11e UP ARROW and DOWN ARROW keys to select values. Gets a value indicati.11g whetl1er tl1e caller n1ust call an invoke metl1od when making method calls to the control because the caller is on a different thread than the one the control was created on Gets or sets a value indicating ,;vhether the control is visible to accessibility applications. Gets a value indicating whether tl1e control has been disposed of.

H.asChildren

JnvokeRequired

IsAccessible IsDisposed IsHandleCreated IsMirrored Items

Gets a value indicating whether tl1e coutrol lias a handle associated \Vith it. Gets a value indicating whether tl1e control is mirrored. A collection of objects assigned to tl1e spin box (also known as an up-do\.vn control).

382

I PowerShell Studio -

A Comprehensive Guide

PROPERTY LayoutEngine

DESCRIPTIC>N Gets a cached instance of the control's layout engine.

Left

Gets or sets the distance, in pixels, between the left edge of the control ru1d tJ1e left edge of its container's client area. Gets or sets the coordinates of t11e upper-left comer of the control relative to the upper-left comer of its container. Gets or sets the space ben-;veen controls.

Location Margin MaximumSize MinimumSize Name

Gets or sets the maximum size of the spin box (also kno"vn as an up-down control). Gets or sets the rninimum size of the spin box (also know11 as an up-down control). Gets or sets the name of the control.

Parent

This API supports the product infrastn1cture and is not intended to be used directly fro111 your code. Gets or sets the spacing between the Domai11UpDown control's co11tents and its edges. Gets or sets the parent container of the control.

ParentForm

Gets the form that the container control is assigned to.

PreferredBeight PreferredSi1,e

Gets tl1e heigl1t of the spin box (also known as an up-d.ovvn control). Gets the size of a rectangular area into \Vhi.ch the control can fit.

ProductName

Gets the product name of the assembly containing the control.

ProductVersion

Gets the version of the assembly containing the control.

Read Only

Gets or sets a value indicati11g wl1ether the text can be changed by tl1e use of the up or do,vn buttons only. Gets a value indicating \vhether the control is currently re-creating its handle. Gets or sets the window region associated ' vith the co11trol. Obsolete.Tins property is now obsolete.

Padding

RecreatingHandle Region RenderRightToLeft

ScaleChildren

Gets or sets a value indicating whether the control redraws itself when resized. Gets the distru1ce, in pixels, behveen the right edge of the control and the left edge of its container's client area. Gets or sets a value indicating whether control's elements are aligned to support locales using right-to-left fo11ts. Gets a value that detennines the scaling of child controls.

Selectedlndex

Gets or sets the index value of the selected item.

Selectedltem

Site

Gets or sets the selected item based on the index value of the selected item in the collection. Gets a value indicating whether the control should display focus rectangles. Gets a value indicating \V hether the user interface is in the approp1iate state to sho\LeveJControl

UpDownAlign UserEdit UseW aitCu rsor

VerticalScroll

Gets or sets the text displayed in the spin box (also known as an up-do\>vn control). Gets or sets the aligru:nent of the text in the spin box (also known as an up-down control). Gets or sets the distance~ in p.Lxels, bet"\veen the top edge of the control and the top edge of its container's client area. Gets t11e parent control that is .not parented by another Windo\;vs Fo1IDS control. Typically this is the outer1nost Form that the control is contained in. Gets or sets the alignment of tl1e up and down buttons on the spin box (also known as an up-down control). Gets or sets a value indicating \Vhether a value has been entered by the user. Gets or sets a value indicating vvhether to use the wrut cursor for the current control and all child controls. Gets the cliaracteristics associated wit11 the ve1tical scroll bar. Gets or sets a value indicating whetl1er tl1e control and all its child controls are displayed. Gets or sets a value indicating \Vhetber the vertical scroll bar is visible. Gets or sets the width of the control.

Visible VScroll Width

This API supports the product infrastructure and is not intended to be used directly fron1 yo11r code. This property is not relevant for this class. Gets or sets a value indicating wbetlier the collection of items continues to the first or last item if the user continues past the end of the list.

Window Target

Wrap

ERRORPROVIDER

Blinl Controls Created C reateP aram s Cursor DataBindings DefaultCursor DefaultlmeMode Defau ltMargin DefaultMaximumSize DefaultMinimumSize DefaultPadding DefaultSize DesignMode DisplayRectangle Disposing Dock

DockPadcling DoubleBuffered

Enabled Events Flo\vDirection

A Comprehensive Guide Gets the !Container that contains the Component. Gets a value indicating'"hether the control, or one of its child controls, currently has the ~put focus. Gets or sets the shortcut menu associated with the control. Gets or sets the ContextMenuStrip associated with this control. Gets the collection of controls contained within the control. Gets a value indicating vvhetl1er the control has been created. Gets the required creation parameters when the control l1andle is created.(Inherited from Panel.) Gets or sets the cursor that is displayed when the n1ouse poiirter is over the control. Gets the data bindings for the control. Gets or sets the default cw·sor for the control. Gets the default Input Method Editor (IJ\.1E) mode supported by the control. Gets the space, iI1 pi,'{els, that is specified by default between controls. Gets the length and 11eight. in pixels, that is specified as the default maximtllll size of a control. Gets the length and 11eight, in pi,xels, that is specified as the default m:i.J1in1wu size of a control. Gets the internal spacing, in pixels, of the contents of a control. Gets the default size of the control.(Inherited from Panel.) Gets a value that indicates whetl1er the Component is currently in design mode. Gets the rectangle that represents t11e virtual display area of the control. Gets a value indicating whether the base Control class is in the process of disposing. Gets or sets vvhich control borders are docked to its parent control and determines how a control is resized vvith its parent. Gets the dock padding settings for all edges of the control. Gets or sets a value indicating whether this control should redraw its surface using a secondary buffer to reduce or prevent flicker. Gets or sets a value indicating whether the control can respond to user interaction. Gets the list of event handlers that are attached to this Component. Gets or sets a value indicating tl1e flow direction of the FlowLayoutPanel control.

PowerShell Studio - Reference Guide

I 387

FontHeight

Gets a v~lue indicating whether tl1e control has input focus. Gets or sets the font of the tex.1: displayed by tl1e control. Gets or sets the height of tl1e font of the control.

ForeColor

Gets or sets the foreground color of the control.

Handle

Gets the \:vindo\¥ handle that the control is bound to.

HasChildren

Gets a value indicating \¥hether the control contains one or more child controls. Gets or sets the height of the control.

Focused Font

Height HorizontalScroll HScrolJ ImeMode lmeModeBase lnvol{eRequired

lsAccessible IsDisposecl lsHandJeC reated IsMirrored LayoutEngine Left

Location

Margin

Gets the characteristics associated with the horizontal scroll bar. Gets or sets a val.ue indicating whether the horizontal scroll bar is visible. Gets or sets the Input Method Editor (IME) mode of the control. Gets or sets the IME 1node of a control. Gets a value indicating whether tl1e caller 1nust call an invoke nlethod when 1naking 1nethod calls to the control because th.e caller is on a different thread than the one the control was created on. Gets or sets a value indicating whether the control is visible to accessibility applications. Gets a value indicating whether the control has been disposed of. Gets a value indicating wl1ether the control has a handle associated with it. Gets a value indicating \vhether the control is mirrored. Gets a cached instance of the panel's layout engine.(Overrides Control.LayoutEngine.) Gets or sets the distance, in pixels between the left edge of the control ru1d t11e left edge of its container's client area. Gets or sets the coordiuates of the upper-left corner of the control relative to the upper-left comer of its container. Gets or sets the space between controls.

Name

Gets or sets the size that is the upper lirnit that GetPrefelTedSize can specify . Gets or sets the size tliat is the lo,ver limit that GetPreferredSize can specify. Gets or sets the name of tl1e control.

Padding

Gets or sets padding within the control.

Parent

Gets or sets the parent container of the control.

Prefen·edSize

Gets the size of a rectangular area into \Vhicl1 the control can fit.

Maximu mSize Minimu mSize

388

I PowerShell Studio -

ProductName ProductVersion RecreatingHanclle Region Ren derRightToLeft

A Comprehensive Guide Gets the product name of the assembly containing the control. Gets the version of tl1e assen1bly containing the control. Gets a value indicating whetl1er the control is currently re-creating its handle. Gets or sets the wil1dow region associated with the control. Obsolete.This property is now obsolete.

Site

Gets or sets a value indicating 'vhether the co11trol redraws itself \.v henresized. Gets the distance in pixels. between the right edge of the control and the left edge of its container's client area. Gets or sets a value indicating \Vhether control's elements are aligned to support locales using rigl1t-toleft fonts. Gets a value that determines the scaling of child controls. Gets a value indicating whether the control should display focus rectangles. Gets a value indicating whether the user il1terface is in fue appropriate state to show or hide keyboard accelerators. Gets or sets the site of tl1e control.

Size

Gets or sets the height and 'vidth of the control.

TabIndex

Gets or sets the tab order of the control within its container. Gets or sets a value indicatil1g whether tl1e user can give the focus to tllis control using the TAB key. (Inherited from Panel.) Gets or sets the object that contains data about the control. This API supports the product infrastn1cture and is not intended to be used directly fro1n your code. This n1ember is not meaningful for tl1is control.(lnherited from Panel.) Gets or sets the distance, in pixels, behveen the top edge of the control and the top edge of its container's client area. Gets the parent control tliat is not parented by another Windo\.vs Forms control. Typically, tllis is the outennost Fonn tllllt the control is contained in. Gets or sets a value indicating whether to use the wait cursor for the current control and all child controls. Gets the characteristics associated V\1ith the vertical scroll bar. Gets or sets a value indicati11g wbet11er the control and all its child controls are displayed.

ResizeRed raw Right

RightToLeft

ScaleCbildren Sho\v FocusCues SbowKeyboardCues

TabStOJl

Tag Text

Top

TopLevelCont rol

UseWaitCursor VerticalScroll Visible

PowerShell Studio - Reference Guide

I 389

Gets or sets a value indicating whether tl1e vertical scroll bar is visible. Gets or sets the width of tl1e control. Th.is API st1pports the product infrastructure and is not intended to be used directly from yotu code. This property is not relevant for this class. Gets or sets a value indicating w11ether the Flo\.YLayoutPanel control should wrap its contents or let tl1e contents be clipped.

VScroll Width Windo\vTarget

WrapContents

FOLDERBROWSERMODERNDIALOG PROPERTIES Container Description RootFolder SelectedPatb Sholl1Ne,vFolderButton Site Tag

DESCRIPTION Gets the I Container t11at contains the Co1nponent.(Inherited fro1n Component.) Gets or sets the descriptive text displayed above tl1e tree view control in the dialog box. Gets or sets the root folder \.vhere tl1e browsing struts fro1n. Gets or sets the path selected by the user. Gets or sets a value indicating whether the New Folder button appears in the folder browser dialog box. Gets or sets the ISite of the Co111ponent. Gets or sets an object that contains data about tl1e control.

FONTDIALOG Name AllowScriptChange Allows imulations Allo,vVectorFonts Allo,vVe11icalFonts CanRaiseEvents Color Container DesignMode

Description Gets or sets a value indicating \¥hether the user can change the cliaracter set specified in the Script combo box to display a character set otl1er than tlle one currently displayed. Gets or sets a value indicating whether the dialog box allows graphics device inte1face (GDI) font simulations. Gets or sets a value i11dicating whether the dialog box allo\>vs vector font selections. Gets or sets a value indicating \vhether the dialog box displays both vertical and horizontal fonts or only horizontal fonts. Gets a value indicating wl1ether tl1e compo11ent can raise an event. (Inherited from Component.) Gets or sets the selected font color. Gets the !Container that contains tl1e Component. (Inherited from Component.) Gets a value that indicates whether the Component is currently in design inode. (Inherited fron1 Co1npo11ent.)

390

I PowerShell Studio -

A Comprehensive Guide

Name

Description

Events

Gets tbe list of event handlers that are attached to this Component. (lnl1erited fro1n Component.) Gets or sets a value indicating whether the dialog box allo,vs only the selection of fixedpitch fonts. Gets or sets the selected font. Gets or sets a value indicating wl1ether the dialog box specnies an error condition if the user atten1pts to select a font or style that does not exist.

FixedPitcb 0 nly Font FontMustExist

MaxSiz,,e MinSize 01>tions Scripts Only Show Apply ShowColor Sho,vEffects Sbo,vHelp

Site Tag

Gets or sets tl1e maximum point size a user can select. Gets or sets tbe 111ini1num point size a user can select. This API supports the product infrastructure and is not intended to be used directly from your code. Gets values to initialize the FontDialog. Gets or sets a value indicating 'vhether the dialog box allows selection of fonts for all non-OEM and Symbol character sets. as 'veil as the ANSI character set. Gets or sets a value indicating whether tl1e dialog box contains ai1 Apply butto11. Gets or sets a value indicating whether the dialog box displays the color choice. Gets or sets a value indicating whether the dialog box contains controls that allow the user to specify strikethrough, tmderline. and text color options. Gets or sets a value indicating whether the dialog box displays a Help button. Gets or sets the ISite of the Co1nponent. (Inherited fro1n Coniponent.) Gets or sets an object that contains data about the control. (Inherited from CommonDialog.)

GROUP BOX PROPERTY Actu alHeight ActualWidtb Allo,vDrop AreAnyTouchesCaptu red AreAnyTouchesCapturedWith • m

AreAnyToucbesDirectlyOver AreAnyToucbesOver BaclingGuidelines Width

--

I 395

DESCRIPTION

---

Obsolete.Gets or sets the BitmapEffectlnput value for the Visual. Gets or sets the BittnapScalingMode for the Visual. Gets or sets a cached representation of the Visual. Gets the number of visual child ele1nents \Vithin this ele1nent. Gets or sets the ClearTypeHint that detemlines how ClearType is rendered in the Visual. Gets or sets the clip region of the Visual as a Geometry value. Gets or sets the edge mode of the Visual as an EdgeMode value. Gets or sets the bitmap effect to apply to the Visual. Gets or sets tbe offset value of the visual object. Gets or sets the opacity of the Visual. Gets or sets tbe Brush value that represents the opacity inask of the Visual. Gets the visual tree parent of the visual object. Gets or sets a clipped scrollable area for the Visual. Gets or sets the TeA1:HintingMode of the Visual. Gets or sets tbe TeA1RenderingMode of the Visual. Gets or sets tbe Transfon11 value for the Visual. Gets or sets the x-coordinate (vertical) guideline collection. Gets or sets they-coordinate (horizontal) guideline collection. Gets or sets the width of the element.

HELPPROVIDER PROPERTY C anRaiseEvents Container Design Mode Events HelpNamesi>ace Site Tag

DESCRIPTION

Gets a value indicating whether tl1e component can raise an event. Gets the IContai11er that contains the Co1nponent. Gets a value that indicates whether the Component is currently in design mode. Gets the list of event handlers that are attached to this Co1nponent Gets or sets a value specifying the name of the Help file associated with this HelpProvider object. Gets or sets the I Site of the Component Gets or sets the object that contains supplemental data about the HelpProvider.

IMAGELIST

ColorDepth Container Handle HandleCreated Images ImageSize

Gets the color depth of the image list. Gets tl1e !Container that contains tl1e Component. Gets the hai1dle of the m1age list object. Gets a value indicating \.Vhether the underlying Win3 2 handle bas been created. Gets the lmageList.ImageCollection for this image list. Gets or sets the size of U1e images in the image list.

396

I PowerShell Studio -

lmageStream Site Tag Trans1>arentColor

A Comprehensive Guide

Gets the ImageListStreamer associated \Vith this image list. Gets or sets tl1e ISite of the Co1nponent. Gets or sets a11 object that contains additional data about the I111ageList Gets or sets tl1e color to treat as transparent.

LABEL

'

Actuameight

Gets tbe rendered height of this element.

ActuaJWidth

Gets the rendered width of tlris ele111ent.

AllowDrop

Background

Gets or sets a value indicating \:vhether this element can be used as the target of a drag-and-drop operation. This is a dependency property. Gets a value that indicates -vvhether at least one touch is captured to this element. Gets a value that indicates \.Vhether at least one touch is captured to this element or to any clrild elements in its visual tree. Gets a value that indicates whether at least one toucl1 is pressed over this element. Gets a vallte that indicates whether at least one touch is pressed over tlris element or any cltlld elements in its visual tree. Gets or sets a bn1sh that describes tl1e background of a control.

BindingGroup

Gets or sets the BindingGroup that is used for tl1e element.

Bitm a1>Effect

Obsolete.Gets or sets a bittnap effect tl1at applies directly to the rendered content for this ele.ment. Tltls is a dependency property. Obsolete. Gets or sets an input source for the bitmap effect tl1at applies directly to the rendered content for tlris element. This is a dependency property. Gets or sets a bn1sh tl1at describes the border backgrolmd of a control.

AreAnyTouchesC a1>tu red AreAnyTouchesCa1>tu red Within AreAnyTouchesDirectlyOver AreAnyTouchesOver

BitmapEffectlnput

BorderBrush Bo rderThiclrness CacheMode Clip Cli1>T0Bounds

CommandBindings

Content ContentStringFormat

Gets or sets the border thick11ess of a control. Gets or sets a cached representation of the UIBle111ent. Gets or sets the geometry used to define the outline of the contents of an elen1ent. This is a dependency property. Gets or sets a value iI1dicating whether to clip tl1e content of tllis ele1nent (or content coining from the clilld ele1nents of tllis ele1nent) to fit into tl1e size of the containing ele1nent. This is a dependency property. Gets a collection of ConnnandBinding objects associated with this element. A Co1nmai1dBinding enables command handling for this ele1nent, and declares tl1e linkage between a co1nmand, its events, and tl1e handlers attached by tltls element. Gets or sets the content of a Conte11tControl. Gets or sets a composite string that specifies how to format tl1e Content property if it is displayed as a string.

PowerShell Studio - Reference Guide

I 397

FontFamily

Gets or sets t11e data template used to display the content of the ContentControl. Gets or sets a template selector that enables an application \Vriter to provide custom template-selection logic. Gets or sets the context 1nenu element that should appear whenever tl1e conteA1: menu is requested through user inte1face (UI) from ';vithin this element. Gets or sets the cursor that displays when tl1e mouse pointer is over this element. Gets or sets the data conteA1: for a11 element when it participates in data binding. Gets or sets the key to use to reference the style for this control, when theme styles are used or defined. Gets the DependencyObjectType that \vraps tl1e CLR type of this insta11ce. Gets the size that this element computed during tb.e meas1rre pass of tl1e layout process. Gets the Dispatcher this DispatcberObject is associated witl1. (Inherited from DispatcherObject.) Gets or sets the bittnap effect to apply to the UIElement. This is a dependency property. Gets or sets the direction tl1at teA1: and other user il1terface (Ul) elen1ents flo"v witlrin any parent ele1nent that controls tl1eir layout. Gets or sets a value that indicates 'vhether the element ca11 receive focus. Tlris is a dependency property. Gets or sets a property that enables custo1nization of appearance, effects, or otl1er sty le characte1istics that \Vill apply to this element when it captures keyboard focus. Gets or sets the font family of the control.

FontSize

Gets or sets the font size.

FontStretch FontStyle

Gets or sets the degree to wlrich a font is condensed or eA'Pailded on the screen. Gets or sets the font style.

FontWeight

Gets or sets the weight or tlrickness of the specified font.

F 01·ceCu rso i·

Foreground

Gets or sets a value tllat indicates whether this FrameworkEle1nent should force the user interface (UI) to render tl1e ctrrsor as declared by tl1e Cursor property. Gets or sets a brush that describes the foreground. color.

Han dlesScrolling

Gets a value that indicates whether a control supports scrolling.

HasAnimatedP ro11e11ies

Gets a value indicating ,;vhether tlris element has any anitnated

ContentTemplate ContentTemplateSelector ContextMenu.

Cursor DataContei'1 DefaultStyleKey De11en dencyOb jectType DesiredSize Dispatcher Effect FlolvDirection Focusable FocusVisualStyle

pr~perties.

HasContent HasEffectiveKeyboardFocus

Gets a value that indicates whether the ContentControl contains content. Gets a val11e that indicates whether the UIElement has focus.

Height

Gets or sets the suggested height of the element.

398

I PowerShell Studio -

A Comprehensive Guide

HorizontalAlignment

HorizontaJContentAlignment InberitanceBehavior lnputBindings lnflotScope lsArrangeValid lsEnabled lsEnabledCore IsFocusecl lsHitTestVisible

lsInitialized

lslntJutMethodEnabled

lsKeyboardFocu sed • lsKeyboardFocu sWithin

lsLoaded lsManipulationEnabled lsMeasu reValid lsMouseCaptu red lsMouseCaptureWithin

lsMouseDirectlyOver •

lsMouseOver

Gets or sets the .horizontal alignment characteristics applied to this element when it is composed within a parent element, such as a panel or items control. Gets or sets the horizontal alignment of the control's content. Gets or sets the scope limits for property value inheritance, resource key lookup, and Relative Source Find.Ancestor lookup. Gets the collection of input bi.ridings associated "vith this element. Gets or sets the conte:t\.1 for input used by tltis FramevvorkElement. Gets a value indicating whether the computed size and position of cltild elements in tltis element's layo11t are valid. Gets or sets a value indicating whether tltis ele1nent is enabled in the user interface (U1). This is a dependency property . Gets a value that becomes the return value of IsEnabled in derived classes. Gets a value tliat determines whether this ele1nent has logical focus . This is a depe11dency property. Gets or sets a val11e that declares 'vhether this ele1uent can possibly be returned as a hit test resttlt from some portion of its rendered content. Tltis is a dependency property. Gets a value tliat indicates whether this element has been initialized, either during processing by a XAJv1L processor, or by explicitly having its Endlnit method called. Gets a value indicating whether an input 1uetl1od systen1, such as an Input Method Editor (IME), is enabled for processing the input to this ele1nent. Gets a value indicating whether this element lias keyboard focus. Tltis is a dependency property. Gets a value indicating whether keyboard focus is anywhere witltin the ele1nent or its visual tree cltild elements. TJtis is a dependency property. Gets a value tliat indicates whether this element has been loaded for presentation. Gets or sets a value tliat indicates whether 1nanipulation events are enabled on tltis UIElement. Gets a value indicating whether tl1e current size returned by layout measure is valid. Gets a value indicating whether the inouse is captured to tltis ele1uent. Tltis is a dependency property. Gets a value tliat detennines vvl1ether mouse capture is held by this element or by child elements in its visual tree. This is a dependency property. Gets a value that i.r1dicates \V hether the position of the mouse pointer corresponds lo ltit test res1tlts, \Vltich take ele1nent compositing into account. This is a dependency pro2erty. Gets a value indicating whether the mouse pointer is located over this element (including cllild elements in the visual tree). This is a dependency property.

PowerShell Studio - Reference Guide.

I 399

LogicalChildren

Gets a value tl1at indicates whether this instance is ctuTently sealed (read-only). Gets a value indicating whether the stylus is captured by this element. This is a dependency property. Gets a value that detennit1es whether stylus capture is held by this element. or an ele1nent within the element bounds ai1d its visual tree. This is a dependency prope1fy. Gets a value that indicates whether the stylus position corresponds to hit test results whicl1 take element compositing into account. This is a dependency property. Gets a value indicating whether the stylus cursor is located over this element (including visual child eleme11ts). This is a depende11cy property. Gets or sets a value that indicates whether a control is included in tab navigation. Gets a value indicating \.vhether this element is visible in the user interface (UI). This is a dependency property. Gets or sets localization/globalization language information that applies to an element. Gets or sets a graphics transformation that should apply to this ele1nent when layout is perfonned. Gets an enumerator to tl1e content control's logical child eleme11ts.

Margin

Gets or sets the outer nlargin of an element.

MaxHeight

Gets or sets the maximum height constraint of the element.

MaxWjdtb

Gets or sets the niaximmn width constraint of the element.

MinHeight

Gets or sets the nlini1ntun height constraint of the ele1nent.

MinWidth

Gets or sets the minimum "vidth constrai11t of the elen1ent.

Name

Padding

Gets or sets the ide11tifying nan1e of the element. The naine provides a reference so that code-behind, such as event handler code, can refer to a markup element after it is constructed dtrring processing by a XA11L processor. Gets or sets the opacity factor applied to the entire UIEle1nent when it is rendered in the user interface (UI). This is a dependency property. Gets or sets an opacity mask, as a Bn1sb inlplen1entation that is applied to ru1y alpha-cbannel maslcing for the re11dered content of this elen1ent. This is a dependency property. Gets or sets a value that indicates whether this element incorporates style properties from theme styles. Gets or sets the padding inside a control.

Parent

Gets the logical parent element of this element.

Persistld

Obsolete. Gets a value that uniquely identifies this ele1nent.

RenderSize

Gets (or sets, but see Ren1arks) tl1e final render size of this ele1nent.

RenderTransform

Gets or sets transform infom1ation that affects the rende1ing position of this ele1nent. This is a dependency pr~perty.

IsSealed IsS tylusC aptured IsStylusCa1JtureWithin

IsStylusDii·ectlyOver

IsStylusOver

IsTabStop IsVisible Language LayoutTransform

Opacity OpacityMasi
sT0DevicePixels

Style StylusPlu gins Tablndex

Tag Target Template Tem1>latedParent ToolTi(l TouchesCaptured TouchesCapturedWithin TouchesDirectlyOver ToucbcsOver Triggers Uid

U seLayoutRounding VerticalAJign ment

VerticalContentA1ignment

A Comprehensive Guide

Gets or sets the center point of any possible render transform declared by RenderTransfonn, relative to the bounds of the element. This is a dependency property. Gets or sets the locally-defined resom:ce dictionary. Gets or sets a value that detennines \Vhether re11deri11g for this element should use device-specific pi,xel settings during rendering. Th.is is a dependency property. Gets or sets the style used by this element when it is rendered. Gets a collection of all stylus plug-in (customization) objects associated \Vith th.is ele1nent. Gets or sets a value tl1at detennines the order in which ele1nents receive focus \Vl1e11 the user navigates through controls by using the TAB key. Gets or sets an arbitTary object value that can be used to store custon1 info1mation about this ele1nent. Gets or sets the element that receives focus when the user presses the label's access key . Gets or sets a control template. Gets a reference to the ten1plate parent of this ele1nent. This properly is not relevant if the element was not created through a template. Gets or sets the tool-tip object that is displayed for tlris ele1nent in the user intetface (UI). Gets all touch devices that are captlired to this elernent. Gets all touch devices that are captured to ·this ele1nent or any child elernents in its visual tree. Gets all touch devices tl1at are over this element. Gets all touch devices that are over this elen1ent or a11y child ele1nents in its visual tree. Gets the collection of triggers established directly on this ele1nent, or in child eleme11ts. Gets or sets the unique identifier (for localizatio11) for this ele1n.ent. This is a dependency property . Gets or sets a value that indicates \vhether layout rounding should be applied to this element's size and position duril1g layout. Gets or sets the vertical alignn1ent characteristics applied to tlris ele1nent when it is co1nposed within a parent element such as a panel or ite1ns control. Gets or sets tl1e vertical alignment of the control's content.

Visu alBitmapEffect

Gets or sets the user interface (UI) visibility of this ele1nent. This is a dependency property . Obsolete.Gets or sets the BitmapEffect value for the Visual.

VisualBitmapEffectln put

Obsolete.Gets or sets the BitmapEffectlnput value for the Visual.

VisualBitmapScalingMode

Gets or sets the BitmapScalingMode for the Visual.

VisualCacheMode

Gets or sets a cached representation of the Visual.

VisualChildrenCount

Gets the number of visual child elements vvitbin this element.

Visibility

PowerShell Studio - Reference Guide

Visual Clip

Gets or sets t11e ClearTypeHint that detenuines ho"v ClearType is rendered in the Visual. Gets or sets the clip region of the Visual as a Geometry value.

VisualEdgeMode

Gets or sets the edge mode of the Visual as an EdgeMode value.

Visual Effect

Gets or sets the bitmap effect to apply to the Visual

Visual Offset

Gets or sets the offset valtte of the visual object.

VisualOpacity

Gets or sets the opacity of the Visual.

VisualOpacityMask VisualParent

Gets or sets the Brusl1 value that represents the opacity iuask of the Visual. Gets the visual tree parent of the visual object

VisualScrollableAreaClip

Gets or sets a clipped scrollable area for the Vis11al.

Visu alTextHintin gMode

Gets or sets the TextHintingMode of the Visual.

VisualTextRende1ingMode

Gets or sets the TextRende1ingMode of the Visual.

VisualTransform

Gets or sets the Transform value for tl1e Visual.

VisualXSna1JpingGuideli11es

Gets or sets the x-coordinate (ve11ical) guideline collection.

VisualYSnappingGuidelines

Gets or sets t11e y-coordinate (horizontal) guideline collection.

Width

Gets or sets the widt11 of t11e ele1ne.nt.

VisualClearTypeHint

I 401

LINKLABEL

AccessibilityO b ject AccessibleDefaultActionDescription AccessibleDescription AccessibleName AccessibleRole ActiveLinkColo r AllowDrop Anchor Au toElliJJSis

AutoScrollOffset Auto Size BackColor

Gets the AccessibleObject assigned to tl1e control. Gets or sets the default action description of tl1e control for use by accessibility client applications. Gets or sets the description of tl1e control used by accessibility client applications. Gets or sets the name of the control used by accessibility client applications. Gets or sets the accessible role of tl1e control Gets or sets the color used to display an active link. Gets or sets a value indicating whether tl1e control can accept data that the user drags onto it. Gets or sets the edges of the container to 'vhich a control is bo1u1d and detenni11es how a control is resized "vith its parent. Gets or sets a value indicating whether the ellipsis character(... ) appears at the right edge of the Label, denoting that the Label text extends beyond tl1e specified length of the Label. Gets or sets "vhere tltis control is scrolled to iI1 Scro11ControllntoView. Gets or sets a valt1e indicating whetl1er the control is automatically resized to display its entire contents. Gets or sets the background color for the control

402

I PowerShell Studio -

Backgroundlm age

Backgrou ndlmageLayout

Bin clingContext BorderStvle • Bottom Bounds CanEnablelme CanFocus CanRaiseEvents CanSelect Ca11ture CausesValidation

ClientRectangle ClicntSizc CompanyName

Container ContainsFocus ContextMenu ContextMenuStrip Controls Created CreateParams Cursor DataBindings Defau ltCurso r DefaultlmeMode Defau ltMargin Defau ltMa:\'in:tumSize Defau ltMinimumSize Defau ltPadding

A Comprehensive Guide

This API supports the product infrastructure and is not intended to be used directly from your code. Gets or sets the image rendered on tlle background of the control. This API supports the product infrastn1cttue and is not intended to be used directly fro1n yoru code. This property is not relevant fo r this class. Gets or sets tl1e BindingConte~'t for the control. Gets or sets the border sty le for the control. Gets the distance, in pixels, between the botto1n edge of the control and the top edge of its contail1er's client area. Gets or sets the size and location of the control including its nonclient elements, il1 pi-xels relati,re to the parent co11trol. Gets a value indicating ' vhet11er the lmeMode property can be set to an active value, to enable IME support. Gets a value indicating "'·hether the control can receive focus. Detennines if events can be raised on the control. Gets a value indicatil1g \vbether the control can be selected. Gels or sets a value indicating \Vhether the control has captured the mouse. Gets or sets a value indicating whether the control causes validation to be performed on any controls that require validation when it receives focus. Gets the rectangle that represents the client area of the control. Gets or sets the height and \vidth of the client area of the control. Gets the name of the company or creator of the applicatio11 containing the control. Gets the !Container that contains the Component. Gets a value indicating whetl1er the control, or one of its child controls, currently has the input focus. Gets or sets the shortcut n1enu associated \Vit11 U1e control. Gets or sets the ContextMenuStrip associated \vith this control. Gets the collection of controls contained wiUlin U1e control. Gets a value indicating '\iVhet11er the control has been created. Gets the required creation parruneters "vhen the control handle is created. Gets or sets the cursor that is displayed when the mouse pointer is over the co ntro I. Gets the data bindmgs for the control. Gets or sets the default cursor for the control. Gets the default Input Method Editor (lME) 1node supported by this control. Gets tl1e space. in pixels. that is specified by default bern1een controls. Gets the lengtl1 and beighL in pixels. that is specified as the default 1naxin1u111 size of a control. Gets the lengtl1 and height, in pixels, that is specified as the default minimum size of a control. Gets the internal spacing, in pixels, of the contents of a control.

PowerShell Studio - Reference Guide.

DefaultSize DesignMode DisabledLinkColor DisplayRectangle Disposing Dock DoubleBuffered Enabled Events FlatStyle

Focused Foot FootHeight ForeColor Handle HasChildreo Height Image ImageAJigo Imagelodex ImageKey ImageList ImeMode

ImeModeBase IovokeRequired

lsAccessible IsDisposed IsHandleC reated IsMirrored LayoutEngioe

I 403

Gets the default size of the control. Gets a value that indicates whether the Component is currently in design mode. Gets or sets the color used when displaying a disabled link. Gets the rectangle that represents the display area of the control. Gets a value indicating whether the base Control class is in tl1e process of disposing. Gets or sets \¥hich control borders are docked to its parent control and deter1nines 11ow a control is resized with its parent. Gets or sets a value indicating whether this control sl1ould redraw its surface using a secondary buffer to reduce or prevent flicker. Gets or sets a value indicating whether the control ca11 respo11d to user interaction. Gets tl1e list of event handlers that are attached to this Component. Tllis API supports the product infrastlucture and is not intended to be used directly from your code. Gets or sets the flat style appearance of tlle LinkLabel. Gets a value indicating '\ivhetller the control has input focus. Gets or sets the font of the text displayed by tl1e control. Gets or sets the height of the font of the control. Gets or sets the foreground color of the control. Gets tlle '¥indovv handle that the control is bound to. Gets a value indicating '\ivhether the control contains one or tnore child controls. Gets or sets the height of ·the control. Gets or sets the image that is displayed on a Label. Gets or sets the aligiunent of an image that is displayed in the control. Gets or sets the index value of the image displayed on the Label. Gets or sets the key accessor for the image in tl1e IniageList. Gets or sets the ImageList that contains the images to display in the Label control. This API supports the product infrastructure and is not intended to be used directly from your code. Gets or sets the hlput Method Editor (IlvfE) mode supported by this control. Gets or sets the Th1E n1ode of a control. Gets a value indicating whether tl1e caller must call an invoke 1netl1od when making n1ethod calls to tlle control because the caller is on a different thread than the one the control vvas created on. Gets or sets a value indicating whether the control is visible to accessibility applications. Gets a value indicating whetller tl1e control has been disposed of. Gets a value indicating whether the control has a handle associated with it. Gets a value indicating whether tl1e control is mirrored. Gets a cached instance of the control's layout engine.

404

I PowerShe ll Stu dio -

Left LinkArea LinkBebavior LinkColor Links LinkVisited

Location Margin Maximu mSize MinimumSize Name OverrideCu rsor Padding Parent P refcrredHeight PreferredSize Preferred Width ProductName ProductVersion RecreatingHandle Region RenderRightToLeft RenderTrans1>arent ResizeRedraw

Right

RightToLcft Scale Children ShowFocusCues Sho'vKeyboard Cues • Site Size Tab Index TabStOJ>

A Comprehe nsive Guide

Gets or sets the distance, in pi'Vhether the user interface is in the appropriate state to sho"v or hide keyboard accelerators. Gets or sets the site of U1e control. Gets or sets the 11eigl1t and 'vidth of the control. Gets or sets the tab order of the control ,,·ithin its container. Gets or sets a value that indicates ' vhether the user can tab to the LinkLabel.

PowerShell Studio - Reference Guide

Tag Text TextAlign To1> TopLevelControJ

UseCom1>atibleTextRendering U seMnemonic

UseW aitCu rso r Visible VisitedLinkColor Width Window Target

I 405

Gets or sets tbe object tbat contains data about the control. Gets or sets the teA't displayed by the Linkl .abel.(Overrides Label.Text.) Gets or sets the alignment of text in the label. Gets or sets the distance, in pixels, bet,;veen the top edge of the control and the top edge of its container's client area. Gets tl1e parent control that is not parented by another Windows Fonns control. Typically, this is tbe outennost Form that the control is contained u1. Gets or sets a value that detennines \Vhether to use the Graphics class (GDI+) or the TextRenderer class (GDI) to render text. Gets or sets a value indicating \Vhether the control interprets an ampersand character(&) in the control's Text prope1ty to be an access key prefix character. Gets or sets a value indicating whether to use the \.Va.it ctrrsor for tbe current control and all child controls. Gets or sets a value indicating ':vhether the control and all its child controls are displayed. Gets or sets the color used when displaying a link that that 11as been previously visited. Gets or sets the width of the control. Tins API supports the product infrastructure and is not inte11ded to be used directly from your code. This property is not relevant for this class.

LISTBOX

Actuaffieight ActualWidth AllowDrop AlternationCount

Anchorltem AreAnyTou.cbesCaJltured AreAnyTouchesCapturedWithin AreAnyToucbesDirectlyOver AreAnyTouchesOver Bacliground

Gets the rendered height of this element. Gets tl1e rendered \.Vidth of this ele1nent. Gets or sets a value indicating whether this element can be used as the target of a drag-and-drop operation. This is a dependency property. Gets or sets the ntunber of alternating ite1n containers in the ItemsControl, which enables alten1ating containers to have a unique appea1ance. Gets or sets the item that is initially selected \Vhen SelectionMode is Extended. Gets a value that indicates whether at least 011e touch is captured to this elen1ent. Gets a value that indicates whether at least one touch is captured to this elen1ent or to any child ele1nents in its visual ·tree. Gets a value that indicates whether at least one touch is pressed over this el emeut Gets a value that indicates whether at least one touch is pressed over this element or any child elements in its visual tree. Gets or sets a brush tl1at describes the background of a control.

406

I PowerShe ll Studio -

Bin dingGrou 1> Bitm atlEffect BitmapEffcctlnput

BorderBrush Bo rderThickness

CacheMode Clip ClipToBounds

Command Bindings

CootextMenu

Cursor

Data Context DefaultStyleKey

Depen dencyObjcctType Desired Size Dispatcher

DisplayMemberPath Effect Flo,vDirectioo

Focusable FocusVisualStvle • FontFamily FontSize

FontStretch

A Compre hensive Guide

Gets or sets the BindingGroup U1al is used for U1e element. Obsolete.Gets or sets a bitnlllp effect that applies directly to the rendered content for Utls ele1ne11t. Tlris is a dependency property . Obsolete. Gets or sets an input source for the bitmap effect that applies directly to the rendered content for tlris ele1nent. This is a dependency property. Gets or sets a bn1sb that describes tJ1e border background of a control. Gets or sets the border thickness of a control. Gets or sets a cached representation of the UIElement. Gets or sets the geo1net.ry used to define the outline of the contents of an element. This is a dependency property. Gets or sets a value indicating \¥hether to clip tl1e content of tllis element (or content coining from the child elements of this element) to fit into the size of the containing element. This is a dep endency property. Gets a collection of Command.Binding objects associated with this ele1nent. A Comrnand.Binding enables conunand handling for this element, and declares the linkage between a command, its events, and U1e handlers attached by t1Jis element. Gets or sets the context n1enu elen1ent U1at should appear whenever the context n1enu is requested Urrough user interface (U I) fron1 \Vithin Ulis element. Gets or sets the cursor that displays when the mouse pointer is over this element. Gets or sets the data context for an element ' vhen it participates in data binding. Gets or sets the key to use to reference the style for this control. 'vhen theme styles are used or defined. Gets the DependencyObjectType that \vraps the CLR type of Utis instance. (Inherited fromDependencyObject.) Gets tl1e size that this element computed dtuing the measrne pass of the layout process. Gets the Dispatcher this DispatcherObject is associated with. (Inherited fro tn Dispatcl1erObject.) Gets or sets a path to a valt1e on the source object to serve as the visual representation of the object. Gets or sets the bitmap effect to apply to the UIElement. This is a dependency property. Gets or sets the direction that text and other user interface (UI) elements flow \vithin any parent element that controls their layout Gets or sets a value that indicates wbetJ1er the eleinent can receive focus. This is a depe11dency property. Gets or sets a property that enables customization of appearance, effects. or otl1er sty le characteristics U1at \.Vill apply to this ele1nent when it captures keyboard focus. Gets or sets U1e font fan1jly of tJ1e control. Gets or sets the font size. Gets or sets the degree to \vhicb a font is condensed or expanded on the screen.

PowerShell Studio - Reference Guide

FontStvle • FontWeigbt ForceCursor

Foreground Gron pSt~1 le G rou 1>StyleSelector HaocllesScrolling HasAoimatedPrope11ies HasEffectiveKeyboardFocus • Hasltems Height HorizontaWignmeot

HorizontaJContentAlignmeot InberitanceBeha,rior InputBindin gs InputScope IsArrangeValid l sEnabled IsEnabledCore IsFocused IsGrouping IsHitTestVisiblc

Islnitialized

IsinputMetbodEnabled

IsKe:vboardFocu sed • IsKeyboardFocu sWithin IsLoaded

I 407

Gets or sets the font style. Gets or sets the weight or thickness of the specified font. Gets or sets a value that indicates \Vhether this Frame,vork.Element should force tl1e user interface (UI) to render the cursor as declared by the Cursor property . Gets or sets a bn1sh that describes the foreground color. Gets a collection of GroupStyle objects that define the appearance of each level of groups. Gets or sets a method that enables you to provide custom selection logic for a GroupStyle to apply to each group in a collection. Gets a value that indicates \Yhether the ListBox supports scrolling.(Ovetrides Contro l.HandlesScrolling.) Gets a value indicating \:Vhetber this elernent has any anilnated properties. Gets a value that indicates 'vbether the UIElement ltas focus. Gets a value that indicates \Vhether the Iten1sControl contains iterns. Gets or sets the suggested heig11t of the element. Gets or sets the ho1izontal alignment characteristics applied to this elen1ent when it is composed \vitbin a parent element, such as a panel or items control. Gets or sets the horizontal alignment of the control's content. Gets or sets the scope limits for property value inheritance. resotuce key lookup. and ReJativeSource Find.Ancestor lookup. Gets the collection of input biJ1clings associated vv·iith this ele1nent. Gets or sets the context for mput used by this Frame\vorkElement. Gets a value indicating \vheU1er the computed size and position of child elements in this elen1ent's layout are valid. Gets or sets a value indicating 'vheU1er this elen1e11t is enabJed in the user interface (UI). This is a dependency property. Gets a value that becornes the return value of IsEnabled il1 derived classes. Gets a Yalue that determines '""hether this element has logical focus. This is a dependency property. Gets a value that indicates whether the control is using grouping. Gets or sets a value th.at declares \VbeU1er this eleme11t can possibly be rettimed as a hit test result from some portion of its rer1dered content. This is a dependency property. Gets a value that indicates \Vhether this element has been ffiitialized, either durmg processing by a XAML processor. or by explicitly having its Endlnit meU1od called. Gets a value indicating \vhether an input n1etbod systern. sucl1 as an Input Method Editor (IME), is enabled for processing the input to this element. Gets a value indicating whether this element has keyboard focus. This is a dependency property. Gets a value indicating \vhether keyboard focus is an)'\vhere witllffi the elen1ent or its visual tree child ele1nents. Th.is is a dependency property . Gets a value tl1at indicates \vhetber this ele1nent has been loaded for presentation.

408

I PowerShell Studio -

A Comprehensive Guide

IsMani pu lationEn ab led IsMeasureValid I sMou seCaJltured lsMouseCa1>tu reWithin

IsMou seDirectlyOver •

lsMouseOVer

lsSealed lsStylusCaptured IsStylusCa1>tureWithin

IsS tylu sDirectlyOver

IsStvlusOver •

IsSynchronizedWithCurren.titem

IsTabStop IsTextSearchCaseSensitive IsTextSearcbEnabled lsVisible ltemBiudingGroup ltemContainerGenerator ItemContaine1·S tvle •

Item ContainerStyleSelector Items ltcmsPancl

Gets or sets a value that indicates \Vhether m.anipulation events are enabled on this U1Ele1nent. Gets a value indicating \VheU1er the current size returned by Layout measure is valid. Gets a value indicating \Vhetber the n1ouse is capt1ued to tllis ele1nent. This is a dependency property . Gets a value that deternlines \vhether n1ouse capture is held by this element or by child elements in its visual tree. This is a dependency property. Gets a value that indicates \vl1ether the position of the mouse pointer corresponds to hit test results. \\·hich take elernent con1positing into account. This is a dependency property. Gets a value indicating \Vhether the mouse pointer is located over this element (including child elements in U1e visual tree). Tb.is is a dependency property. Gets a value that indicates whether this instance is currently sealed (read-only).(Inherited fro1n DependencyObject.) Gets a value indicating ,vhether the stylus is captured by this eleme11t. This is a dependency property. Gets a value that determines whether stylus capture is held by this ele·rnent. or an element \Vithin the elen1ent bounds and ·its visual tree. This is a dependency property. Gets a value that indicates \Vhether the stylus position corresponds to hit test results, which take element compositing i11to account. This is a dependency property. Gets a value indicating whether the stylus cursor is located over this element (including visual child ele1nents). TJlis is a dependency property. Gets or sets a value that indicates 'vhether a Selector should keep the Selectedltem synchronized 'vith the current ite111 in the Iten1s property . (Inherited fro1n Selector.) Gets or sets a value tbat indicates \Vhether a control is included in tab navigation. Gets or sets a value that indicates \VhetJ1er case is a condition \Vhen searclling for items. Gets or sets a value that indicates ' vhether TextSearch is enabled on tbe ItemsControl instance. Gets a value indicating \Vhetber this element is visible in the user interface (UI). This is a dependency property. Gets or sets the BindingGroup that is copied to eacl1 item in the ItemsControl. Gets the ItemContainerGenerator that is associated \vith the control. Gets or sets the Style that is applied to the container eletnenl generated for each item. Gels or sets custon1 style-selection logic for a style that can be applied to each generated container element. Gets the collection used to generate the content of the ItemsControl. Gets or sets the template that defines the panel that controls the layout of ite1ns.

PowerShell Studio - Reference Guide

ltemsSou rce ItemStringFormat Item Template ItemTcmplateSelector Language LayoutTransform • LogicaJChild ren Margin Max Height MaxWidth MinHeight MinWidth Name

01>acity OpacityMas k

OverridesDefaultStyle • Padding Parent PersistId RcndcrSize RenderTransforrn RenderTransformOrigin

Resources Selectedlndex Selectedltem Selectedltems SelectedValue SelcctedValuePatb

I 409

Gets or sets a collection used to generate the content of the ltemsControl. Gets or sets a con1posite string tl1at specifies ho\:v lo format the itenis in the ItemsControl if they are displayed as strings. Gets or sets the DataTe1nplate used to display each iten1. Gets or sets the custom logic for choosing a template used to di5play each item. Gets or sets localization/globalization language information that applies to an element. Gets or sets a graphics transfomiation that should apply to this elernent 1 ' ' hen layout is performed. Gets an enu111erator for tl1e logical child objects of the ItemsControl object. Gets or sets the outer 1nargin of an element. Gets or sets the maximum height constraint of the element. Gets or sets the maximw11 \\1idth constraint of the e len1ent. Gets or sets the rninimun1 height co11Straint of the elernent. Gets or sets the minirnum \Vidth constraint of the element. Gets or sets the identifying naine of the element. The name provides a reference so that code-behind. such as event handler code. can refer to a n1arkup ele1nent after it is constructed during processing by a XAML processor. Gets or sets the opacity factor applied to the entire UIEle1nent when it is rendered in the user interface (Ul). This is a dependency property. Gets or sets a11 opacity mask. as a Brush i1nple1nentation that is applied to any alpha-channel ulllsking for the rendered content of this element. This is a dependency property. Gets or sets a value that indicates \vhether this ele1nent incorporates sty le properties from theme styles. Gets or sets the padding inside a control. Gets tl1e logical parent eleme11t of this element. Obsolete.Gets a value U1at uniquely identifies Ulis ele1nent. Gets (or sets, but see Remarks) the final render size of this element Gets or sets transform infor1nation U1at affects the rendering position of this element. This is a dependency property. Gets or sets tl1e center point of any possible render transfonn declared by RenderTransfonn, relative to tl1e bounds of tb.e element. This is a dependency property. Gets or sets the locally-defined resource dictionary. Gets or sets the index of the first item in the current selection or reti1ms negative one (-1) if the selection is e1npty. (Inherited fron1 Selector.) Gets or sets tl1e first item in the current selection or reh1ms null if the selection is en1pty (Inherited from Selector.) Gets the currently selected items. Gets or sets the value of the Selectedltem, obtained by using SelectedValuePath. (Inherited from Selector.) Gets or sets the path that is used to get the SelectedValue fro1u the Selecteditem. (Inherited fro1n Selector.)

410

I PowerShe ll St udio -A Comprehe nsive Guide

SelcctionModc Snaps ToDe,ricePixels

Style StylusPlu gins Tablndex

Tag Template

TemplatedParent ToolTip TouchesCaptw·ed TouchesCaptu redWithin Tou cbesD irectlyOver ToucbesOver

Triggers Uid UseLayoutRounding VerticalAlignment

VerticalContcntAlignment Visibilitv• VisualBitma11Effcct VisualBitmapEffectlnput

VisualBitma_pScalingMode VisualCacheMode VisuaJCbildrenCount VisualClearTy1leHint VisualCli1J VisualEdgeMode VisualEffect VisualOtiset Visual Opacity VisuaJOpacityMask

Gets or sets the selection behavior for a ListBox. Gets or sets a value that detem1ines \vhether rendering for this element should use device-specific pixel settings during rendering. This is a dependency property. Gets or sets the sty le used by this elen1ent \\ hen it is rendered. Gets a collection of all stylus plug-in (custo1nization) objects associated \¥ith this ele1nent. Gets or sets a alue that determines the order in which elements recei e focus \Vhen the user navigates throug11 controls by using the TAB key. Gets or sets an arbitrary objectvalue that can be used to store custom infomiation about Ulis element. Gets or sets a control template. Gets a reference to the template parent of this element. This property is not relevant if the element was not created through a template. Gets or sets tbe tool-tip object that is displayed for this elerne11t in the user interface (Ul). Gets all touch de,rices that are capttued to this element. Gets all touch devices that are capt1ued to this elen1ent or any ch.ild elements in its ,-isual tree. Gets all touch devices that are over this element. Gets all touch devices that are over this elen1ent or any child elements in its visual tree. Gets the collection of triggers established directly on this element, or in child elen1ents. Gets or sets the unique identifier (for localization) for this ele1nent. This is a dependency property . Gets or sets a va1ue that indicates ,vJ1ether layout rounding should be applied to this element's size and position dtuing layout Gets or sets the vertical alignment characteristics applied to this element \Vhen it is cornposed \\·ithin a parent ele1ne11t such as a panel or ite1ns control. Gets or sets the vertical aligim1ent of the control's content. Gets or sets the user interface (Ul) visibility of this elen1ent. This is a dependency property. Obsolete. Gets or sets the BitmapEffect value for the Visual. Obsolete.Gets or sets the Biln1apEffectlnput value for the Visual. Gets or sets the BitmapScalingMode for U1e Visual. Gets or sets a cached representation of the Visual. Gets the nun1ber of visual child ele1nents \vi thin tlris ele1ne11t. Gets or sets the CJearTypeHint that deternunes how ClearType is rendered in U1e Visual. Gets or sets tl1e clip region of the Visual as a Geometry value. Gets or sets the edge tnode of the Visual as an EdgeMode Yalue. Gets or sets the bitmap effect to apply to tl1e Visual. Gets or sets the offset value of the visual object. Gets or sets the opacity of the Visual. Gets or sets the Bn1sh value that represents the opacity mask of the Visual. 1

PowerShell Studio - Reference Guide

VisnaIParent VisnaJScrollableAreaClip VisuaJTextHi_otingMode VisuaJTextRenderingMode VisualTransform VisualXSnappiogGuidelines VisuaJYSnappingGuidelines Width

I 411

Gets the visual tree parent of the visual object. Gets or sets a clipped scrollable area for the Visual. Gets or sets the TextHintingMode of the Visual. Gets or sets the TextRende1iugMode of the Visual Gets or sets the Transform value for the Visual. Gets or sets tl1e x-coordinate (vertical) guideline collection. Gets or sets tl1e y-coordinate (horizontal) guideline collection. Gets or sets the vvidth of the element.

LISTVIEW

Actnaffieight ActualWidth AllowDrop AlteroationCouot Anchorltem AreAnyTouchesCaptu red AreAnyTouchesCapturedWithio AreAnyTouchesDirectlyOver AreAnyTouchesOver Background BindingGroup BitmapEffect Bitm apEffectln put

BorderBrush BorderTbickness CacbeMode Cli1> ClipToBounds

Gets the rendered height of this element. Gets the rendered vvidth of this ele1nent. Gets or sets a value indicating whetl1er this element can be used as the target of a drag-and-drop operation. This is a dependency property. Gets or sets tl1e nu1nber of alternating ite1n containers in the ItemsControl, '~1 hich enables alternating containers to have a unique appearance. Gets or sets the ite1n that is initially selected "vhen SelectionMode is Extended. Gets a value that indicates whether at least one touch is captured to this elen1ent. Gets a value that indicates whether at least one touch is captured to this element or to any child elements in its visual tree. Gets a value tl1at indicates '1vhetber at least one touch is pressed over this eleme11t. Gets a value tliat indicates whether at least one touch is pressed over this eleme11t or any child elements in its visual tree. Gets or sets a bn1sh tl1at describes the background of a control. Gets or sets the BindingGroup that is used for tl1e elen1ent. Obsolete. Gets or sets a bitmap effect that applies directly to the rendered content for this ele1nent. This is a dependency property. Obsolete. Gets or sets an input source for tl1e bitmap effect that applies directly to the rendered content for this ele1nent. This is a dependency property. Gets or sets a brush tl1at describes the border background of a control. Gets or sets the border thickness of a control. Gets or sets a cached representation of the UIElement. Gets or sets the geo1netry used to define the outli11e of the contents of an ele1nent. This is a dependency property. Gets or sets a value indicating whether to clip the content of this ele1nent (or conte11t coming from the child elen1ents of this element) to

412

I PowerShell Studio -

A Comprehensive Guide

FontFamily

fit into the size of the containing element. This is a dependency property. Gets a collection of CommandBinding objects associated with this element. A Co1runandBinding enables command baudling for this element, and declares the Ji nkage between a command, its events, and the handlers attached by this element. Gets or sets the contex.1 menu element that should appear whenever the context menu is requested through user interface (UI) from within this ele1nent. Gets or sets the cursor that displays "vhen the mouse poi11ter is over this element. Gets or sets the data context for an ele1nent when it paiticipates in data binding. Gets or sets the key to use to reference the style for this co11trol, \vhen theme styles are used or defined. Gets tl1e DependencyObjectType that \¥Taps the CLR type of tltis instance. (Inherited from Depe11dencyObject.) Gets the size that this ele1nent computed during the measure pass of the layout process. Gets tl1e Dispatcher this DispatcherObject is associated with. (Inherited fro1n DispatcherObject.) Gets or sets a path to a value on the source object to serve as the visual representation of tl1e object. Gets or sets the bitmap effect to apply to the UIElement. This is a dependency property. Gets or sets the direction that tex.1 and other user interface (UI) elernents flo,;v ,;vitltin any parent element that controls their layout. Gets or sets a value tliat indicates whether the ele1nent can receive focus. This is a dependency property. Gets or sets a property that enables customization of appearance, effects, or other style characteristics tliat will apply to this element when it captures keyboard focus. Gets or sets the font family of the control.

FontSize

Gets or sets the font size.

FontStretch FontStyle

Gets or sets the degree to which a font is condensed or ex.'Panded on tl1e screen. Gets or sets the font sty le.

FontWeight

Gets or sets the weight or thickness of the specified font.

ForceCurso r

Gets or sets a value that indicates vvhether this Fra111e\vorkElement should force the user interface (UI) to render the cursor as declared by tl1e Cursor property. Gets or sets a b1usb tliat describes the foregrotmd color.

CommandBindings

ContextMenu

Cursor DataContext Defau ltStyleKey DependencyObjectType DesiredSize Dispatcher Dis11layMem berPatb Effect Flo'vDirection Focusable FocusVi.sualStyle

Foreground GroupStyJe GroupStyleSelector Han dlesScrollin g

Gets a collection of GroupStyle objects that define the appearance of each level of groups.(Inhe1ited from ItemsControl.) Gets or sets a metl1od tliat enables you to provide custom selection logic for a GroupStyle to apply to each group in a collection. Gets a value that indicates whether the ListBox supports scrolling.

PowerShell Studio - Reference Guide

I 413

HasEffectiveKeyboardFocus •

Gels a va lue indicating \¥hether this elen1ent has any ani111ated properties. Gets a value that indicates v.rhether the UIEle1nent has focus.

Hasltems

Gets a value U13t inrucates \¥hether the Iten1sControl contains items.

Height

Gets or sets the suggested height of the element.

HorizontalAlignment

Gets or sets the horizontal aligrunent characteristics applied to this element \Vhen it is co1nposed within a parent elen1ent, such as a paneJ or iten1s control. Gets or sets the ho1izontal alignment of the control's content.

HasAnim atedProperties

HorizontalContentAlignment

InputBindings

Gets or sets the scope lin1its for property value inheritance. reso1uce key lookllp, and RelativeS01rrce Find.Ancestor lookup. Gets the collection of input bindings associated \Vitb this element.

InputScope

Gets or sets the context for input used by tills Frame\vorkElen1ent.

IsArrangeValid

Gets a value indicating 'vhether the computed size and position of cllild elements in this ele1nenrs layout are valid. Gets or sets a. value indicating whether this element is enabled in the user iuterface (UI). This is a dependency property. Gets a valu.e that becomes the return value of IsEnabled in derived classes. Gets a value that detemlines \Vhether this elen1ent has logical focus. This is a dependency property. Gets a value that indicates whether the control is using grouping.

InberitanceBehavior

IsEnabled lsEnabledCore IsFocused lsGrou1Jing IsHitTestVisible

Isloitialized

Isl o pu tMethodEnabled

l sKeyboa rdFocu sed lsKe:yboardFocu sWithin •

I sLoaded IsManipulationEnabled IsMeasureValid IsMouscCa11tured IsMouseCaptureWithin

Gets or sets a vaJue that declares \Vhether this elen1ent can possibly be returned as a hit test result from so rne portion of its rendered content. This is a dependency property. Gets a value that indicates \vhether this elen1ent has been initialized, either during processing by a XAML processor, or by explicitly 113ving its End.In.it method called. Gets a value indicating whether an input n1ethod syste111, such as an Input Method Editor (IME), is enabled for processing the input to this elen1ent. Gets a value indicating \Vhether this elen1ent 113s keyboard focus. This is a dependency property. Gets a value i11dicating whether keyboard focus is auywhere within the element or its visual tree child elen1ents. This is a depe11dency property. Gets a value that indicates whether this element has been loaded for presentation. Gets or sets a value that indicates whether manipulation events are enabled on this UIElement. Gets a value indicating whether the curre11t size retun1ed by layout measure is valid. Gets a value indicating whether the mouse is capttued to this element. This is a dependency property. Gets a value that detennines whetl1er mouse capttue is held by this element or by child elements in its visual tree. This is a dependency pioperty.

414

I PowerShell Studio -

A Comprehensive Guide

IsMouseDirectlyOver

IsMouseOver

IsScaled IsStylusCaptured IsStyJusCaptureWithin

IsStylusDirectlyOver

IsStylusOver

IsSynchronizedWithCurrentltem

IsTabStop lsTextSearchCaseSensitive IsTextSearchEnabled IsVisible ltemBindingGroup ItemContainerGenerator ItemContainerStyle ItemContainerStyleSelecto1· Items ItemsPanel ItemsSource ltemStringFonnat

Item Template

Gets a value that indicates whether the position of the mouse pointer corresponds to hit test results, whicl1 take element compositing into account. This i s a dependency property. Gets a value indicating whether the mouse poit1ter is located over tllis element (including child elements in the visual tree). This is a dependency property. Gets a value that indicates whether this instance is currently sealed (read-only).(Inherited fron1 DependencyObject.) Gets a value indicating whether the stylus is cap1:u red by this eleme11t. This is a dependency property. Gets a value that detennines whether stylus capture is held by this ele1nent, or an element vvithin the element botu1ds and its visual tree. This is a dependency property. Gets a value that indicates whether tl1e stylus position corresponds to llit test results, which take element compositing il1to account. This is a dependency property. Gets a value indicating whether the stylus cursor is located over tllis ele111ent (including visual child ele1nents). TJlis is a dependency property. Gets or sets a value that indicates whether a Selector should keep tl1e Selectedltem synchronized with the current item in the Items property. (Inherited fron1 Selector.) Gets or sets a value that indicates vvhether a control is included in tab navigation. Gets or sets a value that indicates vvhether case is a co11dition "\tvben searclling for items.(Inberited from ItemsControl.) Gets or sets a value that il1dicates vvhether TextSearcl1 is enabled on the ItemsControl instance. Gets a value indicati11g whether this element is visible in the user interface (UT). This is a dependency property. Gets or sets the BindingGroup that is copied to each item in the ItemsControl. (Inherited from Iten1sControl.) Gets the ItemContainerGenerator that is associated with the control. Gets or sets the Style that is applied to the container element generated for each ite1n. Gets or sets ClIStom style-selection logic for a sty le that can be applied to each generated co11tainer elen1ent. Gets the collection used to generate the content of the Iten1sControl.(lnherited fro1n Ite1nsControl.) Gets or sets the template that defines the panel that controls the layout of iten1s. Gets or sets a collection used to generate the content of the ItemsControl. Gets or sets a composite string that specifies ho'v to format the items in the lte1nsControl if they are displayed as stJ.ings.(111.herited from ItemsControl.) Gets or sets the DataTemplate used to display each item .

PowerShell Studio- Reference Guide.

ItemTemplateSelecto r Language LayoutTransform LogicalChildren Margin MaxHeight MaxWidth MinHeight

I 415

• Gets or sets the custom logic for choosing a template used to display each item. Gets or sets localization/globalization lai1guage infon11ation that applies to all eleme11t. Gets or sets a graphics trailSfonnation that should apply to this element when layot1t is performed. Gets an enumerator fo r tl1e logical child objects of tJ1e lten1sControl object.(Inherited fro111 ltemsControl.) Gets or sets the outer margin of all element. Gets or sets tl1e maximmn height constraint of the ele1nent. Gets or sets t11e maximum width constraint of the element. Gets or sets the 111ini1numheight constraint of the ele1nent.

MinWidth

Gets or sets the minimiun width constraint of the ele1nent.

Name

Gets or sets t11e identifyil1g nan1e of the element. The name provides a reference so that code-behind, such as event handler code, can refer to a inarkup element after it is constn1cted during processing by a XAJ\.1L processor. Gets or sets the opacity factor applied to the entire UIElement \Vhen it is rendered in the user interface (UI). This is a dependency property. Gets or sets an opacity mask. as a Brush iniplen1entation that is applied to any alpha-cham1el n1asking for the rendered content of this ele1nent. Tltis is a dependency property. Gets or sets a value that il1dicates whether this element incorporates style properties fro1n theme sty les. Gets or sets the padding inside a control.

Opacity OpacityMasi
tured TouchesCa1>turedWithin ToucbesDirectlyOver TouchesOver Triggers U.id U seLayoutRounding VerticaW.ignment

VerticalContentAlignment Vielv Visibility VisualBitmapEffect VisualBitmapEffectln put VisualBitmapScaJingMode V.isuaJCacheMode V.isu a1Children Count V.isuaJClearTypeHint VisualClip VisualEdgeMode

Gets a collection of all stylus plug-in (customization) objects associated with this ele1ne11t. Gets or sets a value that determines tl1e order in which elements receive focus when the user navigates through controls by using the TAB key. Gets or sets an arbitrary object value that can be used to store custom information about this element. Gets or sets a control template. Gets a reference to the template parent of this element. This property is not relevant if the element \.vas not created through a template. Gets or sets the tool-tip object that is displayed for this element in the user interface (UI). Gets all touch devices that are captured to this ele1nent. Gets all touch devices that are captured to this element or any child eletnents in its visual tree. Gets all touch devices that are over this element. Gets all touch devices that are over this element or any child elements in its visual tree. Gets the collection of triggers established directly on this element, or in child elements. Gets or sets the unique identifier (for localization) for this eletnent. This is a dependency property. Gets or sets a value that indicates "vhether layout roundi11g should be applied to this ele1nent's size and position during layout. Gets or sets the vertical alignment characteristics applied to tllis ele1nent when it is composed \.vithin a parent element sucl1 as a panel or iten1s control. Gets or sets the vertical aligrunent of the control's co11tent. Gets or sets a11 object that defi11es ho,;v the data is styled and organized in a ListVievv control. Gets or sets the user interface (UI) visibility of tllis ele1nent. This is a dependency property. Obsolete.Gets or sets the BitmapEffect value for t11e Visual. Obsolete. Gets or sets the BitmapEffectlnput value for the Vis11al. Gets or sets the Bit111apScalingMode for tl1e Visual. Gets or sets a cached representation of the Visual. Gets the nwnber of visual child elements within this ele1uent. Gets or sets the ClearTypeHint that detennines how ClearType is rendered in the Visual. Gets or sets the clip region of the Visual as a Geo1netry value. Gets or sets the edge mode of the Visual as an EdgeMode value.

Pow erShe ll Studio - Referen ce Guide

Visu alEffect

•Gets or sets the bitmap effect to apply to the Visual.

VisualOffsct

Gets or sets the offset value of the visual object.

VisualOpacity

Gets or sets the opacity of the Visual.

VisualOpacityMask VisualParcnt

Gets or sets the Bn1sh value that represents the opacity mask of the Visual. Gets the vist1al tree parent of the visual object.

VisnaJScrollablcAreaClip

Gets or sets a clipped scrollable area for the Visual.

VisualTextBintingMode

Gets or sets tl1e TextHintingMode of the Visual.

VisualTcxtRenderingMode

Gets or sets the TeAiRenderingMode of the Visual.

VisualTransfonn

Gets or sets the Transform value for the Visual.

VisuaJXSnappingGuidelines

Gets or sets the x-coordinate (vertical) guideline collection.

VisualYSnappingGuidelines

Gets or sets they-coordinate (horizontal) gt1ideline collection.

Width

Gets or sets the width of the element.

I 417

MASKEDTEXTBOX

Accepts Tab

AccessibilityObject Accessib.leDefaultActionDescription Accessi bleDescri11tiou AccessibleName AccessibleRole AllowDro1> AllowPromptAslnput Anchor AsciiOnly AutoScrollOffset AntoSize BackColor

Gets or sets a value deten1lining ho'iV TAB keys are handled for inultiline coufigurations. This property is not supported by MaskedTextBox. Gets the AccessibleObject assigned to the control. Gets or sets the default action description of tl1e control for use by accessibility client applications. Gets or sets the description of the control used by accessibility client applications. Gets or sets the name of the control u sed by accessibility client applications. Gets or sets the accessible role of the contTol Gets or sets a value indicating whether the control can accept data that the user drags onto it. Gets or sets a value indicating whether Pro1nptCbar can be entered as valid data by the user. Gets or sets the edges of the container to which a control is bound and detemlines how a control is resized with its parent. Gets or sets a value indicating ,;vhether the MaskedTeA1Box control accepts characters outside of the ASCII character set. Gets or sets where this control is scrolled to in Scroll ControllntoView. Gets or sets a value indicating whether the height of the control automatically aqjusts when the font assigned to tl1e control is changed. Gets or sets the background color of tl1e contr:ol.

418

I PowerShell Studio -

A Comprehensive Guide

BindingContext

This API supports the product infrastructure and is not intended to be used directly frotn your code. Tb.is property is not relevant for this class. This API supports the product infrastructure and is not intended to be used directly from your code. Tb.is property is not relevant for this class. Gets or sets a value indicating wl1ether the masked teA1 box control raises tl1e system beep for eacl1 user key stroke that it rejects. Gets or sets the BindingConteA1 for the control.

BorderStyle •

Gets or sets tl1e border type of the text box control.

Bottom

CanFocus

Gets tl1e distance, in pixels, between the bottom edge of the control and the top edge of its container's client area. Gets or sets the size and location of the control including its nonclient elements, in pixels, relative to the parent control. Gets a value indicating \vhether the ImeMode property can be set to an active value, to enable Ilv1E support. Gets a value indicating \vl1ether tlle control can receive focus.

CanRaiseEvents

Determines if events can be raised on the control.

Can Select

Gets a value indicating whether the control can be selected.

CanUndo

ClientRectan gle

Gets a value it1dicating \Vhether tl1e user can undo the previous operation. This property is not supported by MaskedTexffiox. Gets or sets a value indicating \vhether the control has captured tl1e IDOllSe. Gets or sets a value indicating \¥hetber the control causes validation to be perfo1med on any controls that require validatio11 when it receives focus. Gets the rectangle that represents tlle client area of the control.

ClientSize

Gets or sets the height and width of tbe client area of the control.

CompanyName

CootextMenu

Gets tbe name of the co1npany or creator of the application containing the control. Gets the !Container that contains the Component. Gets a value indicating whether the control, or one of its child controls, clrrrently has the input focus. Gets or sets U1e sho1tcut menu associated with the control.

ContextMeouStrip

Gets or sets the ContextMenuSttip associated \Vitl1 this control.

Controls

Gets the collection of controls contained within tl1e control.

Created

Gets a value indicating whether tlle control has been created.

CreateParams

Gets the required creation paraineters when the control hand1e is created. (Overrides TextBoxBase. CreateParams.) Gets or sets the culture information associated \Vitb the 1nasked teA1 box. Gets or sets the cursor that is displayed \Vl1en tl1e inouse pointer is over the co11trol.

Backgroundlm age

BackgroundlmageLayout

BeepOnError

Bounds CanEnablelme

Ca1>ture CausesValidation

Container ContainsFocus

Culture Cursor

PowerShell Studio - Referen ce Guide.

I 419

DataBindings

Gets or sets a value that detenni11es \.Vhether literals and prompt characters are copied to the clipboard. Gets the data binclings for the control

DefaultCursor

Gets or sets the default ctusor for the control.

DefaultlmeMode

DefaultPadding

Gets tl1e default Input Method Editor (IME) mode supported by t11e control. Gets tl1e space, in pixels, that is specified by default between controls. Gets the length and height, in pixels, that is specified as the default maximun1 size of a control. Gets the length and height, in pixels, that is specified as the default minimum size of a control. Gets tl1e internal spacing, in pLxels, of the contents of a control.

DefaultSize

Gets the default size of the control.

DesignMode

Gets a value that indicates wl1ether the Component is Cl1rrently in design mode. Gets tl1e rectangle that represents the display area of the control.

CutCopyMask:Format

DefaultMargin Defau ltMa:l.imumSize DefaultMinimumSize

DisplayRectangle

Events

Gets a value indicating whether the base Control class is in the process of disposing. Gets or sets whicl1 control borders are docked to its parent control and detennines ho\;y a control is resized \.Vith its parent. This API supports the product infrastructure and is not intended to be used directly from your code. Gets or sets a value indicating \.Vhether control drawing is done in a buffer before the contiol is displayed. This property is not relevant for this class. Gets or sets a value i11dicating whether the control can respond to user interaction. Gets tl1e list of event liandlers tliat are attached. to this Component.

Focused

Gets a value i11dicating whether the control has input focus.

Font

Gets or sets the font of the text displayed by tl1e control.

FontHeight

Gets or sets the height of the font of the control.

ForeColor

Gets or sets the foreground color of the control.

FormatProvider

Gets or sets the IFonnatProvider to use when perfon11ing type validation. Gets the windovv handle that the control is bound to.

Disposing Dock Dou bleBuffered

Enabled

Handle Has Children Height

Gets a value indicating whether tl1e control contains one or more child controls. Gets or sets the height of the control.

ImeMode

Gets or sets a value indicating whether the pro1npt characters in the input mask are hidden when the masked te:x.'t box loses focus. Gets or sets a value indicating whether the selected teA1 in tl1e text box control remains highlighted when tl1e control loses focus. Gets or sets the Input Method Editor (Thffi) mode of the control.

ImeModeBase

Gets or sets the Input Method Editor (IME) mode of a control.

HidePromptOnLeave HideSelection

420

I PowerShell Studio -

Inse11KeyMode InvokeRequired

lsAccessible IsDisposed IsHanclleCreated IsMirrored lsOve1°\vriteMode LayoutEngine

A Comprehensive Guide

Gets or sets the text insertion inode of the masked text box control. Gets a value indicating whether the caller must call an invoke method when making method calls to the control because the caller is on a different tlu:ead than the one the control was created on. Gets or sets a value indicating wl1ether the control is visible to accessibility applications. Gets a value indicating whether the control has been disposed of. Gets a value indicating whether the control l1as a 11andle associated with it. Gets a value indicating whether the control is mirrored. Gets a value that specifies whether new user input overwrites existing input. Gets a cacl1ed instance of the control's layout engine.

Margin

Gets or sets the distance, in pixels. betwee11 the left edge of the control and the left edge of its container's client area. Gets or sets the lines of text in multi line configurations. This property is not supported by MaskedTeA.1Box. Gets or sets tl1e coordinates of the upper-left comer of the control relative to the upper-left con1er of its container. Gets or sets the space between controls.

Mask

Gets or sets tl1e input mask to use at nm ti1ne.

MaskCompleted

Gets a value indicatil1g whetl1er all required inputs have been entered into the input mask. Gets a clone of the inask provider associated \.Vith this instance of tl1e masked text box control. Gets a value indicating whether all required and optional inputs have been entered into the input mask. Gets or sets the size that is the upper limit that GetPreferredSize can specify. Gets or sets t11e 1naxin1um number of characters the user can type or paste into tl1e teA.1 box control. This property is not supported by .MaskedTeA.t Box. (Overrides TextBoxBase.MaxLength.) Gets or sets the size that is the lower linrit that GetPreferredSize can specify. Gets or sets a value that indicates tliat the teA.'t box control has been modified by the user si11ce tl1e control was created or its co11tents were last set. Gets or sets a value indicating wl1ether this is a mttltiline teJ\1 box control. This property is not frilly supported by MaskedTextBox. (Overrides TeA1BoxBase.Multi line.) Gets or sets the naine of the control.

Left Lines Location

Masked TextProvider MaskFull MaximumSize MaxLength

Minimu mSize Modified

Multiline

Name Padding

Parent

Tlris APJ supports the product infrastructure and is not intended to be used directly from your code. This prope11y is not relevant for tllis class. Gets or sets the parent container of the control.

PowerShell Studio - Reference Guide.

PreferredHeight

I 421

Gets or sets the character to be displayed in substitute for user input. Gets the preferred height for a text box.

ProductName

Gets the size of a rectangular area into '1vhich the control can fit. Gets tl1e product na1ne of the assembly containing the control.

ProductVersion

Gets tl1e version of the assembly containing the control.

PromptChar

Gets or sets the character used to represent the absence of user input in MaskedTe>..1:Box. Gets or sets a value indicating whether teA.i in the text box is readonly . Gets a value indicating whether the control is currently re-creating its ha11dle. Gets or sets the \¥indow region associated with the control. Gets or sets a value indicating whether the parsing of user input should stop after the frrst il1valid character is reached. Obsolete.This property is now obsolete.

PreferrcdSizc

Read Only RecreatingHandlc Region Rcjectln putOnFirstFailure RenderRightToLeft ResetOnPrompt RcsetOnSpace ResizeRedraw Right RightToLeft ScaleChildren SelectedText Selection Length SelectionSta11 ShortcutsEnabled ShowFocusCues ShowKeyboard Cues Site

Size Ski11Literals Tab Index TabStop Tag

Gets or sets a value that determines how an input character that inatches the prompt character should be handled. Gets or sets a value that detennines how a space input character should be handled. Gets or sets a val11e indicating whether the control redra,;vs itself \¥hen resized. Gets the distance. in pixels, between the right edge of the control and the left edge of its container's client area. Gets or sets a value indicating '1vl1etber control's elements are aligned to support locales using right-to-left fonts . Gets a value tliat determines the scaliI1g of cllild controls. Gets or sets the current selection in tl1e MaskedTextBox control. (Overrides TextBoxBase. SelectedTeA't.) Gets or sets the nmnber of characters selected in the text box. Gets or sets the starting point of te~'t selected in the text box. Gets or sets a value indicating '1Vhether the defined shortcuts aTe enabled. Gets a value indicating whether tl1e control should display focus rectangles. Gets a value i11dicating whether the user i11terface is in.the appropriate state to sl1ow or hide keyboard accelerators. Gets or sets the site ofth.e control. Gets or sets the height and width of the control. Gets or sets a value indicating whether the user is allo\ved to reenter literal values. Gets or sets the tab order of the control within its container. Gets or sets a value indicating whether the user can give the focus to this control using the TAB key. Gets or sets the object that co11tains data about the control.

422

I PowerShell Studio -

A Comprehensive Guide

Text TextAlign TextLength TextMaskFormat Top TopLevelControl

UseSystemPasswordChar UseW aitCu rso r V aJidatingType Visible Width Winclo,vTarget

WorclWrap

Gets or sets the text as it is currently displayed to the user. (Overrides TeA.1:BoxBase.TeA.1:.) Gets or sets .how text is aligned in a masked text box control. Gets the length of the displayed text. (Overrides TextBoxBase.TextLengtl1.) Gets or sets a value that detem1ines whether literals and prompt characters are included in the fonnatted string. Gets or sets the distance, in pixels, between the top edge of the control and the top edge of its container's client area Gets the parent co11trol that is not parented by another Windows Fom1s control Typically, this is t11e outennost Fonn that the control is contained in. Gets or sets a value indicating wl1ether the operating systemsupplied. password character should be used. Gets or sets a value indicating \.Vhether to use the wait cursor for the current control and all clrild controls. Gets or sets the data type used to verify the data input by the user. Gets or sets a value indicating \.vhether the control and all its child controls are displayed. Gets or sets the 'vidth of tl1e control. This API supports tl1e product infrastn1cture and is 11ot intended to be used directly fro1n your code. Tllis property is not relevai1t for this class. Gets or sets a value indicating whether a multiline tex1 box control auto1natically wraps words to the beginning of the ne>..1 li11e when necessary. This property is not Sl1pported by MaskedTextBox.

MENUSTRIP

, AccessibilityObject AccessibleDefaultActionDescri1>tion AccessibleDescription AccessibleN ame Accessible~oJe

AllowDrOJ> AllowItemReorder

AllowMerge

Gets tl1e AccessibleObject assigned to the control. Gets or sets the default action description of the control for use by accessibility client applications. Gets or sets the description of the co.ntrol used by accessibility client applications. Gets or sets the name of the control used by accessibility client applications. Gets or sets the accessible role of the control Gets or sets a value i.ndicatin.g whether drag-and-drop and item reorde1ing are handled through events that you in1plen1ent. Gets or sets a value indicating whether drag-and-drop and item reordering are handled privately by the ToolStrip class. Gets or sets a value indicating \.Vhether multiple MenuStrip, ToolStripDropDownMenu, ToolStripMenuiten1, and other types can be combined.

PowerShell Studio - Reference Guide.

Anchor AutoScroll

AutoScrollMargi n

AutoScrollMinSize

AutoScrollOffset AutoScrollPosition

AutoSize BackColor

Backgroundlmage Backgrou odlmageLayout BindingCootext Bottom Bounds CanEnablelme CanFocus CaoOverflolv CanRaiseEveots CanSelect Capture CausesValidation

ClientRectan gle ClientSize CompanyName Container ContainsFocus

I 423

Gets or sets the edges of the container to which a ToolStrip is bound and determines how a ToolStrip is resized with its parent. This API supports the product i11frastn1cture and is not intended to be used directly from your code. This property is not relevant for this class. This API supports the product infrastructure and is not intended to be used directly from yo1u code. This property is not relevant for this class. Tltis API supports the product infrastructure and is 11ot intended to be used directly fron1 your code. This property is not relevant for tlus class. Gets or sets \¥here this control is scrolled to in ScrollControllntoView. This API supports the product infrastructure and is not intended to be used directly from your code. Tlris property is not relevant for tltis class. Gets or sets a value indicating whether the control is automatically resized to display its entire contents. This API supports the product infrastn1cture and is not intended to be used directly from your code. Gets or sets tl1e backgTotu1d color for the ToolStrip. Gets or sets the background i1nage displayed in the control. Gets or sets the background in1age layout as defined in the ImageLayout enun1eration. Gets or sets the binding context for the ToolStrip. Gets the distance, in pixels, between the bottom edge of the control and the top edge of its contaiI1er's client area. Gets or sets the size and location of the control including its nonclient ele1nents, in pixels, relative to the parent control. Gets a value indicating \V hether the ImeMode property can be set to an active value, to enable IME support. Gets a value indicating 'vhether the control can receive focus. Gets or sets a value indicating whether the MenltStrip supports overflovv functionality . Determines if events can be raised on the control. Gets a value indicating whether the control can be selected. Gets or sets a value i11dicating '1Vhetl1er the control bas captured the 1nouse. Gets or sets a value indicating whether the ToolStrip causes validation to be perfonned on any controls that require validation \vhen it receives focus. Gets the rectangle that represents the client area of the control. Gets or sets the height and width of the client area of the control. Gets the name of the company or creator of the application containing the control. Gets the !Container that contains the Component Gets a value indicating whetl1er the control, or one of its child controls~ currently bas tl1e input focus.

424

I PowerShell Studio -

ContextMenu ContextMenuStrip Controls

Created CreatcParams Cursor DataBindings DefaultCursor DefaultDock DefauJtDropDownDirection

DefaultGripMargin

DefaultlmeMode DefaultMargin DefaultMa:ximu mSize DefaultMinimumSize DefaultPadding

DefaultSholvltemToolTips

DefauJtSize

DesignMode Dis1llayedltcms

DisplayRectangle

Disposing

A Comprehensive Guide

Gets or sets the shortcut menu associated \Vith the control. Gets or sets the Co11textMenuStrip associated \Vith this control. This API supports the product infrastruct1ue and is not intended to be used directly from your code. This property is not relevant for this class. Gets a value indicating whether tl1e control has been created. Gets the required creation para1neters 'vhen the control handle is created. Gets or sets the cursor that is displayed when the mouse pointer is over tl1e ToolStrip. Gets the data bindings for the control. Gets or sets the defatdt cursor for the co11trol. Gets the docking location of the ToolStrip, indicating \vllich borders are docked to the container. Gets or sets a value represe11ting tl1e defatdt direction in which a Too1StripDropDo'1vn control is displayed relative to the ToolStrip. Gets the default spacing, in pL"Xels, bet\veen the sizn1g g1ip and the edges of the MenuStrip.(Overrides ToolStrip.DefaultGripMargin.) Gets the default Input Method Editor (IlvfE) mode supported by the control. Gets the spacing in pixels, bet\veen tl1e ToolStrip and the ToolStripContainer. Gets tl1e lengtl1 and height, in pixels, that is specified as the default maximtun size of a control. Gets the length ai1d height, in pixels, that is specified as the default minimu1n size of a control. Gets the spacing in pixels, benveen the left, right, top, and bottom edges of the Menus trip from the edges of the f otm. (Overrides ToolStrip.Defa1dtPadding.) Gets a value indicating \¥hether ToolTips are sho'1vn for the MenuStrip by default.(Overrides ToolStrip.DefaultShowltemToolTips.) Gets the 11orizontal and vertical din1ensions, in pixels, of the MenuStrip when it is first created.(Overrides ToolStrip.DefaultSize.) Gets a value that indicates whether the Co1nponent is cturently in design n1ode. Gets the subset of ite.ms that are currently displayed on the ToolStrip, including ite1ns that are automatically added into the ToolStrip. This API supports the product infrastructtue and is not intended to be used directly from your code. Retrieves the current display rectangle. Gets a value ind·icating \Vhether the base Control class is in the process of disposing.

PowerShell Studio - Reference Guide.

Dock

DockPadding DoubleBuffered

Enabled Events Focused Font FontHeight ForeColor GriJlDisplayStyle GripMargin GripRectangle Grit>Style Handle Has Children

Height HorizontaJScroll

HScroll ImageList ImageScalingSize ImeMode lmeModeBase InvokeRequired

IsAccessible lsCurrentlyDragging IsDisposed IsDropDown IsHandleCreated

I 425

Gets or sets which ToolStrip borders are docked to its parent control and determines 11ow a ToolS trip is resized with its parent. Gets the dock padding settings for all edges of tl1e control. Gets or sets a value .indicating \V hetl1er this control should redra\v its surface using a secondary buffer to red11ce or prevent flicker. Gets or sets a value indicating whether the control can respond to user interaction. Gets the list of event handlers that are attached to tllis Component. Gets a value indicating whetl1er the control has input focus. Gets or sets the font used to display text in t11e control. Gets or sets t11e height of the font of tl1e control. Gets or sets the foreground color of the ToolStrip. Gets the orientation of the ToolS trip move 11andle. Gets or sets the space around the ToolStiip 1nove ha11dle. Gets the botu1daries of the ToolStrip move haI1dle. Gets or sets the visibility of the grip used to reposition U1e control. Gets the windo"v handle tliat the control is bound to. This API supports the product infrastructure and is not intended to be used directly from your code. This property is not relevant for this class. Gets or sets the height of the control. Tlris API supports the product infrastntctme and is not intended to be used directly fron1 your code. This property is not relevant for tl1is class. Gets or sets a value indicating whether the horizontal scroll bar is visible. Gets or sets the image list tliat contains the image displayed on a Too lStrip ite1n. Gets or sets the size, in pixels, of an image used on a ToolStrip. Gets or sets the Input Method Editor (IME) rnode of the control. Gets or sets the IME mode of a control. Gets a value indicating \Vhether the caller must call an invoke method when n1aking 1netl1od calls to the control because tl1e caller is on a different thread than the 011e the control 'vas created ou Gets or sets a value i11dicating whether the control is visible to accessibility applications. Gets a value indicating whether the user is currently moving the ToolStrip from one ToolStripContainer to anotl1er. Gets a value indicating whetl1er the control has been disposed of. Gets a value indicating whether a ToolStrip is a ToolStripDropDown control. Gets a value indicating whether the control bas a handle associated \Vith it.

426

I PowerShell Studio -

IsMin·ored Items LayoutEngine LayoutSettings LayoutStyle Left Location Margin MaximumSize Maxltem.Size MdiWindowListltem MinimumSize Name Orientation OverflowButton Padding Parent PreferredSize ProductName ProductVersion RecreatingHandle Region Renderer RenderMode RenderRightToLeft ResizeRedraw Right RightToLeft ScaleChildren ShowFocusCues ShowltemToolTips

A Comprehensive Guide

Gets a value indicating vvhether the control is mirrored. Gets all the items that belong to a ToolStrip. Passes a reference to the cached LayoutEngine returned by the layout engine interlace. Gets or sets layout scheme characteristics. Gets or sets a value indicating hovv the ToolStrip lays out the items collection. Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its co11tainer's client area. Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left con1er of its container. Gets or sets the space betvveen controls. Gets or sets the size that is the upper liinit that GetPreferredSize can specify. Gets the 1llilXilnum height and 'vidtl1, in pixels, of tl1e ToolStiip. Gets or sets the ToolStripMenuitem that is used to display a list of Multiple-document inte1face (MDI) child forms. Gets or sets the size that is the lower limit that GetPreferredSize can specify. Gets or sets the name of the control. Gets the orie11tation of the ToolStripPanel. Gets the ToolStripltem that is the ove1flo"v button for a ToolStrip with overflo\v enabled. Gets or sets padding vvitlrin the control. Gets or sets the parent container of the control. Gets the size of a rectangttlar area into which the control can fit. Gets the product name of the asse1nbly containiI1g the control. Gets the version of tl1e assembly containing the control. Gets a value indicating whether the control is cturently recreating its handle. Gets or sets tl1e vvindow region associated with the control. Gets or sets a ToolStripRenderer used to custonlize the look and feel of a ToolStrip. Gets or sets a value that indicates 'vhich visual styles will be applied to the ToolStrip. Obsolete. This property is now obsolete. Gets or sets a value indicating whether the control redraws itself when resized. Gets the distance, in pixels, between the 1ight edge of the control and the left edge of its co11tainer's client area. Gets or sets a value indicating vvhether control's elen1ents are aligned to support locales using right-to-left fonts. Gets a value tl1at detennines the scaling of child controls. Gets a value indicating '¥ hether the control should display focus rectangles. Gets or sets a value indicating whetl1er ToolTips are shown for the MenuSt:Iip.

PowerShell Studio - Reference Guide

I 427

I

ShowKeyboardCues Site Size Stretch TabIndex TabStO}l Tag Text TextDirection Top To1>LevelControl

UseW aitCu rso r VerticalScroll

Visible VScroll Width Window Target

Gets a value indicating whetheT the 11ser interface is in the appropriate state to show or hide keyboard accelerators. Gets or sets the site of the control. Gets or sets the height and width of the control. Gets or sets a value indicating whether the MenuStrip stTetches fro1n end to end in its container. Gets or sets the tab order of the control ,;vithin its container. Gets or sets a value indicating whether the user can give the focus to an item in tl1e ToolStrip using the TAB key. Gets or sets the object that contains data about the control. Gets or sets the text associated with this control. Gets or sets the direction in which to dra'\\'· tex1 on a ToolStrip. Gets or sets the distance, in pixels, between the top edge of the control and the top edge of its container's client area. Gets the parent control that is not parented by another Windows Fonns co11trol. Typically. this is the outermost Fo1m that the control is contained in. Gets or sets a value indicating whether to use the wait cursor for the current control and all cllild controls. This API supports the product infrastni.cture and is not intended to be used directly from yo1u code. This property is not relevant for tltis class. Gets or sets a value indicating whether the control and all its child controls are displayed. Gets or sets a value indicating whether tl1e ve1tical scroll bar is visible. Gets or sets the \Vidth of the control. This API supports the product infrastructure and is not inte11ded to be used directly fron1 your code. This property is not relevant for tltis class.

MONTHCALENDAR

AccessibilityObject

Gets the AccessibleObject assigned to the control.

AccessibleDefaultActi.onDescription

Gets or sets the default action description of tl1e control for use by accessibility client applications. Gets or sets tl1e description of tl1e control used by accessibility client applicatio11s. Gets or sets the name of the control used by accessibility client applications. Gets or sets the accessible role of the contTol

AccessibJeDescription AccessibJeName AccessibleRole AllowDrop Anchor

Gets or sets a value indicating \vhether the control can accept data that the useT drags onto it. Gets or sets the edges of the container to which a control is bound and detennines how a control is resized with its parent.

428

I PowerShell Studio -

AnnuallyBoldedD ates AutoScrollOfl'set Auto Size

Baclture CausesVaJidation

ClientRectan gle ClientSize Com1>anyName

Container

Gets the name of the company or creator of the application containing tl1e control. Gets the !Container that contains the Component.

ContextMenu

Gets a value indicating whetl1er the contro~ or one of its child controls, Currently has tl1e input focus. Gets or sets the shortcut menu associated with the control

ContextMenuStrip

Gets or sets the ContextMenuStrip associated witl1 this control.

Controls

Gets the collection of controls contained within the control Gets a value indicating whether the control has been created.

ContainsFocus

Created

PowerShell Studio - Reference Guide

I 429

DataBinllings

Gets a System.Windows.Fonns.CreateParams for creating a MonthCalendar control. (Overrides Control. CreateParams.) Gets or sets the cursor that is displayed when the mouse pointer is over the control. Gets the data bindings for the control.

DefaultCnrsor

Gets or sets the default cursor for the control.

DefanltlmeMode

Gets a value indicati11g the input method editor for the MonthCalendar. (Overrides Control.Defaultin1eMode.) Gets the defa11lt margin settings for the Montl1Calendar control.(Overrides Control.DefaultMargin.) Gets the length and height, in pixels, that is specified as the default maximum size of a co11trol. Gets the length and height, in pixels, that is specified as the default minimu1n size of a control. Gets the internal spacing, in pixels, of the contents of a control.

CreateParams Cursor

Defau ltMargin DefaultMaximumSize Defau ltMinimumSize DefaultPad(fing DefaultSize DesignMode DisJJlayRectangle Dis1Josing Dock DoubleBuffered

Enabled Events

Gets the default size of the calendar. (Overrides Contro l.DefaultSize.) Gets a value that indicates whether tl1e Component is currently in design mode. Gets the rectangle that represents the display area of the control Gets a value indicating whether the base Control class is in the process of disposing. Gets or sets which control borders are docked to its parent control and determines bow a control is resized with its paient. Gets or sets a value indicating whether the control should redraw its surface using a secondary buffer.(Overrides ControLDoubleBuffered.) Gets or sets a value indicating whether the control can respond to user interaction. Gets the list of event handlers that are attached to this Component.

Focused

Gets or sets the first day of the week as displayed in tl1e month calendar. Gets a value indicating whether the control has input focus.

Font

Gets or sets the font of tl1e te>..1: displayed by the control.

FootHeight

Gets or sets the height of the font of the control

ForeColor

Gets or sets the foreground color of tl1e control.(Overrides ControLForeColor.) Gets the windo"v handle tl1at the control is bound to.

FirstDayOtweek

Handle HasCbildren Height ImeMode

ImeMocleBase

Gets a value indicating whether the control contains one or tnore child controls. Gets or sets the height of the control. This API supports the product infrastructure aitd is not i11tended to be used directly from yo1rr code. Gets or sets the Input Method Editor (Th.ffi) mode supported by this control. Gets or sets the Th.ffi rnode of a control.

430

I PowerShell Studio -

InvokeRequired

IsAccessibJe lsDisposed

A Comprehensive Guide

•Gets a value indicating whether the caller must call an invoke method when making method calls to the control because the caller is on a different tluead than the one the control ,vas created on. Gets or sets a v alue indicating whether tl1e control is visible to accessibility applicatio1is. Gets a value indicating whether the control has been disposed of.

IsMirrored

Gets a value indicating whether tl1e control has a handle associated with it. Gets a value indicating whether the control is mirrored.

LayoutEngine

Gets a cached instance of the control's layout engine.

Left

Margin

Gets or sets the distance, in pixels, between tl1e left edge of the control and the left edge of its container's client area. Gets or sets tl1e coordinates of the upper-left corner of the control relative to tl1e upper-left comer of its container. Gets or sets the space bet"\>veen controls.

MaxDate

Gets or sets the 1naximurn allowable date.

Maximu mSize

Gets or sets the size tllat is the upper limit that GetPreferredSize can specify . Gets or sets the inax.imum nu1nber of days tl1at can be selected in a montl1 calendar control. Gets or sets the minimum allo"vable date.

lsHandleCreated

Location

MaxSelection Coo nt Min Date MinimumSize

MonthlyBoJdedDates Name

Padding

Gets or sets the size that is the lower linlit that GetPreferredSize can specify. Gets or sets the array of DateTi1ne objects that detennine "vhich montltly days to bold. Gets or sets the name of ll1e control.

Parent

This API supports the product infrastruchrre and is not intended to be used directly from your code. Gets or sets the space between the edges of a MonthCalendar control and its contents. Gets or sets tl1e parent container of the control.

PreferredSize

Gets the size of a rectangular area into which tl1e coritrol can fit.

ProductN ame

Gets the product name of the assembly co11taining the control.

ProductVersion

Gets the version of the assembly contaiiling the control.

Recreatin gHandle Region

Gets a value indicating \.vhether the control is CUITently re-creating its handle. Gets or sets the window region associated with the control.

RenderRightToLeft

Obsolete.This property is now obsolete.

ResizeRedraw

Gets or sets a value indicating "\>vhether the control redraws itself when resized. Gets the distance, i11 pixels, beti¥een tl1e right edge of the control and tl1e left edge of its container's client area. Gets or sets a value indicating whether control's elements are aligned to support locales 11sing right-to-left fonts. Gets or sets a value indicating whether tl1e control is laid out fron1 right to left.

Right RightToLeft RigbtToLeftLayout

PowerShell Studio - Reference Guide.

I 431

[

ScaleChildren Scroll Change SelectionEnd SelectionRange SelectionStart ShowFocusCues SholvKeyboard Cu es

ShowTodayCircle ShowWeekNumbers SingleMontbSize Site

Size Tab Index TabStop Tag Text

TitleBacl\:COIO r TitleForeColor TodavDate • TodayDateSet Top To1>LevelControl

TrallingForeColor UseW aitCursor Visible

Width

Gets a value tbat detenni nes the scaling of child controls. Gets or sets the scroll rate for a month calendar control. Gets or sets the end date of the selected range of dates. Gets or sets the selected range of dates for a montl1 calendar control. Gets or sets the start date of tl1e selected range of dates. Gets a value indicating vvhether the control should display focus rectangles. Gets a value i11dicatiJ.1g wl1ether the user interface is in the appropriate state to show or hide keyboard accelerators. Gets or sets a value indicating 'vhetl1er the date represented by the TodayDate property is displayed at the botto1u of tl1e control. Gets or sets a value indicating 'vl1ether today's date is identified witl1 a circle or a square. Gets or sets a value indicating \vhether the montl1 calendar control displays "veek numbers (1-52) to the left of each row of days. Gets the minimum size to display one month of the calendar. Gets or sets the site of the control. Gets or sets the size of the MonthCalendar control. Gets or sets the tab order of the control within its container. Gets or sets a value indicating whetl1er tl1e user can give tl1e focus to this control using the TAB key. Gets or sets the object that contains data about the control. This API supports the product infrastructure and is not intended to be used directly from your code. Gets or sets the text to display on the MonthCalendar.(Overrides Control.TeA1.) Gets or sets a value indicating the background color of the title area of tl1e calendar. Gets or sets a value indicating the fore ground color of the title area of the calendar. Gets or sets the value tliat is used by MonthCalendar as today's date. Gets a value indicating w hetber the Today Date property has been explicitly set. Gets or sets the distance, in pixels, between the top edge of the control and the top edge of its container's client area. Gets the parent control that is not parented by anotl1er Windows Forms control. Typically, tlris is the outermost Fom1 that the control is contained in. Gets or sets a value indicating the color of days in montl1s that are not fully displayed in the control. Gets or sets a value indicatingwhetl1er to use the wait cursor for the current control and all child controls. Gets or sets a value indicating 'vhetl1er the control and all its child controls are displayed. Gets or sets the width of the control.

432

I PowerShell Studio -

A Comprehensive Guide

Window Target

This API supports the product infrastructure and is not intended to be used directly from your code. This property is not relevant for tllis class.

NOTIFYICON PROPERTY

BalloonTipIcon Balloon Tip Text BalloonTip Title Container ContextMenu ContextMenuStrip Icon Site Tag Text Visible

DESCRIPTION Gets or sets the icon to display on tl1e balloon tip associated with the Notify Icon. Gets or sets the text to display on the balloon tip associated with the NotifyIcon. Gets or sets the title of the balloon tip displayed on the Notify Icon. I Gets the !Container that contains the Component. Gets or sets the shortcut inenu for the icon. Gets or sets the shortcut inent1associated with the I Notify Icon. Gets or sets the current icon. Gets or sets the ISite of the Component. Gets or sets an object that contains data about the Notify Icon. Gets or sets the ToolTip text displayed \vhen the inouse poi.J1ter rests on a notification area icon. Gets or sets a value indicating \.vhether the icon is visible in the notification area of the taskbar.

NUMERICUPDOWN

Accelerations AccessibilityO bject AccessibleDefaultActionDescription AccessibleDescription AccessibleName AccessibleRole Active Control AllowDrop

Gets a collection of sorted acceleration objects for the NumericUpDown control. Gets the AccessibleObject assigned to the controt Gets or sets the default action description of the control for use by accessibility client applications. Gets or sets the description of the control used by accessibility client applications. Gets or sets the na1ne of the control used by accessibility client applications. Gets or sets the accessible role of the control Gets or sets the active control on the container control. Gets or sets a value indicating \.vhether the control can accept data that the user drags onto it.

PowerShell Studio - Reference Guide.

Anchor Au toScaleDimensions AutoScaleFactor AntoScaleMode AutoScroll

AutoScrollMargin

AutoScrollMinSize

AutoScroUOffset AutoScroUPosition Auto Size AutoValidate

BackColor

Back.g roundlmage

BackgroundlmageLayout

BindingContext

I 433

Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent. Gets or sets the dirnensions that the control was designed to. Gets the scaling factor between t11e current and design-time automatic scaling din1ensions. Gets or sets the automatic scaling mode of the control. This API supports the product infrastructure a11d is not inte11ded to be used directly from your code. Gets a value indicating whether the container 'vill allow the user to scroll to ai1y controls placed outside of its visible boundaries. Tllis API supports the product infrastn1cture and is not intended to be used directly fro1n your code. Gets or sets the size of the auto-scroll margin. This API supports the product infrastn1cture and is not intended to be used directly from your code. Gets or sets the minimum size of the auto-scroll area. Gets or sets ,;vhere this control is scrolled to iI1 ScrollControllntoView . Gets or sets the location. of the auto-scroll position. Gets or sets a value indicating whether the control should automatically resize based on its contents. Gets or sets a value that indicates vvhetber controls in this container ,vilJ be autoniatically validated when the focus chai1ges. Thls API supports the product infrastn1cture and is not intended to be used directly fro111 your code. Gets or sets the background color for the text box portion of the spin box (also k11o"vn as an up-down control). Thls API supports the product infrastn1cture and is not iI1tended to be ·used directly from your code. Gets or sets the backgro11nd image for the UpDownBase. This API supports the product infrastructure and is not intended to be used directly fron1 your code. Gets or sets the layout of the Backgroundhnage of the UpDo,vnBase. Gets or sets the BindiI1gContext for the control.

CanFocus

Gets or sets the border style for the spin box (also known as an up-down control). Gets the distance, in p.L~els, benveen the bottom edge of the control and tlle top edge of its container's client area. Gets or sets the size and locatio11 of the control including its nonclient elements, in pixels, relative to the parent control. Gets a value il1dicatingwhether the ImeMode property can be set to an active value, to enable 1ME support. Gets a value indicating \vhether the control can receive focus .

CanRaiseEvents

Detennines if events Call be raised on the control.

CanSelect

Gets a value indicating whether the control can be selected.

BorderStyle Bottom Bounds CanEnablelme

434

I PowerShell Studio -

A Comprehensive Guide

ClientRectan gle

Gets or sets a value indicating whether the control has captured tl1e mouse. Gets or sets a value indicating 'vhether the control causes validation to be performed on any controls that require validation whe11 it receives focus. Gets or sets a value indicating whether the text property is being changed intenlally by its parent class. Gets the rectangle that represents the client area of the control.

ClientSize

Gets or sets the height ai1d width of the client area of tl1e control.

CompanyName

Gets the name of the co111pany or creator of the application containing the control. Gets the !Container that contains the Component

Capture CausesValidation

ChangingTex1

Container

Controls

Gets a value indicating whether the control, or 011e of its child controls, currently has the input focus. This API supports tl1e product infrastructure and is not intended to be used directly from your code. Gets or sets the shortct1t n1enu associated with the spin box (also known as an up-do\vn co11trol). Gets or sets 01e shortcut 111enu for the spin box (also kno,vn as an up-do,vu control). Gets the collection of controls contained within the control.

Created

Gets a value indicatiug \vhether the control has been created.

CreateParams

This API suppo11s the product infrastructure and is not inteuded to be used directly fro1n your code. Gets the required creation paraineters when the control handle is created. Gets the ct1rrent n1n-ti111e dimensions of the screen.

ContainsFocus ContextMenu

ContextMenuStrip

CurrentAutoScaleDimensions Cursor DataBindings DecimalPlaces DefaultCursor

Gets or sets the cursor that is displayed when the mouse pointer is over the control. Gets the data bindings for the control. Gets or sets the number of decimal places to display in the spin box (also known as an up-dowi1 co11trol). Gets or sets the default cursor for the control.

DefaultPadding

Gets the default Input Method Editor (IME) mode supported by the control. Gets the space, in pixels, that is specified by default bet"veen controls. Gets the length and height in pixels that is specified as the defatilt maximum size of a coutrol. Gets the length and height, iI1 pixels, that is specified as the default nriuimwn size of a control. Gets the internal spacing, in pixels, of tl1e co11tents of a co11trol.

DefaultSize

Gets the default size of the control.

DesignMode

Gets a value that indicates whether the Component is currently in design mode. Gets the recta11gle tl1at represents the virtual display area of the control.

DefaultlmeMode DefaultMargin DefanltMaximumSize DefaultMinimumSize

DisplayRectangle

PowerShell Studio - Reference Guide

I 435

Font

Gets a value indicating whether the base Control class js in the process of disposing. Gets or sets which control borders are docked to its parent control and determines how a co11trol is resized ,;vitl1 its parent. This API supports the product infrastnicture and is not intended to be used directly from your code. Gets the dock padding settings for all edges of the UpDownBase control. Gets or sets a value indicating whether this control should redraw its surface using a secondary buffer to reduce or prevent flicker. Gets or sets a value indicating whether the control can respond to user interaction. Gets tl1e list of event handlers tliat are attached to this Compo neut. Gets a value indicating whether the control has input focus. Gets or sets the font of the te;x.'t displayed by the control.

FontHeight

Gets o:r sets the height of the font of the control.

ForeColor

Gets or sets the foreground color of the spit1 box (also known as an up-down control). Gets the windo"v handle that the control is bo1u1d to.

Disposing Dock DockPadding

DoubleBuffered Enabled Events Focused

Handle Has Children Height

Gets a value indicating whether the control contains one or more child controls. Gets or sets the height of the control.

ImeMode

Gets or sets a value indicating \vhether the spin box (also known as an up-down control) should display the value it contains in hexadecin1al fonnat. Gets the characteristics associated '¥ith tl1e ho1izontal scroll bar. Gets or sets a value indicating ,;vhether the horizontal scroll bar is visible. Gets or sets the Input Method Editor (Thtffi) mode of the control

I:mcModeBase

Gets or sets the IME niode of a control.

Increment

Gets or sets the value to increment or decrement tl1e spin box (also known as an up-do,~11 control) when the up or down bl1ttons are clicked. Gets or sets a value indicating '\-Vhether the user can use the UP ARROW and DOWN ARROW keys to select values. Gets a value indicating whether the caller must call an invoke method whe111naking 1nethod calls to tl1e co11tTol because the caller is on a different thread than the one the control was created on. Gets or sets a value indicating ,;vhether the control is visible to accessibility applicatio11s. Gets a value indicating whether the control has bee11 disposed of.

Hexadecimal

Ho rizontaJScroU HScroll

InterceptArrowKeys InvokcRequired

IsAccessible IsDisposed IsHandleCreated IsMirrored

Gets a value indicating wl1ether the control has a handle associated with it. Gets a value indicating whether the control is 1nirrored.

436

I PowerShell Studio -

A Comprehensive Guide

LayoutEngine

Gets a cached instance of the control's layout engine.

Left

Gets or sets the distru.1ce, in pixels, between the left edge of the control and the left edge of its container's client area Gets or sets the coordinates of the upper-left coiner of the control reJative to the upper-left con1er of its container. Gets or sets the space between controls. Gets or sets the maximmn value for the spin box (also kno"\ivn as an up-down control). Gets or sets the ma'Ximum size of the spin box (also .kJ.10,vn as an up-do,:vn control). Gets or sets the mini1ntun allo,;ved value for the spin box (also known as a11 up-down control). Gets or sets the minimum size of the spin box (also kno"\ivn as an up-do,:vn control). Gets or sets the nan1e of the control.

Location

Margin Ma..runum MaximumSize M .. 1n1mum

MinimumSize Name

Parent

This API supports the product infrastructure and is not intended to be used directly from your code. Gets or sets the space between the edges of a NumericUpDown control and its contents. Gets or sets the parent container of the control.

Pare.o tForm

Gets the fo1m that the container control is assigned to.

PreferredHeigbt

Gets the height of the spin box (also kno'm as an up-do\vn control). Gets the size of a rectangular area into which the control can fit. Gets the prodtict naine of the assembly containing the co11trol.

Padding

PreferredSize ProductName ProductVersion Read Only

RecreatingHandJe Region

ReoderRigbtToLeft ResizeRedraw

Right RightToLeft ScaJeChildreo Sho\v FocusCues ShowKeyboardCues

Site Size

Gets the version of the assembly co11tailtlng the control. Gets or sets a value indicating whether the text can be chru.1ged by the use of the up or do'¥n buttons only. Gets a value indicating whether the control is cmTently recreating its handle. Gets or sets the window region associated 'vith tl1e control. Obsolete. This property is no"v obsolete. Gets or sets a value indicating ' vhetl1er the control redraws itself whe11 resized. Gets the distance, in pixels, between tl1e right edge of the control and the left edge of its container's client area. Gets or sets a value indicating 'vhetl1er control's ele1nents are aligned to Sltpport locales usi11g right-to-left fonts. Gets a value tl1at deter1nines the scaling of child controls. Gets a value indicating "vhether the control should display focus rectru.1gles. Gets a value indicating whether the user iI1terface is in the approp1iate state to show or ltlde keyboard accelerators. Gets or sets the site of the control. Gets or sets the height and '\-Vidth of the control.

PowerShell Studio - Reference Guide

Tab Index

Gets or sets the tab order of the control witltin its container.

Tab Stop

Gets or sets a value indicating whether the user can give the focus to this control using the TAB key. Gets or sets the object that contains data about the control.

Tag Text

TextAlign

TbonsandsSe11arator

TO)l

TopLeveJControl UpDownAlign UserEdit UseW aitCu rso r

Value VerticalSci-oll Visible VScroll Width

Window Target

I 437

This API supports the product infrastructure and is not intended to be used directly fron1 your code. Gets or sets the text to be displayed in the NwnericUpDown control.(Overrides UpDownBase.Text.) Gets or sets the alignment of the text in the spin box (also knovvn as an up-down control). Gets or sets a val11e indicating vvhether a thousands separator is displayed in the spin box (also knov.in as an up-do,vn control) ~;vhen appropriate. Gets or sets the distance, in pixels, betvveen the top edge of the control and the top edge of its container's client area. Gets the parent control that is not parented by another Windo,;vs F onns control. Typically, this is the outennost Fonn that the co11trol is contained in. Gets or sets the aligrunent of the up and down buttons on the spin box (also kno\vn as an up-down control). Gets or sets a value indicating whether a value has been ei1tered by the user. Gets or sets a value indicating whether to use the wait cursor for the current control and all child controls. Gets or sets the value assigned to the spi11 box (also knovvn as an up-down control). Gets the characteristics associated \Vith the v·ertical scroll bar. Gets or sets a value indicating \vhether the control and all its cllild controls are displayed. Gets or sets a value indicating \vhether the vertical scroll bar is visible. Gets or sets the width of the control This API supports the product infrastn1cture and is not intended to be used directly from your code. This property is not relevant for this class.

OPENFILEDIALOG

AutoUpgradeEnabled

Gets or sets a value indicating 'vhether tllis FileDialog instance should

CbeckFileExists

automatically upgrade appearance and behavior when running on Windows Vista and above. Gets or sets a value indicating whether the dialog box displays a warning if the user specifies a file name that does not exist. (Overrides FileDialog.CheckFileExists.)

438

I PowerShell Studio -

I

A Comprehensive Guide I

Gets or sets a value indicating whether the dialog box displays a warning if the user specifies a path that does not exist. (Inherited fro1n FileDialog.) Gets the !Container that contains the Component. (lnhe1ited fro111 Container Component.) Gets the custom places collection for this FileDialog instance. (Inherited CustomPlaces from FileDialog.) Gets or sets the defa1Llt file na1ne e>..1ension. (111.herited from FileDialog.) DefaultExt Gets or sets a value indicating whet11er the dialog box retil1rns the location of DereferenccLinks the file referenced by the shortcut or \¥hether it returns the location of the shortcut (. lnk). (Inl1erited fro1nFileDialog.) Gets or sets a string contai1ung the file name selected in the file dialog box. FileNaine (Inherited fro111FileDialog.) FileNames Gets the file nan1es of all selected files in the dialog box. (Inherited fro1n FileDialog.) Filter Gets or sets the current file i1ame filter st1i ng, wluch detemlines the choices that appear in t11e "Save as file type" or "Files of type" box in tl1e dialog box. (hlherited fro1n FileDialog.) FilterIndex Gets or sets the index of the filter currently selected in the file dialog box. (Inherited from FileDialog.) InitialDirectorv Gets or sets t11e initial directory displayed by the file dialog box. (Inl1erited • fro1n FileDialog.) Mu ltiselect Gets or sets a value indicating whether the dialog box allows inultiple files to be selected. Gets or sets a value indicating whether the read-only check box is selected. Read OnlyChccked Gets or sets a value indicating whether the dialog box restores the directory RestoreDirectory to tl1e previously selected directo1y before closing. (Inherited fro1n FileDialog.) SafeFileN ame Gets the file name and extension for the file selected in the dialog box. The file name does not include the path. Gets an array of file names and eA1ensions for all the selected files in the SafeFileN aines dialog box. The file names do not include the path. Gets or sets a value indicating whether the Help button is displayed in the ShowHelp file dialog box. (l1lherited fro1n FileDialog.) Gets or sets a value indicating whether the dialog box contains a read-only SholvReadOnly • check box. Gets or sets the !Site of the Component. (In11erited fro1n Component.) Site Sup portMultiDottedExtensions Gets or sets whether the dialog box supports displaying and saving files that have inultiple file name eA1ensions. (Inherited from FileDialog.) Gets or sets an object that contains data about the control. (Inl1erited from Tag Co mn10 nD ialo g.) Gets or sets the file dialog box title. (Inherited fromFileDialog.) Title Gets or sets a value indicating whetl1er the dialog box accepts 01tly valid ValidateNaines Win32 file names. (Inhe1ited fro1n FileDialog.) CheckP athExists

PANEL

PowerShell Studio - Reference Guide.

I 439

•r

'

ActualHeight

Gets the rendered height of this element.

ActualWidth

Gets the rendered 'vidth of this eleme11t.

AllowDrop

Gets or sets a value indicating '1vhether this element can be lISed as the target of a drag-and-drop operation. This is a dependency property. Gets a value that indicates whether at least one tot1cl1 is capttued to this element. Gets a value that indicates whether at least one touch is captured to this elen1ent or to any child ele1nents in its visual tree. Gets a value that indicates whether at least one touch is pressed over this ele1nent. Gets a value that indicates whether at least one touch is pressed over this element or any child elements in its visual tree. Gets or sets a Brush that is used to fill the area between tlle borders of a Panel. Gets or sets the BindingGroup that is used for the ele1nent.

AreAnyTouchesCaptured AreAnyTouchesCapturedWitbin AreAnyTouchesDirectlyOver AreAnyTouchesOver Bacl..1 for an elen1ent when it participates in data binding. Gets or sets t11e key to use to reference t11e style for tllis control, when theme styles are used or defined. Gets the DependencyObjectType that '1vraps the CLR type of tllis instai1ce. (Inherited from DependencyObject.) Gets the size that this element computed during the measure pass of the layou~rocess. Gets the Dispatcher this DispatcberObject is associated with. (Inherited from DispatcherObject.)

BitmapEffectlnput

Cli11T0Bounds

Command Bindings

ContextMenu

Cursor DataConte:\'t DefaultStyleKey DependencyObjectType DesiredSize Dis11atcher

440

I PowerShell Studio -

A Comprehensive Guide

•• Effect FlowDirection Focusable FocusVisuaJStyle •

ForceCursor

HasAnim atedP ro11erties HasEffectiveKevboardFocu s • HasLogicaJOrien tation HasLogical01ientationPublic Height

Gets or sets the bitmap effect to apply to the UIEJement. This is a dependency property. Gets or sets the direction that text ru1d other user interface CUD elements flo'v "vithin any parent element that controls their layout. Gets or sets a value that indicates whether U1e elen1ent can recei e focus. This is a dependency prope1ty. Gets or sets a property that enables custonuzation of appearru1ce. effects. or other sly le characteristics that \Vill apply to this ele1nent when it capllrres keyboard focus. Gets or sets a value that indicates "'' hether this Fra1ne\vork.Elen1ent should force the user interface (UI) to render the cursor as declared by the Cursor properly. Gets a value indicating \¥hether this elen1ent has any anilnated properties. Gets a value that indicates \:vhether the UIElen1ent has focus. Gets a value that indicates \vhether this Panel arranges its descendants in a single di1nension. Gets a value that indicates \Vhether this Pa11el arranges its descendants in a single dllnension. Gets or sets the suggested height of the elc1nent.

lnputBindings

Gets or sets the 11orizontal alignment characteristics applied to this ele1nent ' vhen it is composed \vithin a parent element. such as a panel or ite1ns co11trol. Gets or sets the scope li1nits for property value iI1heritance. resource key lookup, and RelativeSource FindAncestor lookup. Gets the collection of input bi11dings associated '"ith this element.

In11utScope

Gets or sets tl1e context for input used by this Fr3111e\vorkElement.

lntemaJChildren

Gets a UIElementCollection of child ele1nents.

lsArrangeValid

Gets a value indicating vYhether the computed size and position of child ele1nents in tlris element's layout are valid. Gets or sets a value indicating vvhether this element is enabled in the user interface (Ul). This is a dependency property. Gets a value that becomes the return value of lsEnabled in derived classes. Gets a value that detemlines \Vhether this element has logical focus . This is a dependency property. Gets or sets a value that declares \vheU1er this ele1nent can possibly be returned as a hit test result from some portion of its rendered content. This is a dependency property. Gets a value that indicates \vhether this element has been initialized, either during processing by a XAML processor, or by explicitly having its Endinit method called. Gets a value indicating v-Ybether an input n1ethod system~ such as an Input Method Editor (IlvfE) is enabled for processing the input to this element. Gets or sets a value that indlcates that this Panel is a container for user interface (Ul) ite1ns that are generated by an Ite1nsControl.

HorizontalAlignment

lnheritanceBehavior

lsEnabled IsEnabledCore IsFocused IsHitTestVisible

lslnitialized

lslnputMethodEnabled

lsItem sHost

PowerShe ll Studio - Refere nce Guide.

IsKeyboardFocused IsKeyboardFocusWithin •

IsLoaded IsManipulationEnabled IsMeasu reValid lsMouseC aptured IsMouseC aptu reWithin

IsMouseDirectlyOver

l sMouseOver

IsSealed IsStylusCaptured IsStylusCaptureWithin

lsStylusDirectlyOver

IsStylusOver

IsVisible La.oguage LayoutTra.osfo rm LogicalChildren LogicalOrientation LogicaJOrientationPublic

Margi.o

'

I 441

Gets a value indicating whether this element has keyboard focus. This is a dependency property. Gets a value indicating whether keyboard focus is anywhere \Vithin the element or its visual tree child elen1ents. This is a dependency property. Gets a value that indicates wl1ether this element has been loaded for presentation. Gets or sets a value that indicates whether manipulation events are enabled on this UIElement. Gets a value indicating whether the current size returned by layout measure is valid. Gets a value indicating ,;vhether the inouse is captured to this elen1e11t. This is a depende11cy property. Gets a value that detennines wl1ether mouse capture is held by this element or by child elements in its visual tree. This is a dependency property. Gets a value that indicates \vhether the position of the inouse pointer corresponds to hit test results, \.Vhich take ele1nent compositing into account. This is a dependency property. Gets a value indicating whether the 1nouse pointer is located over this element (including child elements in the visual tree). This is a dependency property. Gets a value that indicates whether this instance is currently sealed (read-only).(lnherited fro1n DependencyObject.) Gets a value indicating whether the stylus is captured by this ele1nent. This is a dependency property . Gets a value that detennines whether stylus capture is held by this elen1ent, or an ele1nent within the ele1nent bounds and its visual tree. This is a dependency property. Gets a value that indicates whether the stylus position co1responds to hit test results, which take ele1nent co1npositing into account. This is a dependency property. Gets a value indicating whether the stylus cursor is located over tllis element (including visual child elements). This is a depende11cy property. Gets a value indicating whether this element is visible in the user interface (Ul). This is a dependency property. Gets or sets localization/globalization language information that applies to an element. Gets or sets a graphics transformation that sl1ould apply to this element when layout is performed. Gets an entlIDerator that cm1 iterate the logical child elements of tllis Panel element. (Overrides Frame,;vorkEleme11t.Lo gicalChildren.) The Orientation of the panel if tl1e pm1el supports layout in only a si11gle dimension. The Orie11tatio11 of the panel, if the panel supports layout in only a single dimension. Gets or sets the outer niargiI1 of an element.

442

I PowerShell Studio -

A Comprehensive Guide

Max Height

•Gets or sets tbe maximum height constraint of the element.

MaxWidth

Gets or sets the maximum width constraint of tl1e element.

MinHeight

Gets or sets the mini mum height co11straint of the element. Gets OT sets the 1ninimum ,;vidth constraint of the element.

MinWidth

Parent

Gets or sets the identifying naine of tl1e element. The ruune provides a reference so tl1at code-behin~ such as event handler code, ca11 refer to a n1arkup ele1nent after it is constructed during processing by a XAML processor. Gets or sets the opacity factor applied to the entire UIEle111ent when it is rendered in the user interface (UI). Tllis is a dependency property. Gets or sets an opacity uiask, as a B1ush implementation that is applied to any alpha-cllal1Ilel maskil1g for the rendered content of this element. This is a dependency property. Gets or sets a value that indicates vvhether tllis elen1ent incorporates style properties fro111 theme styles. Gets the logical parent ele1nent of this ele1nent.

Persistld

Obsolete.Gets a value that uniquely identifies this element.

RendcrSize

Gets (or sets, but see Remarks) the final render size of tllis element.

Ren.derTransform

Gets or sets trai1sform information that affects tl1e rendering position of this element. Tllis is a dependency property. Gets or sets the center point of any possible render trai1sfor1n declared by RenderTransforni, relative to the bounds of the element. This is a dependency property. Gets or sets the locally-defined resource dictionary.

Name

Opacity OpacityMask

OverridesDefaultStyle

RenderTransformOrigin

Resources SnapsToDevicePi'tels

Style StylusPlu gins Tag Tero platedParent ToolTiJ.> TouchesCaptured TouchesCa1>turedWitbin Tou chesD irectlyOver • ToucbesOver Triggers

Gets or sets a valtte that detennines whetl1er rendering for tllis element should use device-specific pixel settings dming rendering. This is a dependency property. Gets OT sets the style used by tllis ele1nent when it is rendered. Gets a collection of all stylus plug-in (customizatio11) objects associated with this element. Gets or sets au arbitrary object value that cai1 be used to store custo1n infomiation about this element. Gets a reference to the template parent of this ele1neut. Tllis property is not releva11t if the elen1ent ,;vas not created through a te1nplate. Gets or sets the tool-tip object that is displayed for tllis element in the user interface (UI). Gets all toucl1 devices tliat are captured to this ele1nent. Gets all touch devices that are captured to this element or any child elements in its visual tree. Gets all touch devices tliat are over this element. Gets all to11ch devices that are over this element or any child elements in its visual tree. Gets the collection of triggers established directly on this element, or in child elen1ents.

PowerShell Studio - Reference Guide

Uid UseLayoutRou.ncling VerticalAlignment

Visibility Visu alBitmapEffect

Gets or sets the unique identifier (for localization) for this element. This is a dependency property. Gets or sets a value that indicates 'vhether layout rounding should be applied to this element's size and position during layout. Gets or sets the vertical alignment characteristics applied to this element when it is composed within a parent element such as a panel or items control. Gets or sets the user interface (Ul) visibility of this element. This is a dependency property. Obsolete.Gets or sets the BitmapEffect value for the Visual.

VisuaIBitmapScalingMode

Obsolete.Gets or sets the BitmapEffectlnput value for the Visual. Gets or sets tl1e BittnapScalingMode for the Visual.

VisualCacheMode

Gets or sets a cached representation of the Visual.

VisualChildrenCount

VisuaJCliJ>

Gets the number of child Visual objects in this instance of Panel. (Overrides Framework.Element. VisualChildrenCount.) Gets or sets the ClearTypeHint that determines bo'v ClearType is rendered in the Visual. Gets or sets the clip region of the Visual as a Geometry value.

VisualEdgeMode

Gets or sets the edge inode of the Visual as a11 EdgeMode value.

VisualEffect

Gets or sets the bitmap effect to apply to the Visual. Gets or sets the offset value of the visual object. Gets or sets the opacity of the Visual. Gets or sets the Bn1sh value that represents the opacity mask of the Visual. Gets the visual tree parent of the visual object.

Visu alBitm apEffectln put

Visu alClearTypeHint

VisualOffset VisualOpacity VisualOpacityMask VisualParent

I 443

Viso alTextHintingMode

Gets or sets a clipped scrollable area for the Visual. Gets or sets the TextHintingMode of the Visual

VisualTextRenderingMode

Gets or sets the TextRenderingMode of the Visual.

Visu alTransfo rm

Gets or sets the Transfor1n value for tl1e Visual. Gets or sets the x-coordinate (vertical) guideline collection.

VisuaJScrollableAreaClip

VisualXSnappingGuidelines VisuaJYSnappingGuidelines Width

Gets or sets the y-coordiJIBte (horizontal) guideline collectio11. Gets or sets the width of the elen1ent.

PICTUREBOX PROPERTY AccessibilityO b ject AccessibleDefaultActionDescri 11tion

DESCRIPTION Gets the AccessibleObject assigned to the control.

Gets or sets tl1e default action descriptio11 of the control for use by accessibility client applications.

444

I PowerShell Studio -

Accessi bleDescription Accessi bleN ame Accessible:R..ole Allo'\vDrop

Anchor

AutoScroUOtl'set Auto Size

BackColor Backgrou_ndlmage

A Comprehensive Guide Gets or sets the description of the control used by accessibility client aE_plications. Gets or sets the name of the control used by accessibility client applications. Gets or sets the accessible role of the control This API supports the product infrastructure and is not intended to be used directly from your code. Overrides the Control.AllowDrop property .(Overrides Control.AllowDrop.) Gets or sets the edges of the container to which a control is bound and deter1nines how a control is resized ,;vith its parent. Gets or sets vvhere this control is scrolled to in ScrollControllnto Vie,;v. This API supports the product infrastn1cture and is not intended to be used directly from your code. This property is 11ot relevai1t for this class. Gets or sets the background color for the co11trol.

BindingContext

Gets or sets the background ilnage displayed in the control. Gets or sets the background iniage layout as defined in the ImageLayout enumeration. Gets or sets the BindingContext for the control.

BorderStyle •

Ind1cates tl1e border style for tl1e control.

Bottom

Gets the distance, in pixels, between t11e bottom edge of the control and the top edge of its container's client area. Gets or sets the size a11d location of the control including its nonclient elements, in pixels, relative to the parent control. Gets a value indicating whether the ImeMode property ca11 be set to an active value, to enable IlME support. Gets a value indicating whether the control ca11 receive focus . Determines if events can be raised on the control.

Bacl{groundlmageLayout

Bouods

CanEnablelme

CanFocus CanR.aiseEvents Can Select Capture CausesValidation

ClientRectangle ClientSize CompanyName

Gets a value indicating vvhether the control can be selected. Gets or sets a value indicating whether the control has captured the n1ouse. This API supports the product infrastl11cture ai1d is not intended to be used directly from your code. Overrides the Co11trol. Causes Validation property. Gets the rectangle iliat represents the client area of the control. Gets or sets the height and width of tl1e clie11t area of the control. Gets the name of the co1npany or creator of the application containing the control.

PowerShe ll Studio - Refere nce Guide

I 445

Container

Gets the !Container that contains the Component.

ContainsFocus

Gets a value indicating ,;vl1ether the control, or one of its child controls, currently has the input focus. Gets or sets the shortcut menu associated with the control. Gets or sets the ContextMenuStrip associated with this control. Gets the collection of controls contaiI1ed within tl1e control. Gets a value indicating ,;vhether the control has been created. This API st1pports the product infrastructure and is 11ot intended to be used directly from yo tu code. Overrides the Control.CreateParams property .(Overrides Control. CreateParams.) Gets or sets the cursor that is displayed when the mouse pointer is over the control. Gets the data bindings for the control.

ContextMenu ContextMenuStrip Controls Created CreateParams

Cursor DataBindings Defau ltCu rsor DefaultlmeMode

DefaultMargin Defau ltMaximumSize DefaultMinimumSize DefaultPadding DefaultSize Design.Mode DisplayRectangle Disposing Dock

DoubleBoffered

Enabled Er1·orlmage

Gets or sets the default cursor for tl1e control. Gets a value indicating the mode for Input Method Editor (Th1E) for the PictureBox.(Overrides Control.Defaultl1neMode.) Gets the space, in pix.els, that is specified by default bet\veen controls. Gets the length and height, in pixels, that is specified as the default n1axi1nUin size of a control. Gets the length and height, in pi,~e ls, that is specified as tl1e default mini1num size of a control. Gets the internal spacing, in pixels, of the contents of a control. Gets the default size of the control. (Overrides Control.DefaultSize.) Gets a value that indicates ,;vhether the Co1uponent is c11rrently in design n1ode. Gets the rectangle that represe11ts tl1e display area of the controI. Gets a value indicati11g whether tl1e base Control class is .i n the process of disposing. Gets or sets '\-Vhicl1 control borders aJe docked to its parent control and determines 11ow a control is resized with its parent Gets or sets a value indicating \¥hether tllis control should redraw its surface using a secondary buffer to reduce or prevent flicker. Gets or sets a value indicating,vl1ether the control can respond to user interaction. Gets or sets the image to display when an e1Tor occurs dUiing the image-loading process or if the iluage load is canceled.

446

I PowerShell Studio -

Events Focused Font

FontHeight ForeColor

Handle Has Children Height Image lmageLocation lmeMode ImeModeBase lnitiallm.age Invo.k eRequired

IsAccessible IsDisposed

lsHandleCreated IsMirrored

LayoutEngine Left

Location

Margin Ma'timumSize

A Comprehensive Guide Gets the list of event handlers that are attached to this Component. Gets a value il1dicating 'vhetl1er the control has input focus. This API supports the product infrastn1ct11re and is not intended to be used directly from your code. Gets or sets the font of the te>..'t displayed by the control.(Overrides Control.Font.) Gets or sets the height of the font of the control This API supports the product infrastn1chrre and is not intended to be used directly from your code. Overrides tl1e Control.ForeColor property.(Ove1rides Control.ForeColor.) Gets the window handle that the co11trol is bound to. Gets a value indicating 'vhether the control contains one or 1nore child controls. Gets or sets the height of the control. Gets or sets the image that is displayed by PictureBox. Gets or sets tl1e path or URL for the image to display in the PictureBox. Gets or sets the Input Metl1od Editor(IME) 1node supported by this control. Gets or sets the Ilv1E nlode of a control. Gets or sets tl1e image displayed in the PictureBox control when the main image is loading. Gets a value indicating whether the caller inust call an invoke n1ethod when making 1netl1od calls to the control because the caller is on a different thread tba11 the one tl1e control ,;vas created on. Gets or sets a value il1dicating whether the control is visible to accessibility applications. Gets a value indicating vvhether the control has been disposed of. Gets a value indicating whether the control has a handle associated vvitl1 it. Gets a value indicating whether the control is nrirrored. Gets a cached instance of the control's layollt engine. Gets or sets the distance, in pixels, between tl1e left edge of the control and the left edge of its container's client area. Gets or sets the coordinates of the tipper-left comer of the control relative to the upper-left comer of its contai11er. Gets or sets the space ben.veen controls. Gets or sets the size that is the upper limit that GetPreferredSize can specify.

PowerShell Studio - Reference Guide

I 447

Padding

Gets or sets the size that is the lo,ver limit that GetPreferredSize can specify. Gets or sets the name of the control. Gets or sets padding within the control.

Parent

Gets or sets the parent contaiJ.1er of the control.

PreferredSize

Gets the size of a rectangular area into vvhich the control can fit. Gets the product name of the assembly containing the control. Gets the version of the assembly containing the control. Gets a value indicating \;vhether the co11trol is currently re-creating its handle. Gets or sets tl1e window region associated wit11 the control. Obsolete.This property is now obsolete.

MinimumSize Name

ProductName ProductVersion RecreatingHandle Region RenclerRigbtToLeft

Site

Gets or sets a value indicating "vhether the control redraws itself \¥he11 resized. Gets the distance, in pixels, beti;veen the right edge of the control and the left edge of its container's client area. This API supports the product infrastruct1ue and is not intended to be used directly fron1 your code. Gets or sets a value indicating whether control's elements are aligned to support locales usiJ.1g right-to-left languages.(Ovenides Control.RightToLeft.) Gets a value that detenuines tl1e scaling of child controls. Gets a value indicating \;vhether the control shottld display focus rectangles. Gets a value indicating \¥ hethe.r the user iJ.1terface is in the appropriate state to show or hide keyboard accelerators. Gets or sets the site of the control.

Size

Gets or sets tl1e height a11d width of the control.

SizeMocle

Indicates how the iniage is displayed.

TabIndex

This API supports the product infrastructure and is not it1tended to be used directly from your code. Gets or sets the tab index value. This API supports the product infrastructtue and is not i11tended to be used directly from your code. Gets or sets a value that indicates "vhether the user can give the focus to this control by using the TAB key. Gets or sets the object that contaillS data about the control. This API supports the product infrastructt1re and is not intended to be used direc~y from your code. Gets or

ResizeRed ra'v Right

RightToLeft

ScaleChildren ShowFocusCues SholvKeyboardCues

TabStop

Tag Text

448

I PowerShell Studio -

A Comprehensive Guide sets the text of the PictureBox. (Overrides Control. Text.) Gets or sets the distaI1ce, in pixels, between the top edge of the control and the top edge of its container's client area. Gets the parent control that is not parented by another Windows Forms control. Typically, this is the outermost Form that the control is co11tained in Gets or sets a value indicating 'vhether to use the ' vait cursor for the current control and all child controls. Gets or sets a value indicating vvhether the control and all its child controls are displayed. Gets or sets a value indicating whether an image is loaded synchronously. Gets or sets the widtl1 of the control.

Top

TopLeveLControl

UseW aitCursor Visible WaitOnLoad Width

This API supports the product infTastruct1rre and is not intended to be used directly fro1nyour code. This property is not relevant for tlris class.

Win.do,vTarget

PROGRESSBAR AND PROGRESSBAROVERLA Y

AccessibilityObject AccessibleDefaultActionDescriptiou AccessibleDescri11tion AccessibleName

•Gets the AccessibleObject assigned to the control. Gets or sets the default action description of the control for use by accessibility client applications. Gets or sets the description of the control used by accessibility client applications. Gets or sets the nan1e of the control used by accessibility client ~plications.

AccessibleRole AllowDrop

Anchor AutoScrollOfl'set Auto Size

Baclveen controls. Gets or sets the tin1e period, in milliseconds. that it takes tl1e progress block to scroll across the progress bar. Gets or sets the maximtlill value of the range of the control. Gets or sets the size tl1at is the upper linlit that GeltPreferredSize can specify . Gets or sets tl1e 1nillimum value of U1e range of the control.

PowerShell Studio- Reference Guide

I 451

• MinimumSize Name Padding

Parent PreferredSize ProductN aine ProductVersion RecreatingHandJe Region RenderRightToLeft ResizeRed ra'v Right RigbtToLeft RightToLeftLayout ScaJeChildren Sho''' FocusCues

SholvKeyboard Cues • Site Size

Stc1> Stvle ~

Tablndex

TabStop Tag

Text

TopLevelControl

UseW aitCursor Value

Gets or sets the size tl1at is the lower linlit that GetPreferredSize can specify . Gets or sets the name of the control. This API supports the product infrastructure and is not iluended to be used directly fron1 your code. Gets or sets the space bet,veen the edges of a ProgressBar control and its contents. Gets or sets the parent container of the control. Gets the size of a rectangular area into which tbe control can fit. Gets the product name of the assen1bly containing the control. Gets the version of U1e assembly containing U1e control. Gets a value indicating \Vhether the control is currently re-creating its handle. Gets or sets U1e \vindolv region associated with the control. Obsolete.This property is now obsolete. Gets or sets a value indicating whell1er the control redra'\\·s itself \vhen resized. Gets the distance. in pi-xels, bet\veen the right edge of the control and the left edge of its container's client area. Gets or sets a value indicating \¥heU1er control's elen1ents are aligned to Sltpport locales using right-to-left fonts. Gets or sets a value indicating \Yhether the ProgressBar and auy te·xt it contains is displayed from right to left. Gets a value that detemunes t11e scaling of cl1ild controls. Gets a value indicating \vhether the control should display focus rectangles. Gets a value indicating \Vhether the user interface is in the appropriate state to show or hide keyboard accelerators. Gets or sets the site of the control. Gets or sets the height and \Vidth of the control. Gets or sets the an1ount by \vhich a call to the PerformStep method increases the current position of the progress lbar. Gets or sets the 1Tu1nner in which progress shottld be indicated on the progress bar. Gets or sets the tab order of the control \vitllin its container. This API supports the product infrastructure and is not intended to be used directly fro1u yotu code. Overrides TabStop. Gets or sets the object that contains data about the control. Tllis API supports ll1e product infrastructure and is not intended to be used directly from your code. Gets or sets the text associated ~vith this control.(Overrides Control. TeA1.) Gets or sets the distance, in pi-xels, between the top edge of the control and the top edge of its contaiuer's client area. Gets the parent control that is not parented by anotl1er Windo,vs Fonns control. Typically. this is the outermost Form that the control is contaii1ed in. Gets or sets a value indicating whether to use th.e wait cursor for the current control a11d all child controls. Gets or sets the current position of the progress bar.

452

I PowerShell Studio -

A Comprehensive Guide

• Visible Width WinctowTarget

Gets or sets a value indicating whether the control and all its child controls are displayed. Gets or sets the width of the control. This API supports the product infrastn1cture and is not intended to be used directly from your code. This property is not relevant for this class.

PROPERTY GRID

Accessi bilityO bject AccessibleDefaultActionDescri1Jtion AccessibleDescription AccessibleName AccessibleRole ActiveControl AllO"\VDro)l Anchor AutoScaleD imension s AutoScaleFacto r AutoScaleMode AutoScroll

AutoScrollMargin AutoScrollM.inSize AutoScrollOffset AutoScrollPosition Auto Size

Au to Validate

BackColor

Gets tl1e AccessibleObject assigned to the control. Gets or sets t11e default actio11 description of th.e control for use by accessibility client applications. Gets or sets the description of the control used by accessibility client applications. Gets or sets the ria111e of the control used by accessibility client applications. Gets or sets the accessible role of the control Gets or sets the active control on the container control. Gets or sets a value indicating vvhether the control can accept data that the user drags onto it. Gets or sets the edges of the container to which a control is bow1d and detennines how a control is resized vvitl1 its parent. Gets or sets the di1ne11sions that tl1e co11trol was designed to. Gets the scaliI1g factor between the current and design-ti1ne auto1natic scaling diinensions. Gets or sets the automatic scaling niode of the control. This API supports the product infrastructure and is not intended to be used directly from your code. This property is not relevant for this class.(Overrides ScrollableC011trol.AutoScroll.) Gets or sets the size of the auto-scroll margin. Gets or sets the inini1num size of tl1e auto-scroll. Gets or sets vvhere this control is scrolled to in ScrollControllntoView. Gets or sets the location of the auto-scroll position. This API supports the product infrastructure and is not intended to be used directly from your code. This property is not relevant for this class. Gets or sets a value that iI1dicates vvhether controls in iliis container 'vill be auto11iatically validated when tl1e focus changes. Gets or sets the background color for the control. (Overrides Control.BackColor.)

PowerShell Studio - Reference Guide

Backgroundlmage

BackgroundlmageLayou t

BindingContext Bottom Bounds Browsab lcAttributes CanEnablelme CanFocus CanRaiscEvents CanSelect CanSholvCommands CanShowVisu alStyleGlyJlhs Capture CategoryForeColor CategoryS1>litterColor CausesVaJidation

ClientRectangle

I 453

Thjs API supports the product infrastructure and is not inte11ded to be used directly fro111 your code. This property is not relevant for this class. (Overrides Control.Backgroundlrnage.) Tlus AP! supports the product infrastructure and is not i.J1tended to be used directly from your code. This property is not relevant for this class.(Overrides Control.BackgroundimageLayout.) Gets or sets tl1e BindingConte:\.1 for the control. Gets the distance, in pixels, bet\veen the bottom edge of the control and the top edge of its container's client area. Gets or sets the size and location of the control including its nonclient elements, in pixels, relative to the parent control. Gets or sets the bro,vsable attributes associated with the object that the property grid is attached to. Gets a value indicating \vhether the ln1eModie property can be set lo an active value. to enable IME support. Gets a value indicating ~vbether the control can receive focus . Determines if events can be raised on the control. Gets a value indicating whether the control can be selected. Gets a value indicating \\rhether tl1e conunands pane can be made visible for the currently selected objects. Gets or sets a "Value that indicates whether OS-specific visual style glyphs are used for the e:\.-pansion nodes in the grid area. Gets or sets a value indicating \Vhether the control has captured the rnouse. Gets or sets the te>..'t color used for category headings. Gets or sets the color of the line that separates categories in the grid area. Gets or sets a value indicating \Vbether the control causes validation to be perfonned on any controls U1al require validation when it receives focus. Gets the rectangle that represents the client area of the control.

CommandsLinkColor

Gets or sets the height and ' vidth of the client area of the control. Gets or sets the color of active Links in the executable conu11a.uds region. Gets or sets the background color of the hot collllnands region. Gets or sets the color of the border swTotmding the bol co1runands region. Gets or sets the unavailable link color for tbe executable con11nands region. Gets or sets the foregrotu1d color for the hot comnuu1ds region. Gets or sets the link color for the executable comn1ands region.

CommandsVisible

Gets a value indicating ' vhether the co1nn1ands pane is visible.

Comm andsVisiblelfAvailable

Gets or sets a value indicating '\1 hether the con1rna11ds pane is visible for objects U1at ex-pose verbs.

ClientSize CommandsActiveLinkColor· CommandsBackColor CommandsBorderColor CommandsDisabledLinkColor CommandsForeColor

454

I PowerShell Studio -

A Comprehensive Guide

CompanyN ame Container ContainsFocus ContextMenu ContextMenuDefaultLocation ContextMenuStrip Controls

Created CreateParams CurrentAutoScaleDimensions Cursor DataBindings DefaultCursor DefaultlmcMode DefaultMargin DefaultMaximumSize DefaultMinimumSize DefaultPadding DefaultSize DefaultTa.bType DesignMode DisabledltemForeColo r DisplayRectangle Disposing Dock DockPadding DoubleBuffered Dra,vFJatToolbar

Gets the name of the cotnpany or creator of the application containing the control. Gets the !Container that contains the Co111pone11t. Gets a value il1dicatingwhether the control, or one of its child controls, cmrently bas the input focus. Gets or sets the shortcut menu associated with the control. Gets tl1e default location for the shortcut menu. Gets or sets the Conte~"Ment1S trip associated with this control. This API supports the product infrastructure and is not intended to be used directly from your code. This property is not relevant for tllis class. Gets a value indicatil1g vvhether the control has been created. Gets the required creation para1neters wl1en the control handle is created. Gets the current run-time di1nensions of the screen. Gets or sets the cursor that is displayed \;vhen the mouse pointer is over the control. Gets the data bindings for the control. Gets or sets the default cursor for the control. Gets the default Input Method Editor (Thill) mode supported by the control. Gets the space, in pixels, that is specified by default between controls. Gets the length and height. in pixels, that is specified as the defa1llt maxi1nrun size of a control. Gets the length and height, in pixels. that is specified as the defa1llt minin1mn size of a control. Gets the internal spacing, in pixels, of tl1e contents of a control. Gets the default size of the control.(Overrides Control.DefaultSize.) Gets the type of the defa1tlt tab. Gets a value tl1at indicates whether tl1e Co1nponent is currently in design mode. Gets or sets the foregroru1d color of disabled text in the grid area. Gets the rectangle that represents the virtual display area of the control. Gets a value indicating wl1ether the base Control class is in the process of disposing. Gets or sets vvbich control borders are docked to its parent control and detennil1es how a control is resized with its parent. Gets the dock padding settings for all edges of the control. Gets or sets a value indicating vvhether this control should redraw its surface using a secondary buffer to reduce or prevent flicker. Gets or sets a value indicating \¥hether the PropertyGrid control paints its toolbarwith flat buttons.

PowerShell Studio - Reference Guide

I 455

Focused

Gets or sets a value indicating whether the control can respond to user interaction. Gets the list of event handlers that are attached to this Component. Gets a value indicating whether the control has input focus.

Font

Gets or sets the font of the text displayed by the control.

FontHeight

Gets or sets the height of the font of the control.

ForeColor

This API supports the product infrastn1cture and is not intended to be used directly from your code. This property is not relevant for this class.(Overrides Control.ForeColor.) Gets the window handle that the control is bom1d to.

Enabled Events

Handle

Height

Gets a value indicating vvhetber the control contains one or inore child controls. Gets or sets the height of the control.

Hel1>BackColor

Gets or sets the backgrotmd color for the Help region.

HelpBorderColor

HelpVisible

Gets or sets the color of the border surrounding the description pane. Gets or sets the foreground color for the Help region. Gets or sets a value indicating \;vhether the Help text is visible.

HorizontalScroll

Gets tl1e characteristics associated with tl1e horizontal scroll bar.

HScroll lmeMode

Gets or sets a value indicating \;vhether the horizontal scroll bar is visible. Gets or sets the Input Method Editor (I.ME) inode of the control.

lmeModeBase

Gets or sets the Th1E mode of a control.

lnvokeRequired

Gets a value indicating whether the caller n1ust call an ii1voke met11od vvhen maki.I1g 1nethod calls to tlle control because the caller is on a different thread than the one the control was created on. Gets or sets a value indicating whether tl1e control is visible to accessibility applications. Gets a value indicating \Vhether the control has been disposed of.

Has Children

Hel1>ForeColor

lsAccessible IsDisposed IsHandleCreatecl IsMirro reel LargeButtons LayoutEngi.ne Left LineColor Location Margin

Gets a value indicating whether the control has a handle associated "vith it. Gets a value iI1dicating whether the control is inin·ored. Gets or sets a value indicating whether b11ttons appear in standard size or in large size. Gets a cached instance of the control's layout e11gine. Gets or sets the distance, in pL'..'t displayed by the control. Gets or sets the height of the font of the control. Gets or sets the foreground color of the control. Gets the window handle that the control is bound to. Gets a value indicating "vhether the co11trol contains 011e or more child controls. Gets or sets the height of the control. Gets or sets the image that is displayed on a button control. Gets or sets the alignment of the image on the button control. Gets or sets the i1nage list index value of the image displayed on the button control. Gets or sets the key accessor for the image in the ImageList. G·ets or sets the lmageList tliat contains the Image displayed on a button control. This API supports the product infrastructure and is not intended to be used directly from your code. Gets or sets the Input Method Editor (IME) n1ode supported by this control. This property is i1ot relevant for this class. Gets or sets the IME mode of a control. Gets a value indicating whetl1er the caller must call a11 invoke method when making method calls to the control because the caller is on a different thread than the one the control was created on. Gets or sets a value i11dicating whether the control is visible to accessibility applications. Gets or sets a value indicating "\>vhether the button control is the default button. Gets a value indicating \vhether the control has been disposed of. Gets a value indicating 'vhether the control has a l1311dle associated \¥ith it. Gets a value indicating \Vhetber the control is mirrored. Gets a cacl1ed instance of the control's layout engine.

PowerShell Studio - Reference Guide Left

Location

Margin

I 461

Gets or sets the distance, in pixels, ben.veen the left edge of tl1e control and the left edge of its co11tainer's client area. Gets or sets the coordinates of the upper-left comer of the control relative to the upper-left comer of its contai11er. Gets or sets tl1e space bet\veen controls.

Name

Gets or sets the size that is the upper limit that GetPrefe1TedSize can specify. Gets or sets the size that is the lower limit that GetPrefe1TedSize can specify. Gets or sets the name of tl1e control.

Padding

Gets or sets padding within the control.

Parent

Gets or sets the parent container of the control.

PreferredSize

Gets the size of a rectangular area into vvhich the control can fit. Gets the product name of the asse1ubly containing the control. Gets the version of the assembly contailling tl1e control. Gets a value iI1dicating whether tl1e control is currently re-creating its handle. Gets or sets the wmdow region associated \Vitl1 the control. Obsolete.This property is no\:v obsolete.

Maximo mSize MinimumSize

ProductName ProductVersion

Recreatin gHandle Region Rend.e rRightToLeft

Site

Gets or sets a value indicating \ivhether the control redraws itself \Vhen resized. Gets the distance, in pixels, ben.veen the right edge of the control and the left edge of its container's client area. Gets or sets a value indicating \Vhether control's elements are aligned to support locales using right-toleft fonts. Gets a value that determines the scaling of child controls. Gets a value indicating whether the control shotdd display focus rectangles. Gets a value il1dicating \vhether the user interface is iil the appropriate state to shovv or hide keyboard accelerators. Gets or sets the site of the control.

Size

Gets or sets the height and \Vidth of the control

Tablndex

Gets or sets the tab order of tl1e control within its container. This API s11ppo:rts the product infrastructure and is not intended to be used directly from your code. Gets or sets a value indicating whether the user can give the focus to this control usiI1g the TAB key.

ResizeRedraw

Right

RightToLeft

ScaleChildren

Show FocusCues ShowKeyboard Cues

TabStop

462

I PowerShell Studio -

A Comprehensive Guide

Tag Text TextAlign

TextlmageRelation Top

TopLevelControJ

UseCompatibleTextRendering

UseMnemonic

UseVisualStyleBackColor UseWaitCursor Visible Width Window Target

Gets or sets the object that contains data about the control. Gets or sets the teA't associated vvith this control. This API supports the product infrastn1cture and is not intended to be used directly fron1 your code. Gets or sets the aligrunent of the text 011 the Radi0Butto11 control. (Overrides ButtonBase. Tea1Align.) Gets or sets the position of text and image relative to each other. Gets or sets the distance, in pixels, betvveen the top edge of the control and the top edge of its containe1Js client area. Gets the parent control that is not parented by another Windows Forms control. Typically, tl1is is the outermost Form that the control is contained in. Gets or sets a value tl1at detennin.es whet11er to use the Graphics class (GDI+) or the TextRenderer class (GDD to render teA't. Gets or sets a value indicating ,;vhetl1er the first character that is preceded by ai1 ampersand (& ) is used as the mnemo1ric key of the control. Gets or sets a value that determines if the backgrotmd is drawn using visual styles, iI supported. Gets or sets a value indicating vvhether to use the 'vait cursor for the current control and all child controls. Gets or sets a value indicating vvhetller tl1e control and all its clrild controls are displayed. Gets or sets the widtl1 of t11e co11trol. This API supports the product infrastructure ai1d is not intended to be used directly fron1 your code. TJris property is not relevant for this class.

RICHTEXTBOX PROPERTY

DESCRIPTION

Acce1>tsRetu rn

Actuameight

Gets or sets a value that indicates hovv the teA1 editing control responds ,;v-hen the user presses the ENTER key. Gets or sets a value t11at indicates how the text editing control responds ,;vhen the user presses tl1e TAB key. Gets the rendered height of this element.

ActuaIWidtb

Gets the rendered ,;vidth of tllis elen1ent.

Allo\vDro1>

Gets or sets a value indicating vvhether tlris element can be used as the target of a drag-and-drop operation. Tlris is a dependency property. Gets a value that indicates whether at least one touch is captured to this element.

Accepts Tab

AreAnyTouchesCaptured

PowerShell Studio - Reference Guide AreAnyToucbesCapturedWitbin

AreAnyToucbesDirectlyOver AreAnyToucbesOver

AutoWordSelection

Background

Bin dingGrou11 BitmapEffect

Bitma11Effectln11ut

BorderBrush Bo rderThickness

CacheMode CanRedo CanUndo CaretBrusb CaretPosition Cli11

ClipToBounds

CommandBindings

ContextMenu

I 463

Gets a value that indicates whether at least one touch is captured to this element or to any child elements in its visual tree. Gets a value that indicates whetl1er at least one toucl1 is pressed over this element. Gets a vall1e that indicates whether at least one touch is pressed over this element or any child elements in its visual tree. Gets or sets a value that determines 'vhether when a user selects part of a word by dragging across it with the mouse, the rest of the word is selected. Gets or sets a brush that describes tl1e background of a control. Gets or sets the BindingGroup that is used for the element. Obsolete.Gets or sets a bitmap effect that applies directly to the rendered content for tlus elen1ent. This is a dependency property. Obsolete. Gets or sets an input source for the bitmap effect that applies directly to the rendered content for this element. This is a dependency property. Gets or sets a brusl1 that describes tl1e border backgroru1d of a control. Gets or sets the border thickness of a control. Gets or sets a cached representation of the UIElement. Gets a value that indicates \>vhether the 1nost recent undo action ca11 be redone. Gets a value that indicates whether the most recent action can be tu1done. Gets or sets the bn1sh that is used to paint the caret of tl1e text box. Gets or sets the position of the i11put caret. Gets or sets the geometry used to define the outline of the contents of an ele1nent. This is a dependency property. Gets or sets a value indicating"vhethet to clip the content of this element (or conte11t coining fro111 the child elements of this element) to fit into the size of the containil1g element. This is a dependency property. Gets a collection of CommandBinding objects associated with this element. A Comn1andBinding enables co.mn1and handling for this ele1nent, and declares the linkage bet\veen a comn1and, its events, and the handlers attached ~y this element. Gets OI sets the context 1nenu element that should appear wl1enever tl1e context menu is requested through user interface (Ul) from 'vitllin this element.

464

I PowerShell Studio -

A Comprehensive Guide

ExtentHeight

Gets or sets the cursor tliat displays when the 1nouse pointer is over this element. Gets or sets the data couteA1 for fill ele1nent when it participates in data binding. Gets or sets the key to use to reference tl1e style for this control, when theme styles are used or defined. Gets the DependencyObjectType that wraps the CLR type of this instance. (Inl1erited from DependencyObject.) Gets the size that this elernent computed during the measure pass of the layout process. Gets the Dispatcher this DispatcherObject is associated \¥ith. (Inherited frorn DispatcherObject.) Gets or sets the Flo\vDocument that represents the contents of the RichTeA1Box. Gets or sets the bitmap effect to apply to the UIElement. This is a dependency property. Gets the vertical size of the visible content area.

ExtentWidth

Gets the horizontal size of the visible content area.

Flo,vDirection

FontFamily

Gets or sets the direction tltat text and other user interface (UI) elements flovv \¥ithin filly parent ele1nent that controls their layout. Gets or sets a value ·tiiat indicates whether the ele1nent can receive focus. This is a dependency property. Gets or sets a property that enables customization of appearance, effects or other sty le cbaracteristics tliat \.Vill apply to this eleme11t when it captures keyboard focus. Gets or sets the font family of the control.

FontSize

Gets or sets the font size.

FontStretcb

Gets or sets the degree to which a font is condensed or expanded on tl1e screen. Gets or sets the font sty le.

Cursor Data Context DefaultStyleKey De11endencyObjectType

DesiredSize Dis11atcher Document Effect

Focusable FocusVisualStyle

FontStyle FontWeight ForceCursor

Foreground HandlesScrolling HasAnimatedPro11erties HasEffectiveKevboardFocus ~

Height

Gets or sets the weight or thickness of the specified font. Gets or sets a value that indicates whetl1er this Frame,vorkElement should force tl1e user interface (UI) to render the cttrsor as declared by the Ctrrsor property. Gets or sets a bntsh that describes the foreground color. Gets a value that indicates whether a control supports scrolling. Gets a value indicating whether this eleme11t has any animated properties. Gets a value that indicates whether tl1e UIElement has focus. Gets or sets the suggested height of the ele1nent.

PowerShe ll Stu dio - Refere nce Guide HorizontaWignment

HorizontalContentAlignment HorizontalOffset HorizontalScrollBarVisibility InheritanceBehavior

lnputBindings In1JutSco1Je IsArrangeValid

IsDocumcntEnabled

IsEnabled

lsEnabledCore IsFocused IsHitTestVisible

IslnactiveSelectionHighlightEnabled

lslnitialized

IslnputMethodEnabled

IsKeyboardFocused lsKeyboardFocusWithin

IsLoaded

I 465

Gets or sets the horizontal alignment characteristics applied to this element when it is composed within a parent ele1nent, such as a panel or items control. Gets or sets the horizontal alignment of the control's content. Gets or sets the horizontal scroll position. Gets or sets a value that indicates whether a horizontal scroll bar is shown. Gets or sets the scope Ji n1its for property value inheritance, resource key lookup, ai1d RelativeSource FindAncestor lookup. Gets the collection of input bindiJ1gs associated with this element. Gets or sets t11e context for inp11t used by this Fra1nework.Ele1nent. Gets a value indicating \ V hether the computed size and position of child elements in this el ement~s layout are valid. Gets or sets a value that indicates \ivhether the tlSer can interact \vith UIElement and ContentEle1nent objects within the RichTex1:Box. Gets or sets a value indicating whether this element is enabled in the user interface (Ul ). This is a depende11cy property. Gets a value that becomes the return value of IsEnabled in derived classes. Gets a value that determines vvl1ether this element 11as logical focus. This is a dependency property. Gets or sets a value that declares "vhether this element can possibly be returned as a bit test result from son1e portio11 of its rendered content. This is a dependency property. Gets or sets a value that indicates whether the teA1 box displays selected text when the teA1 box does not have focus. Gets a value tl1at indicates whether this ele1nent has been initialized. either during processing by a XAML processor, or by eArplicitly having its Endlnit method called. Gets a value indicating \Vhether an input method system, such as an Input Metl1od Editor (Th1E), is enabled for processing the input to this element. Gets a valtte iI1dicating whetl1eT this element has keyboard focus. This is a dependency property. Gets a value indicating \¥hether keyboard focus is any\-vl1ere within the ele1nent or its visual tree child eleme11ts. This is a dependency property . Gets a value that indicates whether this element has been loaded for presentation.

466

I PowerShell Studio -

lsManipu lationEuabled IsMeasureValid lsMouseCa1>tu red lsMouseC aptureWithin

IsMouseDirectlyOver

IsMouseOver

IsReadOnly

IsReadOnlyCaretVisible IsSeaJed

IsSelectionActive IsStylusCaptured IsStylusCaptureWithin

IsS tylusDirectlyOver

IsStylusOver •

lsTabStop IsU ndoEnabled IsVisible

Language LayoutTransform

A Comprehensive Guide Gets or sets a value that indicates whet11er 1nanipulation events are enabled on tltis UIElement. Gets a value indicating \.V bether the current size returned by layout measure is valid. Gets a value indicati.I1g whether the mouse is captured to this element. Thls is a dependency property. Gets a value that detennines whether mouse capture is held by this elen1ent or by cltild ele.ments in its visual tree. This is a dependency property . Gets a value that indicates whether the position of the mouse pointer corresponds to hit test resnlts, which take eleinent compositing into account. This is a dependency property. Gets a value indicating \vhether tl1e mouse pointer is located over this ele1nent (including cltild elernents in the visual tree). This is a dependency property. Gets or sets a value that indicates whether the text editing control is read-only to a user interacting with the control. Gets or sets a value that indicates whether a read-only text box displays a caret. Gets a value that indicates whether tltis instance is currently sealed (read-only).(Inberited fro1n DependencyObject.) Gets a value that indicates whether the tex.1 box has focus a11d selected text. Gets a value indicating whether the stylus is captured by this eleme11t. This is a dependency property. Gets a value that detennines whether stylus capture is held by tltis element, or an element \.Vithin the ele1nent bounds and its visual tree. This is a dependency property. Gets a value that indicates \.Vhether ·tI1e stylus position corresponds to hit test results, which take element compositing into account. This is a dependency property. Gets a value indicating \ V hether tl1e stylus ci1rsor is located over tl1is ele111ent (including visual child elements). Thls is a dependency property. Gets or sets a value that ii1dicates whether a control is included in tab navigation. Gets or sets a value that indicates whether undo support is enabled for the tex.1-editing control. Gets a value indicating wl1ether this ele1nent is visible in the user interface (UI). This is a dependency property. Gets or sets localization/globalization language information that applies to an ele1nent. Gets or sets a grapltics transfonnatio11 that should apply to tltis element when layout is perfonned.

PowerShell Studio - Reference Guide LogicalChildren

Margin

I 467

Gets an enumerator that can iterate the logical children of the RichTextBox.(Overrides FraineworkElement.LogicalChildren.) Gets or sets the outer margin of an element.

Padding

Gets or sets the maxin1um height constraint of the ele111ent. Gets or sets the n1aximum widtl1 constraint of the element. Gets or sets the ntinimu1n height constraint of the element. Gets or sets the minim1un width constraint of the element. Gets or sets the identifying name of the ele1nent. The name provides a reference so that code-behind, such as event handler code, can refer to a markup element after it is constructed during processing by a XA1v1L processor. Gets or sets tl1e opacity factor applied to the entire UIElement when it is rendered in the user interface (UI). This is a dependency property. Gets or sets an opacity mask, as a Bn1sh implementation that is applied to any alpha-channel masking for the rendered content of tltis ele1nent. Tltis is a dependency property. Gets or sets a value that indicates whether tltis element incorporates sty le properties from tlleme styles. Gets or sets the padding inside a control.

Parent

Gets the logical parent element of this element.

Persistld

Obsolete.Gets a value that uniquely identifies this element. Gets (or sets, but see Remarks) the final render size of this element. Gets or sets transform infor1113tion that affects the renderi11g positio11 of this ele1nent. This is a dependency property. Gets or sets tlle center point of any possible render transfonn declared by RenderTransform, relative to the bounds of the element. This is a dependency property. Gets or sets tlle locally-defined resource dictionary.

Max.Height MaxWidth MinHeight

MinWidth Name

Opacity

OpacityMask

OverriclesDefaultStyle

RenderSize RenderTransform

Ren.d erTransformOrigin

Resources

SelectionBrush

Gets a TextSelectionobject containing the current selection in the RichTe:\1:Box. Gets or sets the bn1sh that highlights selected text.

Selection Opacity

Gets or sets the opacity of the SelectionBn1sh.

SnapsToDevicePixels

Gets or sets a value that detem1ines whether rendering for this element should use device-specific _Q_ixel

Selection

468

I PowerShell Studio -

StlellCheck

Style StylusPluglns Tablndex

Tag Tem11late TemplatedParent

ToolTiJl TouchesCaptured TouchesCapturedWithin TouchesD irectlyOver ToucbesOver Triggers Uid Undo Limit UseLayoutRounding

VerticalA.Lignmeot

VerticalContentAlignment VerticalOffset

A Comprehensive Guide settings during rendering. This is a dependency property. Gets a SpellCheck object that provides access to spelling errors in the text contents of a TextBoxBase or RichTextBox. Gets or sets the sty le used by this eleme11t when it is rendered. Gets a collection of all stylus plug-in (customization) objects associated with this element. Gets or sets a value that determines the order in \¥hich elements receive focus when the user navigates through controls by using the TAB key. Gets or sets fill arbitrary object value that can be used to store custom information about this element. Gets or sets a control te1nplate. Gets a reference to the template parent of tltis element. This property is not relevant if the element was not created through a template. Gets or sets the tool-tip object that is displayed for this ele1nent in the user inte1f ace (UI). Gets all touch devices that are captured to tltis ele1nent. Gets all touch devices that are capll1red to this eleme.nt or any child elen1ents in its visual tree. Gets all touch devices that are over this element. Gets all touch devices that are over this element or any child elements in its visual tree. Gets the collection of triggers established directly on this ele1nent, or in child ele1nen.ts. Gets or sets the unique identifier (for localization) for this ele1nent. This is a dependency property. Gets or sets the number of actions stored in tl1e undo queue. Gets or sets a value that indicates whether layout rounding should be applied to tltis ele1nent's size and position during layout. Gets or sets the vertical alignment characteristics applied to tltis element when it is composed witlti11 a parent elen1ent such as a panel or items control. Gets or sets the vertical alignment of the control's content. Gets or sets the vertical scroll position.

ViewportHeight

Gets or sets a value that indicates \Vhether a vertical scroll bar is shown. Gets the vertical size of the scrollable content area.

ViewportWidtb

Gets the horizontal size of the scrollable content area.

Visibility

Gets or sets the user interface (UI) visibility of this element. Tltis is a dependency property.

Ve11icalScroUBarVisibility

PowerShell Studio - Reference Guide VisualBitmapEffect VisualBi.tmapEffectlnput Visu alBitm apScalin gMode VisualCacbeMode VisualChiJdrenCount Visu alCiearTypeHint Visual Clip VisualEdgeMode VisualEffect VisualOffset VisualOpacity Visu alOpacity Masi< VisualParent VisualScroHableAreaClip VisualTextBintingMode VisualTextRenderingMocle VisualTransform VisualXSnappingGuidelines VisualYSnappingGuidelines Width

I 469

Obsolete.Gets or sets the BitmapEffect value for tl1e Visual. Obsolete. Gets or sets tl1e BitmapEffecth1put value for the Visual. Gets or sets the BitmapScalingMode for tl1e Visual. Gets or sets a cached representation of the Visual. Gets the number of visual cllild ele1uents \Vitllin this element. Gets or sets the ClearTypeHint that determines how ClearType is rendered in the Visual. Gets or sets the clip region of the Visual as a Geon1etry value. Gets or sets the edge mode of the Visual as an EdgeMode value. Gets or sets the bitmap effect to apply to the Visual. Gets or sets the offset value of the visual object. Gets or sets the opacity of the Visual. Gets or sets the Bn1sh value that represents the opacity mask of the Visual. Gets the visual tree parent of the visual object. Gets or sets a clipped scrollable area for the Visual. Gets or sets tl1e TextHiI1tingMode of the Visual. Gets or sets the TextRenderingMode of the Visual. Gets or sets the Transfo1m value for the Visual. Gets or sets the x-coordinate (vertical) guideline collection. Gets or sets they-coordinate (l101izontal) guideline collection. Gets or sets the width of the element.

SAVEDDIALOG PROPERTY

DESCRIPTION

AddExtension

Gets or sets a value indicating \Vhether the dialog box automatically adds an extension to a file name if the user omits the extension. Gets or sets a value indicating ,;vhether this FileDialog instance sl1ould automatically t1pgrade appearance and behavior when nu1ning on Windo\VS Vista. Gets or sets a value indicating whether the dialog box displays a wan1ing if the user specifies a file name that does not exist. Gets or sets a value indicating whetl1er the dialog box displays a "varni11g if the user specifies a path that does not exist.

Auto U1>gradeEnabled

CbeekFileExists

CheckP atbExists

470

I PowerShell St udio -

A Comprehensive Guide

Container

Gets the IC011tainer that contains the Component.

CreateProm1>t

Gets or sets a value indicatil1g whether the dialog box prompts the user for permission to create a file if the user specifies a file that does not eA.ist. Gets the custon1places collection for this FileDialog instance. Gets or sets the default file name e>..rtension.

CustomPlaces DefaultExt DereferenceLinks

FileName FileNames Filter

FilterIndex InitialDirectory OverwritePrompt

RestoreD i rectory

Sho,vHelp Site SupportMultiDottedExtensions

Tag Title ValiclateN am es

Gets or sets a value indicating "vhether the dialog box returns the location of the file referenced by the shortct1t or ,;vhether it returns the location of the shortcut (.lnk:) . Gets or sets a string containing the file name selected in the file dialog box. Gets the file names of all selected files in the dialog box. Gets or sets the current file name filter string, which detemlines the choices that appear in the "Save as file type" or "Files of type" box in the dialog box. Gets or sets the index of the filter curre11tly selected in the file dialog box. Gets or sets the initial directory displayed by the file dialog box. Gets or sets a value indicating whether the Save As dialog box displays a warning if the user specifies a file name that already exists. Gets or sets a value i11dicating whether the dialog box restores the directory to tl1e previously selected directory before closing. Gets or sets a value indicating \Vhether the Help button is displayed in the file dialog box. Gets or sets the !Site of the Component. Gets or sets whether the dialog box supports displaying and saving files that have multiple file name extensions. Gets or sets an object that contains data about tl1e control. (Inherited from CommonDialog.) Gets or sets the file dialog box title. Gets or sets a value indicating ,;vhether tl1e dialog box accepts only valid Win32 file names.

SPLITCONTAINER PROPERTY

DESCRIPTION

AccessibilityObject

Gets the AccessibleObject assigned to the control.

AccessibleDefaultActionDescription

Gets or sets the default action description of the control for use by accessibility clie11t applications.

PowerShell Studio - Reference Guide AccessibleDescription AccessibleName AccessibleRole ActiveControl Allow Drop Anchor

AutoScaleDimensions AutoScaleFactor AutoScaleMode Auto Scroll

AutoScrollMargin

AutoScroUMinSize

AutoScrolJOffset

AutoScrollPosition

Auto Size

AutoValidate

I 471

Gets or sets the description of the control used by accessibility client applications. Gets or sets the nan1e of the co11troJ used by accessibility client applications. Gets or sets the accessible role of tl1e control Gets or sets the active control on the container control. Gets or sets a value indicating 'vhether the control can accept data that the user drags onto it. Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent. Gets or sets the diJ.nensions that tl1e control was designed to. Gets the scaling factor between the current and design-ti1ne automatic scaling di1nensions. Gets or sets the automatic scaling mode of the control. This API supports the product infrastructure a11d is not intended to be used directly fron1 yotu code. When overridden in a de1ived class, gets or sets a value indicating whether scroll bars automatically appear if co11trols are placed outside the SplitContainer client area. Tllis property is not relevant to this class. (Overrides Scrollab leControl. Auto Scroll.) Tllis API supports the product infrastructure and is not intended to be used directly from yotrr code. Gets or sets tl1e size of the auto-scroll margin. Tllis property is not relevant to this class. This property is not relevant to tllis class. This API supports the prodttct infrastruchue and is uot intended to be used directly fron1 yotu code. Gets or sets the minimum size of the scroll bar. This property is not relevant to tllis class. This API supports the prod11ct infrastrucnue and is not intended to be llSed directly from your code. This property is not relevant to this class. (Overrides Control.Auto ScrollOffset.) This API supports the product infrastructure and is not intended to be used directly from your code. This property is not relevant to tllis class. This API supports the product infrastructure and is not intended to be l1sed directly fro1n your code. Gets or sets a value indicating whether tlte SplitContainer is automatically resized to display its entire co11tents. This property is not relevant to this class. (Ovenides Control.Auto Size.) Gets or sets a value that indicates '"''hether controls in this container will be auto1natically validated when the focus clmnges.

472

I PowerShell Studio -

BackColor Bacl{g1·oundlmage Backgrou ndlmageLayout

BindingContext

BorderStvle • Bottom

Bounds

CanEnablelme

CanFocus CanRaiseEvents CanSelect Ca1>turc CausesValidation

ClientRectangle ClientSize CompanyName Container ContainsFocus ContextMenu ContextMenuStrip Controls

Created

A Comprehensive Guide Gets or sets the backgrotmd color for the control. Gets or sets the background in1age displayed in the control. (Overrides Control.Ba.ckgroundlmage.) This APT supports the product infrastn1ct11re and is not intended to be used directly fTom your code. This property is not relevru1t to this c1ass.(Overrides Control.BackgroundimageLayot1t.) Gets or sets t11e BindingContext for the SplitContainer. (Overrides ContainerContro LB indingConteA.1.) Gets or sets the style of border for the SplitContai11er. Gets the distance, in pixels, benveen the bottom edge of the control and the top edge of its container's client area. Gets or sets the size and location of the control including its nonclient elements, in pixels, relative to the parent control. Gets a value indicating "vhether the In1eMode property can be set to an active value. to enable IME support. Gets a value indicating whether the control can receive focus . Detenni nes if events can be raised on the control. Gets a value indicating whether the control can be selected. Gets or sets a value indicating whether the control has captured the nlouse. Gets or sets a value indicating \vhether the control causes validation to be perfon11ed on ru1y controls that require validation when it receives focus . Gets the rectangle that represents tl1e client area of tl1e control. Gets or sets the height and "vidth of tl1e client area of the control. Gets the nan1e of the company or creator of the application containing the control. Gets the IContai11er that contains the Compo11ent. Gets a value indicating \vhether the control, or one of its child controls, currently lias the input focus. Gets or sets the shortcut menu associated with the control. Gets or sets the Co11teA.'tMenuShip associated vvith this control. This API supports the product infrastructure and is not intended to be used directly from your code. Gets a collection of child controls. This property is not relevant to this class. Gets a value indicating \Vhether the control bas been created.

PowerShe ll Studio - Referen ce Guide CreateParams CurrentAutoScaleDimensions

I 473

Gets the required creation parameters when the control handle is created. Gets the current t1m-tilne din1e11sions of the scree11.

DataBindings

Gets or sets the cursor that is displayed when the mouse pointer is over the conwol. Gets the data bindings for the control

DefaultCursor

Gets or sets the default ctrrsor for tl1e co11trol.

DefaultlmeMode

FontHeight

Gets the default Input Method Editor (IME) mode supported by the control. Gets the space, in pixels, tl1at is specified by default between.controls. Gets the length and 11eight, in pixels, that is specified as the default inaximum size of a control. Gets the length and height, in pixels, that is specified as the default minim1un size of a control. Gets the internal spacing, in pixels of the contents of a control. Gets the default size of the SplitContainer.(Overrides Control.DefaultSize.) Gets a value that indicates whether the Con1pone11t is currently in design mode. Gets the rectangle tliat represents the virtual display area of tl1e control. Gets a value indicating \Vhether the base Control class is in the process of disposing. Gets or sets \Vhich SplitContainer borders are attached to tl1e edges of the container. Gets the dock padding settings for all edges of the control. Gets or sets a value indicating whether this control should 1·edraw its surface using a secondary buffer to reduce or prevent flicker. Gets or sets a value indicating whether tl1e control can respond to user interaction. Gets the list of event handlers that are attached to this Component. Gets or sets \¥lticl1 SplitContainer panel remains the same size when the container is resized. Gets a value indicating \Vhether the control has input focus. Gets or sets the font of tl1e text displayed by tl1e control. Gets or sets the height of the font of the control.

ForeColor

Gets oI sets the foi eground color of tl1e control.

Handle

Gets tbe window liandle fuat the control is bound to.

Has Children

Gets a value indicating \¥hether tbe control co11tains one or more child controls. Gets or sets the height of the control.

Cursor

DefaultMargin DefaultMaximumSize Defau ltMinimumSize DefaultPadding DefaultSize DesignMode DisplayRectangle Disposing Dock DockPadding DoubleBuffered

Enabled Events FixedPanel Focused Font

Height

474

I PowerShell Studio -

HorizontalScroll HScroll lmeMode

lmeModeBase Invo keRequi red

IsAccessible lsDisposed IsHandleCreated lsMirrored

IsS p litterFL\':ed LayoutEngine Left

Location

Marg.in MaximumSize Minimum Size

Name Orientation Padding

Panell Pan ellColla1lsed

PanellMinSize Panel2

A Comprehensive Guide Gets the characteristics associated \ivith the horizontal scroll bar. Gets or sets a value indicating whether tl1e horizontal scroll bar is visible. Gets or sets the Input Method Editor (IME) mode of the control. Gets or sets the IME mode of a control. Gets a value indicating \¥hether the caller n1ust call an invoke method when making metl1od calls to tl1e control because the caller is on a different thread than the one the co11trol was created on. Gets or sets a value indicati11g \:Vhether the control is visible to accessibility applications. Gets a value indicating \¥hetber the control has been disposed of. Gets a value :indicating whether the control bas a 11andle associated with it. Gets a value indicating whetl1er the control is mirrored. Gets or sets a value indicating whether the splitter is fixed or movable. Gets a cached instance of the control's layout engine. Gets or sets the distance, ir1 pixels, between tl1e left edge of the control and the left edge of its container's client area. Gets or sets the coordinates of the upper-left comer of tl1e control relative to the upper-left corner of its container. Gets or sets the space ben.veen controls. Gets or sets the size that is tl1e upper limit that GetPreferredSize can specify. Gets or sets the size that is tl1e lower limit that GetPreferredSize can specify. Gets or sets the nan1e of tl1e contTol. Gets or sets a value indicating the horizontal or vertical orie11tation of the SplitContainer pai1els. This API supports the product infrastn1cture and is not intended to be used directly from your code. Gets or sets the interior spacing, in pixels, bet\lveen the edges of a Splitte1Pai1el and its contents. This property is not relevant to this class. Gets the left or top panel of the SplitContainer, depending on Orientation. Gets or sets a value determining \¥hether Panell is collapsed or expanded. Gets or sets the milri1ntun distance in pixels of the splitter from the left or t~p edge of Panel 1. Gets the rigl1t or bottom pa11el of the SplitContainer, depending on Orientation.

PowerShell Studio - Reference Guide Panel2CoUapsed Panel2Mi.n Size Parent ParentForm Preferred Size ProcluctName ProductVersion Recreatin gBandJe Region RenderRightToLeft ResizeRedra'v Right

RightToLeft

ScaleChildren Show FocusCues Sho'v Kevboarcl Cues • Site Size SplitterDistance SplitterIncrement SplitterRectangle SplitterWidth Tab Index TabStop Tag

I 475

Gets or sets a value determining,vhether Panel2 is collapsed or expanded. Gets or sets the min.imu1n distance in pixels of the splitter fron1 the right or bottom edge of Panel2. Gets or sets the parent container of the co11trol. Gets the form that the container control is assigned to. Gets the size of a rectangular area into \.vh.ich the control can fit. Gets the product nan1e of the asse1nbly containing tl1e control. Gets the version of the assembly containing the control. Gets a value indicating whether tl1e control is currently re-creating its handle. Gets or sets the \vindo\v region associated witl1 the control. Obsolete.This property is now obsolete. Gets or sets a value indicating \Vhether the control redraws itself when resized. Gets the distance, in pixels, benveen the right edge of the control and the left edge of its container's client area. Gets or sets a value indicating whether control's elements are aligned to support locales using rigbt-toleft fonts. Gets a value that determines the scaling of child controls. Gets a value indicating \¥l1ether the control should display focus rectangles. Gets a value i11dicating vvhether the user interface is in the appropriate state to show or hide keyboard accelerators. Gets or sets the site of the control. Gets or sets the height and widtl1 of the control. Gets or sets the locatio11 of the splitter in pixels, from the left or top edge of the SplitContainer. Gets or sets a value representing the increment of splitter move1nent in pixels. Gets the size and location of tl1e splitter relative to the SplitContainer. Gets or sets the width of the splitter in pixels. Gets or sets the tab order of tl1e control within its container. Gets or sets a value indicating whether the user can give the focus to the splitter using the TAB key. Gets or sets the object that contains data about the control.

476

I PowerShell Studio -

A Comprehensive Guide

Text

Top

TopLevelControl

UseWaitCursor VerticalScroll Visible VScroll Width Windo\vTarget

This API supports the product infrastructure and is not intended to be used directly from yom code. This property is not relevant to this class .(Overrides Control. TeJrt.) Gets or sets the distance, in pixels, bet\veen the top edge of the control and the top edge of its contaiI1er's client area. Gets the pare11t control that is not parented by another Windo\vs Forms control. Typically, this is the outennost Form that tl1e control is contained in. Gets or sets a value indicating whether to use the ' vait cursor for the current control and all child controls. Gets the characteristics associated vt7ith the vertical scroll bar. Gets or sets a value iI1dicating ' vhether the control and all its child controls are displayed. Gets or sets a value indicating whether tl1e ve11ical scroll bar is visible. Gets or sets the width of the control. This API supports the product infrastn1ct1rre and is not intended to be used directly from your code. This property is not relevant for this class.

SPLITTER PROPERTY AccessibilityObject

DESCRIPTION Gets the AccessibleObject assigned to tl1e control.

AccessibleDefaultActionDescription

Gets or sets the default action description of t11e control for use by accessibility client applications. Gets or sets file description of tlle control used by accessibility client applications. Gets or sets the na1ne of the control used by accessibility client applications. Gets or sets the accessible role of the control

AccessibleDescri1ltion AccessibleName .t\ccessible~o1e

AllowDrop

Anchor

AutoScrollOffset Auto Size

This API supports the product infrastructme and is not I intended to be used directly fro1n your code. This property is not relevant to this class .(Overrides Control.AllowDrop.) This API supports the product infrastn1ct1ue and is not intended to be used directly from your code. This property is not relevant to this class.(Overrides Control. Anchor.) Gets or sets where this control is scrolled to in ScrollControllntoView. This API supports the product infrastn1cture and is not intended to be used directly frotn your code. This property is not relevant for this class.

PowerShell Studio - Reference Guide

I 477

BackColor

Gets or sets tl1e background color for the control.

Backgrouncllmage

This API supports the product infrastructure and is not iJ1tended to be used directly from your code. This property is not relevant to this class. (Overrides Control.Backgroundlmage.) This API supports the product infrastructure and is not intended to be used directly fro1n yolu code. This property is not relevant to this class. (Ovenides Control.Backgrow1dlmageLayout.) Gets or sets the BindingConte:\.1: for the control.

Backgroundlm ageLayout

Bin dingContext BorderStyle •

Bottom

Bounds

CanEnablelme

CanFocus C anRaiseEvents CanSelect CaJlture CausesValidation

ClientRectan gle ClientSize CompanyName Container ContainsFocus ContextMenu ContextMenuStrip Cont.-ols

Gets or sets the sty le of border for the contro1. Splitter.BorderStyle has been replaced by SplitC011tainer.BorderStyle and is provided only for compatibility with previous versions. Gets the distance, in pixels, benveen the bottom edge of tl1e control and the top edge of its container's client area. Gets or sets the size and location of the control i11cluding its nonclient elen1ents, in pi'V hether the co11trol, or 011e of its child controls, currently has the input focus. Gets or sets the shortcut menu associated with the control. Gets or sets the ContextMenuStrip associated with this control. This API supports the product infrastructure and is not intended to be used directly from your code. This property is not relevant for tlris class. Gets a value indicating whether the co11trol has been created.

490

I PowerShell Studio -

A Comprehensive Guide

DataBindings

Gets the required creation para1neters when the control handle is created. Gets or sets the cursor that is displayed when the mouse pointer is over the ToolSttip. Gets the data bindings for tl1e control.

DefaultCursor

Gets or sets the default cursor for the control.

DefaultDock

Gets wh.ich borders of tl1e Stanis Strip are docked to the Too1St1ipContainer. (Overrides ToolStrip.DefaultDock.) Gets or sets a value representing the default direction in which a ToolStripDropDo,;vn control is displayed relative to tl1e ToolStrip. Gets the default spacing, in pixels, bet1veen the sizing grip and the edges of the ToolStrip. Gets the default Input Metl1od Editor (IJ\.1E) 1uode supported by tl1e control. Gets the spacing, in pixels. between the ToolStiip and the ToolStripContainer. Gets the length and height, il1 pixels, that is specified as the default maximum size of a control. Gets the length and height, in pixels, that is specified as the default minin1un1 size of a control. Gets the spaciI1g, in pixels, benvee:rn the left, right, top, and bottom edges of the Status Strip from the edges of the fonn.(Overrides ToolStrip.DefaultPadding.) Gets a value indicating ' vhether ToolTips are shown for tl1e Stah1sStlip by default.(Overrides ToolStrip.DefaultShowltemToolTips.) Gets the size, in pixels, of the StatusStrip when it is first created.(Overrides ToolStrip.DefaltltSize.) Gets a value that indicates vvhether tl1e Component is currently in design mode. Gets the subset of items that are currently displayed on the ToolStrip, including items that are automatically added into the ToolStrip. This API supports the product infrastructure and is not intended to be used directly fro1n your code. Retrieves the cu1Tent display rectangle. Gets a value indicating vvhether the base Control class is in the process of disposing. Gets or sets which StatusStrip borders are docked to its parent control and determines how a StatusSttip is resized with its parent.(Ovenides ToolStrip.Dock.) Gets the dock padding settings for all edges of the control. Gets or sets a value indicating whetl1er this control should redraw its surface using a secondary buffer to reduce or prevent flicker. Gets or sets a value indicating whether the control can respond to user interaction.

CreateParams Cursor

DefaultDropDownDirection

DefaultGripMargin DefaultlmeMode DefaultMargin Def aultMaximumSize DefaultMinimumSize DefaultPadding

DefaultShowItem ToolTips

Defau ItSize Design Mode Displayedltems

Dis11IayRectangle

Disposing

DockPadding DoubleBuffered

Enabled

PowerShell Studio - Reference Guide

I 491

Font

Gets the list of event handlers that are attached to this Component. Gets a val11e indicati11g whether the co11trol has input focus. Gets or sets the font used to display text il1 tl1e co11trol.

FontHeight

Gets or sets the heigl1t of the font of the control.

ForeColor

Gets or sets t11e foreground color of tl1e ToolStrip.

Gri1>Dis11JayStyle

Gets the orientation of the ToolStrip move handle.

GripMargin

Gets or sets the space around the ToolStrip 111ove J1andle. Gets the boundaries of the ToolStrip move hru1dle.

Events Focused

GripRectangle GripStyle Handle Has Children

Height HorizontaJScroll

HScroll ImageList lmageScalingSize ImeMode ImeModeBase InvokeRequired

IsAccessible Is CurrentlyDragging

IsDisposed

IsHandleC reated lsMirrored

Gets or sets the visibility of tl1e grip used to reposition the control. Gets the \;vindow handle that the control is bound to. This API supports the product infrastructure ru1d is not intended to be used directly fro1n your code. This property is not relevant for this class. Gets or sets the heigl1t of the co11tro1. Tllis API suppo1ts tl1e product infrastructure and is not intended to be used directly fron1 your code. This property is not relevant for tllis class. Gets or sets a value indicating whether the horizontal scroll bar is visible. Gets or sets the in1age list that contains the ilnage displayed on a ToolStrip item. Gets or sets tl1e size, in pixels, of ai1 image used on a ToolStrip. Gets or sets the Input Method Editor (IME) n1ode of the control. Gets or sets the IME mode of a control. Gets a value indicati11g ,;v hethe-r the caller n1ust call an invoke inethod when 1naking method calls to the control because the caller is on a different thread than tl1e one the control vvas created on. Gets or sets a value indicating whether the control is visible to accessibility applications. Gets a value indicating \\i hether the user is currently 1noving tl1e ToolStiip from. one ToolStripContainer to another. Gets a value indicating ,;vhether the control has been disposed of. Gets a value indicating 'vhetlter a ToolStrip is a ToolStripDropDown control. Gets a value indicati11g \¥hether the co11trol has a haildle associated with it. Gets a value indicating whether the control is mirrored.

492

I PowerShell Studio -

A Comprehensive Guide

Items

Gets all the items that belong to a ToolStrip.

LayoutEogine

Passes a reference to the cached LayoutEngine returned by the layout engine interface. Gets or sets layout schen1e characteristics.

LayoutSettin gs LayoutStyle Left

Location

Margin

Gets or sets a value indicating how the StatusStrip lays out the items collection. Gets or sets the distance, i11pixels, bet,veen the left edge of the control and the left edge of its container's client area. Gets or sets the coordinates of the upper-left corner of tl1e control relative to tl1e upper-left con1er of its container. Gets or sets the space bet\;veen controls.

Name

Gets or sets the size that is the upper li1nit that GetPreferredSize can specify. Gets the n1axiiuum 11eight and \vidtli, in pixels, of the ToolStrip. Gets or sets the size tl1at is tl1e lower limit Uiat GetPreferredSize can specify. Gets or sets the na1ne of tl1e control.

Orientation

Gets the orientation of the ToolStripPanel.

Overflo'vButton

Gets the ToolStripltem tlIBt is the overflow button for a ToolStrip vvith overflow enabled. This API supports the product iufrastn1cture and is not intended to be used directly fro111 your code. This property is not relevant for this class. Gets or sets the parent container of tbe control.

Ma.runumSize MaxltemSize MinimumSize

Padding

Parent PreferredSize ProductN ame ProductVersion RecreatingHancUe Region Renderer RenderMode Rende1·RightT0Left ResizeRedraw Right

Gets the size of a rectangular area into "'.hich the control can fit. Gets the product name of the assembly co11taining the control. Gets the version of the assen1bly containing the control. Gets a value indicating ,vhether the control is currently re-creating its handle. Gets or sets the 'vindow region associated with the control. Gets or sets a ToolStripRenderer used to customize the look and feel of a Too1Strip. Gets or sets a value that indicates which visual styles 'vill be applied to tl1e ToolStrip. Obsolete.This property is novv obsolete. Gets or sets a value indicating whether the control redra,;vs itself when resized. Gets the distance, in pixels, beween the rigl1t edge of the control and the left edge of its container's client area.

PowerShell Studio - Reference Guide

I 493

Site

Gets or sets a value indicating whether control's elements are aligned to support locales using 1igl1t-toleft fonts . Gets a value that detennines the scaling of child controls. Gets a value indicating whether the co11trol should display focus rectangles. Gets or sets a value indicating whether ToolTips are shown for the StatusStrip. Gets a value indicating whether the ltser interface is in tl1e appropriate state to show or hide keyboard accelerators. Gets or sets the site of the control.

Size

Gets or sets the height and ':vidtb of the control.

SizeGripBouncls

Gets the boundaries of the sizing handle (grip) for a Status Strip. Gets or sets a value indicating \Vhether a sizing handle (grip) is displayed in the lo,ver-right comer of the control. Gets or sets a vall1e indicating whether the StatusStrip stretches from end to end in its container. Gets or sets the tab order of the control within its container. Gets or sets a value indicating whetl1er the user can give the focus to an ite1n in the ToolStrip using the TAB key. Gets or sets tl1e object that contains data about the control. Gets or sets the text associated v1ith this control.

RightToLeft

ScaleChildren ShowFocusCues ShowItemToolTi11s ShowKeyboard Cues

SizingGrip

Stretch Tabindex TabStop

Tag Text TextDirection Top

To11LevelControl

UseWaitCursor VerticalScroU

Visible VScroll Width

Gets or sets the direction in which to dravv text on a ToolStrip. Gets or sets tl1e distance, in pixels, between fue top edge of the control and the top edge of its co11tainer's client area. Gets the parent control that is not parented by another Windows Fonns control. Typically, tlris is the outermost Forn.1 tliat the control is contained in. Gets or sets a value indicating whether to use the "''ait cursor for the current control ailJ.d all child controls. This API supports the product infrastructtue and is not intended to be used directly fron1 yo1u code. Tlris property is not relevant for this class. Gets or sets a value indicating whether the control and all its child co11trols are displayed. Gets or sets a value indicating whether the vertical scroll bar is visible. Gets or sets the width of the control.

494

I PowerShell Studio -

A Comprehensive Guide

Window Target

This API supports the product infrastn1cture and is not intended to be llSed directly from your code. This property is not relevant for this class.

TABCONTROL PROPERTY

Accessib.ilityObject AccessibleDefaultActionDescription AccessibleDescri1>tion AccessibleN a.me AccessibleRole Alignment

Anchor

AJ>pearance AutoScrollOffset Auto Size

BackCo.l or

Backgroundlmage

BackgroundlmageLayout

Bin dingContext Bottom

Bounds

DESCRIPTION Gets the AccessibleObject assigned to the control. Gets or sets the default action description of the control for use by accessibility client applications. Gets or sets the description of the control used by accessibility client applications. Gets or sets the name of the control used by accessibility client applications. Gets or sets the accessible role of the control Gets or sets the area of the control (for example, along the top) where the tabs are aligned. Gets or sets a value indicating vvhether the control can accept data that tbe user drags onto it. Gets or sets the edges of tl1e container to vvbich a control is bou11d and detennines how a control is resized '.vith its parent. Gets or sets the visual appearance of tl1e co11trol's tabs. Gets or sets where this control is scrolled to il1 ScrollControllntoView. This API supports the product hlfrastn1ctlrre and is not intended to be used directly fro1n your code. This property is not relevai1t for this class. This API supports tl1e product infrastructure and is not intended to be used directly from your code. This n1ember is not n1eaitingful for this control.(Overrides Control.BackColo r. ) This API supports the product infrastructure and is not intended to be used directly from your code. This n1ember is not n1eailli1gful for this control.(Overrides Co11trol.Backgroundl1nage.) This API supports the product infrastn1cture and is not intended to be used directly fro1n your code. Tlris n1e1nber is not meairingful for this control.(Overrides Contro l.BackgroundimageLayout.) Gets or sets the BindingContext for the control. Gets the distance, in pixels, between tl1e botto1n edge of the control ai1d the top edge of its container's client area. Gets or sets the size and location of the control including its nonclient elements, in pixels relative to the parent control.

PowerShell Studio - Reference Guide CanEnablelme

CanFocus CanRaiseEvents CanSelect Capture CausesValidation ClientRectan gle ClientSize Com1>anyName Container ContainsFocus ContextMenu ContextMenuStrip Controls Created CreateParams

Cursor DataBindings DefaultCu rsor DefaultlmeMode Defau ltMargin DefaultMaximumSize DefaultMinimumSize DefaultPadding

I 495

Gets a value indicating whether the I1neMode property can be set to an active value, to enable IME suppo11. Gets a value indicati.I1g ,;vhether the co11trol can receive focus. Detenni nes if events can be raised on the control. Gets a value indicating 'vhethe[ the control can be selected. Gets or sets a value indicating whether the control has captured the 1nouse. Gets or sets a value indicating whether the control causes validation to be perfonued on any controls that require validatio11 wl1en it receives focus . Gets the rectangle tl1at represents the cbent area of the control. Gets or sets the height and \Vidth of the client area of the control. Gets the name of tl1e company or creator of the application containing tl1e control. Gets the IContainer that contains the Component. Gets a value indicati.I1g 'vbether the control, or one of its child controls, currently has the input focus. Gets or sets the shortcut n1enu associated with the control. Gets or sets the ConteA1MenuStrip associated with this control. Gets the collection of controls contained within the control. Gets a value indicating \Vhether the co11trol has been created. This API s11pports the product infrastruchue and is not intended to be used directly from your code. This member overrides Control. CreateParams. (Overrides Control. CreateParams.) Gets or sets tlle cursor that is displayed when the mouse pointer is over tlle control. Gets the data bindings for the control. Gets or sets the defattlt c1usor for the control. Gets the default Input Method Editor (lME) mode Sltpported by tlle control. Gets the space, in pixels, that is specified by default between controls. Gets the length and height, in pi..,.els, that is specified as tlle default maxin1um size of a control. Gets the length and height, iI1 pixels, that is specified as tlle defattlt mini1n11m size of a control. Gets the internal spacing. in pixels. of the contents of a control.

496

I PowerShell Studio -

DefaultSize DesignModc Dis11I ay Rectangle Dis11osing Dock

DoubleBuffered

DrawMode Enabled Events Focused Font FontHeight ForeColor

Handle Has Children Height HotTrack

ImageList ImeMode ImeModeBase Invol Anchor

Auto Scroll

AutoScrollMargin AutoScrolJMinSize AutoScrollOffset AutoScrollPosition AutoSize AutoSizeMode BackColor Backgrouncllmage Backgrou ndlm.ageLayou t BindingCootext BorderStyle Bottom

Bounds

CanEnablelme

CanFocus CanRaiseEvents CanSelect Capture

I 499

Gets or sets the default action description of tl1e control for ltse by accessibility client ap_plications. Gets or sets the description of the control used by accessibility client a£plications. Gets or sets tl1e nan1e of th.e co11trol used by accessibility client applications. Gets or sets the accessible role of the control Gets or sets a value indicating 'vhether the control can accept data that the user drags onto it. Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent. Gets or sets a value indicating whether the contait1er enables the user to scroll to any controls placed outside of its visible boundai-ies. Gets or sets the size of the auto-scroll margin. Gets or sets tJ1e miniJnmn size of the auto-scroll. Gets or sets \¥here this control is scrolled to in ScrollC011trollntoVie\.v. Gets or sets the location of tl1e auto-scroll position. Gets or sets a value that illdicates \Vhether the control resizes based on its contents.(Inherited fro1n Panel) Indicates the automatic sizing bel1avior of the control.(Inherited fro1n Panel.) Gets or sets the background color for the control. Gets or sets the background in1age displayed in the control. Gets or sets the background i1nage layout as defined in the ImageLayout enumeration. Gets or sets fue BindingContext for the control. Gets or sets the border style for the panel. Gets the distance. in pixels, between the botto1n edge of the control and tl1e top edge of its container's client area. Gets or sets fue size and location of the control including its nonclient elements, in pixels, relative to the parent control. Gets a valt1e indicating whether the I1neM.ode property can be set to an active value, to enable IME suppo1t. Gets a value indicating whether tl1e co11trol cai1 receive focus. Determines if events can be raised on the control. Gets a value indicating \:Vhether the control cai1 be selected. Gets or sets a value indicating whether the control has captured the mouse.

500

I PowerShell Studio -

CausesValidation

CellBo rderStyle ~

ClientRectangle ClientSize Column Count ColumnStyles CompanyName Container ContainsFocus ContextMenu ContextMenuStrip Controls Created CreateParams Cursor D ataBin din gs

Defau ltCursor Defau ltlmeMode DefaultMargin DefaultMaximumSize DefaultMinimumSize DefaultPadding DefaultSize DesignMode Dis1>layRectangle Disposing

A Comprehensive Guide Gets or sets a value indicating whetl1er the control causes validation to be perlonned on any controls that require validation when it receives focus . Gets or sets the style of the cell borders. Gets the rectangle that represents tl1e client area of the control. Gets or sets the height and width of the clie11t area of the control. Gets or sets the number of columns in the table. Gets a collection of coltunn styles for the TableLayoutPanel. Gets the naine of the company or creator of the application containing the control. Gets the !Container that contains the Component. Gets a value indicating vv hether the control. or one of its child controls, currently has the input focus. Gets or sets the shortcut menu associated with the control. Gets or sets the Conte>..1MenuStrip associated with tllis control. Gets the collection of controls contained within the TableLayoutPai1el. Gets a value indicating whether the control bas been created. Gets the required creation paratneters when tl1e control l1andle is created.(Inherited fro1n Pru.1el.) Gets or sets the cursor tl1at is displayed when fue n1ouse pointer is over the control. Gets the data bindings for the control. Gets or sets the default cursor for the control. Gets tl1e default Input Method Editor (IME) inode supported by tl1e control. Gets the space in pixels, that is specified by default between controls. Gets the length ai1d height in pixels that is specified as the default nlaximlm1 size of a control. Gets the length and height, in pixels, that is specified as the default minimum size of a control. Gets the inten1al spacing, in pixels, of tl1e contents of a control. Gets the default size of the control.(hlherited fro1n Panel.) Gets a value that indicates whether tl1e Co1nponent is Cltrrently in desig11111ode. Gets the rectangle that represents tl1e virtual display area of the control. Gets a value indicating \¥hetl1er the base Control class is in the process of disposing.

PowerShell Studio - Reference Guide Dock

DockPadding DoubJeBuffered

Enabled Events Focused Font FontHeight ForeColor Gro,vStyle

Bandle HasChildren Height HorizontalScroll BScroll lmeMode ImeModeBase InvokeRequired

IsAccessible IsDisposed lsHandleCreated IsMirrored LayoutEngine LayoutSettin gs

I 501

Gets or sets vvhich control borders are docked to its parent control and determines 11ow a control is resized with_its parent. Gets the dock padding settings for all edges of the control. Gets or sets a value indicating whether this control should redraw its surface using a secondary buffer to reduce or prevent flicker. Gets or sets a value indicating \Vl1ether the co11trol ca11 respo11d to user interaction. Gets the list of event handlers that are attached to this Component. Gets a val11e indicating whether the control l1as input focus. Gets or sets the font of the text displayed by the control. Gets or sets the height of the font of the control. Gets or sets the foreground color of tl1e control. Gets or sets a value indicating whether the TableLayoutPanel control should expand to accorru11odate ne\.v cells \vhen all existing cells are occupied. Gets the \Vindo' v handle that tl1e control is bound to. Gets a value indicating \;vhether the control contains one or niore child controls. Gets or sets the height of the control. Gets the characteristics associated with the horizontal scroll bar. Gets or sets a value indicating whetl1er the horizontal scroll bar is visible. Gets or sets the Input Method Editor (IJ\1E) 1node of the control. Gets or sets tl1e Itvffi mode of a co11trol. Gets a value indicating \;vhether the caller must call an invoke n1ethod vvhen 111aking method calls to the control because the caller is on a different thread than tl1e one the control was created on. Gets or sets a value indicating whether the control is visible to accessibility applications. Gets a value indicating whether tl1e control has been disposed of. Gets a value indicati11g whether tlie co11trol has a handle associated with it. Gets a valt1e in.dicating \vhether the control is rnirrored. Gets a cached instance of the panel's layout engine. (Overrides Control.LayoutEngine.) Gets or sets a value representing the table layout settings.

502 I PowerShell Studio - A Comprehensive Guide Left

Location

Margin MaximumSize MinimumSize Name Padding Parent PreferredSize ProductNa1ne ProductVersion Recreatin gHandle Region RenclerRightToLeft ResizeRedraw Right

RightToLeft

RolvCount RowStyles Scale Children Show FocusCues Show Keyboard Cues

Site Size Tablndex

Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area. Gets or sets the coordinates of the upper-left comer of the control relative to tl1e upper-left comer of its container. Gets or sets the space between controls. Gets or sets the size that is the upper limit that GetPreferredSize can specify. Gets or sets the size tl1at is the lower limit that GetPreferredSize can specify. Gets or sets the na1ne of the control. Gets or sets padding "vitllin the control. Gets or sets the parent container of the control. Gets the size of a rectangular area into which the control can fit. Gets the product ruune of the assembly contai1ling the control. Gets the version of t11e assen1bly containing the control. Gets a value indicating whether the control is currently re-creating its handle. Gets or sets the window region associated with the control. Obsolete.TJlis property is now obsolete. Gets or sets a value indicating whether the control redra,vs itself when resized. Gets the distance, in pixels, behveen the right edge of the control and the left edge of its container's client area. Gets or sets a value indicating whether control's elen1ents are aligned to support locales using right-toleft fonts. Gets or sets the number of rows in the table. Gets a collection of ro\V styles for the TableLayoutPanel. Gets a value that determines the scaling of child controls. Gets a value indicating whether the control should display focus rectangles. Gets a value indicating '\e lsArrangeValid

lsEnabled

IsEnabledCore lsFocused lsHitTestVisible

IslnactiveSelectiouHigblightEnabled

Isin iti alized

lslnputMetbodEnabled

lsKeyboardFocu sed IsKeyboardFocusWithin

IsLoaded IsManipulationEnabled IsMeasu.reValid lsMouseC a1>tu red IsMouseCa1JtureWithin

Gets or sets a value that indicates whether a horizontal scroll bar is shown. Gets or sets the scope li1nits for property value inheritance, resource key lookup, and RelativeSource FindAncestor lookup. Gets the collection of input bindings associated with this ele1nent Gets or sets the context for input used by this Framework:Element. Gets a value indicating whether the computed size and position of child elements in this element's layout are valid. Gets or sets a value indicating \¥hether this elen1ent is enabled in the user inte1face (UI). This is a dependency property. Gets a value that becon1es the return value of IsEnabled in derived classes. Gets a value that determines whether this element has logical focus. This is a dependency property. Gets or sets a value tl1at declares whether this element can possibly be returned as a hit test result fro1n so111e portion of its rendered content. This is a dependency property . Gets or sets a value tliat indicates whetl1er the text box displays selected text ,;vhen the text box does not have focus. Gets a value that indicates whether this element has been initialized, either during processing by a XMv1L processor, or by eJ\'Plicitly having its Encilnit method called. Gets a value indicating whether an input method system, such as an Input Method Editor (llv1E), is enabled for processing the input to this element. Gets a value indicating whether this element has keyboard focus. This is a dependency property. Gets a value indicating vvhether keyboard focus is anyvvhere witllin the element or its visual tree child elements. This is a dependency property. Gets a value that indicates whether this element lias been loaded for presentation. Gets or sets a value that indicates v1hether manipulation events are enabled on tllis UIElement. Gets a value indicating whether the current size returned by layout measuie is valid. Gets a value indicating whether the mouse is capttued to this element. This is a dependency property. Gets a value that determines whether mouse capture is 11eld by this element or by child elements in its ' risual tree. This is a dependency property .

PowerShe ll Studio - Referen ce Guide lsMouseDi rectlyOver

lsMouseOver

lsReadOnly

IsReadOnlyCaretVisible IsSeaJed

lsSelectionActive lsStylusCaptured lsStylusCaptureWitbin

IsStylusDirectlyOver

IsStylusOver

IsTabStop IsUndoEnabled IsVisible

Language LayoutTransfo rm LineCount LogicaJChilclren

Margin MaxHeight

I 507

Gets a value tliat indicates \Vhether the position of the mouse pointer corresponds to hit test results, which take element compositing into account. This is a dependency prope1ty. Gets a value indicatil1g ' vhether the mouse pointer is located over this eleme11t (including child elements in the visual tree). This is a dependency property. Gets or sets a value that indicates whether the text editing control is read-only to a user interacting with the control. Gets or sets a value that indicates whether a read-only text box displays a caret. Gets a value tl1at indicates '"hether this instance is currently sealed (read-only).(Inherited fro1n Depende11cyObject.) Gets a value that indicates whether the text box has focus and selected text. Gets a value indicating wl1ether the stylus is captured by this element. This is a dependency property . Gets a value that detennines whether stylus capture is held by this element, or an element within the element bounds and its visual tree. Tlris is a dependency property . Gets a value tl1at indicates \.Vhether the stylus position corresponds to hit test results, wlrich take element con1positing into account. Tlris is a dependency property . Gets a value :indicating \vhether tl1e sty lus cursor is located over this element (including visual child elements). This is a dependency property. Gets or sets a value that indicates vvhether a control is i11cluded in tab navigation. Gets or sets a value that indicates whether undo support is enabled for tl1e text-editing control. Gets a value indicating whether tlris ele1nent is visible in the user inte1face (Ul). Tltls is a dependency property. Gets or sets localization/globalization language infonnation tllat applies to an ele1nent. Gets or sets a graphics transforniation that shottld apply to this element when layout is perfonned. Gets the total 11umber of lines in the text box. Gets an enu1nerator for the logical child elements of the TextBox.(Overrides FraineworkElen1ent.LogicalChildren.) Gets or sets the outer margin of an element. Gets or sets the maximum height constraint of the element. Gets or sets the maximu1n number of characters that can be manually entered into the text box.

508

I PowerShell Studio -

A Comprehensive Guide

MaxLines

Gets or sets the maximum number of visible lines.

Ma,~Width

Gets or sets the llllrXiln11m widtl1 constraint of the element. Gets or sets the 1nin:imum heigl1t constraint of tl1e element. Gets or sets the minimum 11umber of visible lines.

Min Height

MinLines

MinWidth

Padding

Gets or sets the 1ninitnum width constraint of the element. Gets or sets the identifying na1ne of tlle eleme11t. The name provides a reference so that code-behind, s11ch as event handler code, can refer to a markup ele1nent after it is constn1cted dtlfing processing by a XA1\1L processor. Gets or sets the opacity factor applied to the entire UIElement "vhen it is rendered i11 the user interface (Ul). This is a dependency property. Gets or sets an opacity mask, as a Bn1sl1 in1ple111entation tl1at is applied to any alpha-channel masking for the rendered content of tllis ele1nent. This is a dependency property. Gets or sets a value that indicates "vhether this element incorporates sty le properties fron1 theme styles. Gets or sets the padcfu1g inside a control.

Parent

Gets the logical parent ele1nent of tllis ele1nent.

Persistld

Obsolete. Gets a value that uniquely identifies this ele1nent. Gets (or sets, but see Remarks) the final render size of tltis eleme11t. Gets or sets transform information that affects the rendering position of tllis element. This is a dependency property. Gets or sets the center point of any possible render transform declared by RenderTransfonn. relative to tl1e bounds of the eleme11t. This is a dependency property . Gets or sets the locally-defined reso1uce dictionary .

Name

Opacity

01>acityMask

OverridesDefaultStyle

RenderSize Rende rTransfo rm

RenderTransformOrigin

Resources SelectedText SelectionBrusb SelectionLength Selection01>acity SelectionStart Sna1>sT0DevicePixels

Gets or sets the content of the curre11t selection in the text box. Gets or sets the b1ush tl1at highlights selected te~1. Gets or sets a value indicating the number of characters in the cllffent selection in the text box. Gets or sets the opacity of the SelectionBrush. Gets or sets a character index for the begi1ming of the c1rrrent selection. Gets or sets a value that detennines whether rendering for this element should use device-specific pi,-xel

PowerShell Studio - Reference Guide

S1>ellCheck

Style StylnsPluglns Tablndex

Tag Template TemplatedParent

Text TextAlignment TextDecorations TextW rapping ToolTip TouchesCaptured TouchesCapturedWitbin TouchesDirectlyOver TouchesOver T1igge1·s Typography Uid

UndoLimit UseLayoutRounding

VerticalAlignment

Ve1iicalContentAlignment

I 509

settings during rendering. This is a dependency property. Gets a SpellCheck object tl1at provides access to spelling e1rors in the tex1 conte11ts of a Tex1:BoxBase or RichTextBox. Gets or sets the style used by this element when it is rendered. Gets a collection of all stylus plug-in (custoinization) objects associated with this element. Gets or sets a value that determines the order in which elements receive focus when the user navigates through controls by using the TAB key. Gets or sets an arbitrary object value that can be used to store custom information about this element. Gets or sets a control template. Gets a reference to the te1nplate parent of this element. This property is not relevant if the element \Vas not created through a template. Gets or sets the text contents of the text box. Gets or sets the horizontal aligrunent of the contents of the text box. Gets the text decorations to apply to the text box. Gets or sets ho\;v the text box should \>vrap text. Gets or sets the tool-tip object that is displayed for this element in the user interface (UT). Gets all touch devices that are captured to this element. Gets all toucl1 devices tl1at are captured to this element or any child ele1nents in its visual tree. Gets all touch devices tl1at are over this element. Gets all touch devices that are over this element or any child elements in its ' 'isual tree. Gets the collection of triggers established directly on this element, or in child elements. Gets the currently effective typography variations for the tex1 contents of tl1e text box. Gets or sets the unique identifier (for localization) for this ele1ne11t. This is a dependency property. Gets or sets the number of actions stored in the undo queue. Gets or sets a value that indicates whether layout rounding should be applied to this element's size and position during layout. Gets or sets the vertical alignment characteristics applied to this element when it is composed within a parent element such as a panel or items control. Gets or sets the vertical aligm11ent of tl1e control's conte11t.

510

I PowerShell Studio -

A Comprehensive Guide

VerticalOffset

Gets or sets the vertical scroll position.

VerticalScrollBarVisibility ViewportBeight

Gets or sets a value that indicates whether a vertical scroll bar is shown. Gets the vertical size of the scrollable content area.

VielvportWidth

Gets the horizontal size of the scrollable conte11t area.

Visibility

VisuaJBitma1>ScalingMode

Gets or sets the user interface (UI) visibility of this ele1nent. This is a dependency property. Obsolete. Gets or sets the BitmapEffect value for the Visual. Obsolete. Gets.or sets the BitmapEffectlnput value for the Visual. Gets or sets the BitmapScalingMode for the Visual.

VisualCacbeMode

Gets or sets a cached repJesentation of the Visual.

VisuaJChildrenCount

VisuaJEffect

Gets the nun1ber of visual child elements \¥itlu11 this ele1nent. Gets or sets the ClearTypeHint that detennines how ClearType is rendered in the Visual. Gets or sets the clip region of the Visual as a Geon1etry value. Gets or sets the edge mode of the Visual as ru1 EdgeMode value. Gets or sets the bit111ap effect to apply to the Visual.

VisuaJOffset

Gets or sets the offset value of the visual object.

VisuaJOpacity

Gets or sets the opacity of the Visual.

VisualOpacityMask Visu alP arent

Gets or sets the Brush value that represents the opacity mask of the Visual. Gets t11e visual tiee parent of the visual object.

VisuaJScrollableAreaClip

Gets or sets a clipped scrollable area for the Visual.

VisuaJTextHintingMode

Gets or sets the TextHintingMode of the Visual.

Visual TextRencleringMode

Gets or sets the TextRenderingMode of the Visual.

VisuaJTransform

Gets or sets the Transform value for the Visual.

VisualXSnappingGuidelines

Gets or sets the x-coordinate (vertical) guideline collection. Gets or sets they-coordinate (l1orizontal) guideline collection. Gets or sets the \vidth of tl1e element.

~

Visu alBitmaJJEffect VisualBitmapEffectln put

VisualCJearTy1>eHint VisuaJClit> VisualEdgeMode

VisualYSnappingGuidelines Width

TIMER PROPERTY Auto Reset

DESCRIPTION Gets or sets a Boolean i11dicating whetl1er tl1e Timer should raise the Elapsed event only once (false) or repeatedly (tn1e).

PowerShell Studio - Reference Guide CanRaiseEvents Container DesignMode Enabled Events Interval Site

SynchronizingObject

I 511

Gets a value iI1dicati11g \Vhether the component can raise an event. Gets the !Container that contains tl1e Co1nponent. Gets a value that indicates \vhether the Component is currently in design 1node. Gets or sets a value indicating wl1ether the Timer should raise the Elapsed event. Gets the list of event handlers that are attached to this Component. Gets or sets the interval, expiessed in milliseconds, at which to raise the Elapsed event. Th.is API supports the product infrastructure and is not intended to be used directly from your code. Gets or sets the site that binds the Tin1er to its container i11 design mode. Gets or sets the object used to marshal event-handler calls that are issued when an interval bas elapsed.

TOOLBAR PROPERTY Actuaffieight

DESCRIPTION

ActualWidth

Gets the rendered width of this element.

AllowDrop

Gets or sets a value indicating whether this element can be used as the target of a drag-and-drop operation. This is a dependency property. Gets or sets the number of alternating iten1 containers in the Ite1nsControl, which enables alternating co.ntainers to have a u1rique appearance. (Inherited fro1n ItemsControl.) Gets a value tliat i11dicates \svhether at least one touch is captured to this element. Gets a value that indicates \Vhether at least one toucl1 is capt1rred to this ele1nent or to any child elements in its visual tree. Gets a value tllat indicates whether at least one touch is pressed over this element. Gets a value tl1at iI1dicates whether at least one touch is pressed over this elernent or any child elements in its visual tree. Gets or sets a bn1sh that describes the background of a control. Gets or sets a value that indicates where the toolbar should be located in the ToolBarTray . Gets or sets the band index r11unber that indicates the position of the toolbar on the band. Gets or sets the BindingGroup tliat is used for the ele1nent.

AlternationCount

AreAnyTouchesCa1Jtu red AreAnyTouchesCaJJturedWithin

AreAnyTouchesDirectlyOver AreAnyTouchesOver

Background Band Bandlndex BindingGrou11

Gets the rendered height of tlris element.

512

I PowerShell Studio -

A Comprehensive Guide

BitmapEffect

BorderThiclrness

Obsolete. Gets or sets a bitinap effect that applies directly to the rendered content for this element. This is a dependency property. Obsolete. Gets or sets an input sotuce for the bitmap effect that applies directly to the rendered content for this element. This is a dependency property. Gets or sets a brush that describes the border backgrotmd of a control. Gets or sets the border thickness of a control.

System_CAPS_11ubp ro1>ertySystem _CAPS_static CacheMode

ButtonStyleKey Gets or sets a cacl1ed represe11tation of the UIElement.

System_CAPS_pubpro1>ertySystem_CAPS_static Clip

CheckBoxSty leKey

Bitma11Effectlnput

BorderB111sh

Clip To Bounds

System_CAPS_11u b1> ropertySystem _CAPS_static CommandBindings

ContextMenu

Cursor DataContext DefaultStyle]{ey DependencyObjectType

DesiredSize Dis1>atcher DisplayMembcrPath

Effect

Gets or sets the geometry used to define the outline of the contents of an element. Tllis is a dependency property. Gets or sets a value indicating whether to clip the content of this element (or content coming from the child elements of this element) to fit into the size of the containing element. This is a dependency property. ComboBoxStyleKey Gets a collection of Co1nrnandBil1ding objects associated with this element. A CommandBinding enables co1runand handling for this element, and declares the linkage betvveen a command, its events, and tl1e handlers attached by this elen1ent. Gets or sets the contex.'t menu ele1nent that should appear whenever the context menu is requested through user interface (UI) fro1n within this element. Gets or sets the cursor tl1at displays 'vhen the n1ouse pointer is over this ele1nent. Gets or sets the data context for ru1 ele1nent when it participates in data binding. Gets or sets the key to use to reference the sty le for this control, wl1en the1ne sty les are used or defu1ed. Gets the DependencyObjectType that "vraps the CLR type of this instance. (Inherited from DependencyObject.) Gets the size that this element computed during the meastrre pass of the layout process. Gets the Dispatcher this DispatcherObject is associated \Vith. (Inherited from DispatcherObject.) Gets or sets a path to a value on the source object to seive as tl1e visual representation of tl1e object. (Inherited from ItemsControl.) Gets or sets the bitmap effect to apply to the UIElement. This is a dependency property.

PowerShell Studio - Reference Guide FlowDirection

Focusable FocusVisualStyJe

FontFamily FontSize FontStretcb FontStyle FontWeight ForceCursor

Foreground Grou11Style

Grou pStyleSelector

HandlesScrolling HasAnimatedProperties HasEffectiveKeyboardFocus HasHeader

HasItems HasOverflowItems Header HeaderStringFormat

I 513

Gets or sets tl1e direction tl1at tex.1: and other user interface (UI) elements flow within any parent eleme11t that controls their layout. Gets or sets a value that indicates "'' hether the element can receive focus. This is a dependency property . Gets or sets a property that enables customization of appearance, effects. or other sty le characteristics that will apply to this element when it captures keyboard focus. Gets or sets the font fanrily of the control. Gets or sets the font size. Gets or sets the degree to which a font is condensed or expanded on the screen. Gets or sets the font style. Gets or sets the weight or tlrickness of tl1e specified font. Gets or sets a value tl1at indicates \Vl1ether this FrameworkElement should force tl1e user interface (Ul) to render the cursor as declared by tl1e Cursor property . Gets or sets a brush tl1at describes tl1e foreground color. Gets a collection of GroupStyle objects that define the appearance of each level of groups.(Inherited fro1n Iten1SControl.) Gets or sets a inethod that enables you to provide custon1 selection logic for a GroupStyle to apply to each group in a collection (Inherited from Ite1nsControl.) Gets a value tliat indicates 'vhether a control supports scrolling. Gets a value indicating whether this element has ai1y animated properties. Gets a value that indicates whether the UIElen1ent has focus. Gets a value tl1at indicates "vhetl1er this Headeredlte1nsControl has a header. (Inherited fro1n HeaderedltemsControl.) Gets a value tliat indicates 'vhether the Iten1sControl contains ite1ns. (Inherited from ItemsCoutrol.) Gets a value that indicates whether the toolbar has iten1s that are not visible. Gets or sets the item that labels the control. (lnl1erited from HeaderedltemsCo ntrol.) Gets or sets a composite string that specifies ho\v to fonnat the Header property if it is displayed as a string.(lnherited fron1 HeadereditemsControl.)

514

I PowerShell Studio -

A Comprehensive Guide

HeaderTemplate

HeaderTem1JlateSelector

Height HorizontalAlignment

HorizontaJContentAlignment InheritanceBehavior

lnputBindings lnputScope IsArrangeValid

IsEnabled

lsEnabledCore lsFocused IsGrouping lsHitTestVisible

lslnitialized

lsinputMethodEnabled

IsKeyboardFocused lsKeyboardFocusWithin

lsLoaded

Gets or sets the template used to display the contents of the control's header. (Inherited from HeaderedltemsControl.) Gets or sets the object that provides custom selection logic for a template used to display the header of each item. (Inherited from HeaderedltemsControl.) Gets or sets the suggested height of the element. Gets or sets the horizontal alignn1ent characteristics applied to this element when it is co1nposed within a parent element, such as a panel or items control. G'ets or sets the horizontal aligmnent of the control's content. Gets or sets the scope li1nits for property value inheritance, resource key lookup, and RelativeSource FindAncestor lookup. Gets the collection of input bindings associated with this ele1nent. Gets or sets the conte:\.1 for input used by this Frame\LevelControl

TopNode TreeViewNodeSorter UseWait Cursor Visible VisibleCount Width

536

I PowerShell Studio -

A Comprehensive Guide

WindowTarget

This API supports the product infrastructme and is not intended to be used directly from yom code. This property is not relevant for this class.

VSCROLLBAR

AccessibilityObject AccessibleDefaultActionDesc1iption AccessibleDescription AccessibleN ame i\ccessible:R.ole Allo,vDro1> Anchor

AutoScrollOffset Auto Size

BackColor

Backgroundlmage

Backgrou ndlmageLayout

Bin dingContext Bottom

Bounds

CanEnablelme

•Gets the AccessibleObject assigned to the control. Gets or sets the default action description of the control for use by accessibility client applications. Gets or sets the description of the control used by accessibility client applications. Gets or sets the nan1e of the control used by accessibility client applications. Gets or sets the accessible role of the control Gets or sets a value indicating vvhether the control can accept data that the user drags onto it. Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent. Gets or sets where this contTol is scrolled to in ScrollControllntoVievv. Gets or sets a value indicating whether the ScrollBar is automatically resized to fit its contents.(Inherited from ScrollBar.) This API supports the product infrastn1cture and is not intended to be used directly fro1n.your code. Gets or sets the background color for the co11trol.(I11herited from ScrollBar.) This API supports the product infrastructure and is not intended to be used directly from your code. Gets or sets the background inIBge displayed in the control.(Inherited from ScrollBar.) This API supports the product infrastn1cture and is 11ot intended to be used directly fro1n your code. Gets or sets the background il1i.age layout as defined in the ImageLayont enumeration. (Inherited from ScrollBar.) Gets or sets the BindingContext for the control. Gets the distance, in pixels, between tl1e botto1n edge of the control and the top edge of its container's client area. Gets or sets the size and location of tl1e control including its nonclient elements, in pixels, relative to tl1e parent control. Gets a value indicating whether the ImeMode property ca11 be set to an active value, to enable IME support.

PowerShell Studio - Reference Guide CanFocus CanRaiseEvents CanSelect Capture CausesValidation

CtientRectan gle CJien.tSize Com1JanyName Container ContainsFocus ContextMenu ContextMenuStrip Cont1·0Js Created CreateParams

Cursor DataBindings DefaultCursor DefaultlmeMode DefaultMargin

DefaultMaximumSize DefaultMinimumSize DefaultPadding DefaultSize

I 537

Gets a value indicatingwhether the control can receive focus. Detennines if events can be raised on the control. Gets a value indicating wl1ether the control can be selected. Gets or sets a value indicating \vl1ether the control has captured the mouse. Gets or sets a value indicating whether the control causes validation to be performed on any controls that require validation vvben it receives focus. Gets the rectangle that represents the client area of the control. Gets or sets the height and widtl.1 of the client area of the contro1. Gets the name of the company or creator of the application containing the control. Gets the !Container that contajns the Component. Gets a value indicating 'vhether tl1e control. or one of its child controls, currently has the input focus. Gets or sets the shortcut rnenu associated with tl1e control. Gets or sets the ConteA1MenuStrip associated vvith this control. Gets the collection of controls contained within tl1e control. Gets a value indicating \vhether tl1e control has been created. This API supports tl1e product infrastructure and is not intended to be used directly from your code. Gets the required creation parameters when the control handle is created.(Overrides ScrollBar.CreateParams.) Gets or sets tl1e cursor that is displayed '1vhen tl1e n1ouse pointer is over tl1e control. Gets the data bindings for the control. Gets or sets tl1e default cttrsor for the control. Gets the default Input Method Editor (Th.1E) .mode suppo1ted by this control.(Inherited from ScrollBar.) Gets the default distance beh:veen the ScrollBar control edges and its contents. (Inl1e1ited from ScrollBar.) Gets fue lengtl1 and height, in pixels, that is specified as the defa1tlt niax:in1um size of a control. Gets the lengtl1 and height, in pixels, that is specified as the default minim11m size of a control. Gets the intenlal spacing in pixels, of the co11tents of a control. Gets the default size of the control.(Overrides Control.DefattltSize.)

538

I PowerShell Studio -

DesignMode DisplayRectangle

DiSJlOSing

DoubleBuffered

Enabled Events Focused Font

FontHeigbt ForeColor

Han.die HasChildren Height ImeMode ImeModeBase InvokeRequired

IsAccessible IsDisposed IsHandleCreated IsMir1·0 red LargeChange

A Comprehensive Guide Gets a value that indicates whether tl1e Component is Clrrrently in design mode. Gets the rectangle that represents tl1e display area of the control. Gets a value indicating wbetl1er the base Control class is in the process of disposing. Gets or sets which control borders are docked to its parent control and deten11ines how a control is resized with its parent. Gets or sets a value indicating whether this control should redraw its surface using a secondary buffer to reduce or prevent flicker. Gets or sets a value indicating \;vhether the control can respond to user interaction. Gets the list of event handlers that are attacl1ed to this Component. Gets a value indicating whether the control has input focus. This AP! supports tile product infrastructure and is not intended to be used directly fro1nyour code. Gets or sets the font of the text displayed by tlle control.(Inl1erited frorn ScrollBar.) Gets or sets the height of the font of the control. This API supports U1e product infrastruct11re and is not intended to be used directly fro.in your code. Gets or sets the foregro1111d color of the scroll bar control.(I11herited from ScrolIBar.) Gets the window handle that tl1e co11trol is bom1d to. Gets a value indicating whether the control contains one or rnore child controls. Gets or sets the height of the control. Gets or sets the Input Method Editor (IME) mode supported by this control.(Inl1erited from ScrollBar.) Gets or sets the IME inode of a control. Gets a value indicating'"'hether the caller must call an invoke method when making metllod calls to the control because the caller is on a different thread than the one tl1e control was created on. Gets or sets a value indicafu1g vvhether the control is visible to accessibility applications. Gets a value indicating whether the control has been disposed of. Gets a value indicating \¥hetl1er the control has a handle associated witl1 it. Gets a value indicating whether the control is mirrored. Gets or sets a value to be added to or subtracted from the Value property when the scroll box is n1oved a large distance.(Inherited from ScrolJBar.)

PowerShell Studio - Reference Guide

I 539

LayoutEngine

Gets a cached instance of the control's layout engine.

Left

Gets or sets the distance, in pix:els, between the left edge of the control and the left edge of its container's client area. Gets or sets the coordinates of tl1e upper-left corner of the control relative to the upper-left corner of its container. Gets or sets the space bet,;veen controls.

Location

Margin

Name

Gets or sets the upper li1nit of values of the scrollable range.(Inherited from ScrollBar.) Gets or sets the size that is the upper limit that GetPreferredSize can specify. Gets or sets the lower li1nit of values of the scrollable range.(lnherited from ScrollBar.) Gets or sets tbe size that is the lower li1nit that GetPrefe1TedSize can specify. Gets or sets the name of the co11trol.

Padding

Gets or sets padding within the control.

Parent

Gets or sets the pare11t contail.1er of the control.

Prefen·edSize

Gets the size of a rectangular area into wl1ich the co11trol can fit. Gets the product name of the assembly containing the control. Gets the version of the assembly containing the control. Gets a value indicating \¥hether the control is currently re-creating its handle. Gets or sets the window region associated with the control. Obsolete.This property is now obsolete.

Maximum MaximumSize Minimum MinimumSize

ProductN ame ProcluctVersion RecreatingHandle Region RenderRightToLeft ResizeRedraw Right

RightToLeft

ScaleChildren SholvFocasCoes ShowKeyboard Cues

Site

Gets or sets a value indicating whether the control redraws itself when resized. Gets tl1e distance, in pixels, betwee11 tl1e right edge of the control and the left edge of its container's client area. This API supports the product infrastructure and is not intended to be used directly from your code. Gets a value indicating whether control's ele1nents are aligned to support locales using right-to-left fonts.(Overrides Control.RightToLeft.) Gets a value that detennines the scaling of child controls. Gets a value indicati11g \¥hether the control should display focus rectangles. Gets a value indicating\¥hether the user interface is in the appropriate state to show or hide keyboard accelerators. Gets or sets the site of the control.

540

I PowerShell Studio -

A Comprehensive Guide

Size Small Change

Tablndex TabStop

Tag Text

Top

TopLevelControl

UseW aitCursor Value

Visible

Width Window Target

Gets or sets the height and width of the control. Gets or sets the value to be added to or subtracted from the Value prope11y when the scroll box is moved a s1nall dist311ce.(Inherited from ScrollBar.) Gets or sets the tab order of the control within its container. This API supports the product infrastn1cture and is not intended to be used directly fro1n your code. Gets or sets a value indicating wl1etber the user can give the focus to the ScrolJBar control by using the TAB key. (Inherited fro1n ScrollBar.) Gets or sets the object that contains data about the control. This API supports the product infrastructure and is not intended to be used directly fro1n your code. Gets or sets the text associated with this control.(Inherited fro111 ScrollBar.) Gets or sets the distance in pixels, between the top edge of the control and the top edge of its container's client area. Gets tl1e parent control tlwt is not parented by m1other Windows Forms control. Typically, this is the outermost Fonn that the control is contained in. Gets or sets a value indicating wl1ether to use the wait cursor for the current control and all child controls. Gets or sets a nu1neric value tl1at represents the current position of tlle scroll box on the scroll bar control.(l11herited fro1n ScrollBar.) Gets or sets a value indicating whet11er the control and all its child controls are displayed. Gets or sets the \¥idth of the control. This API supports the product infrastn1ct1ue and is not intended to be used directly fro1n your code. This property is not relevant for this class.

WEBBROWSER PROPERTY AccessibilityO bject

DESCRIPTION Gets the AccessibleObject assigned to the control.

Accessi.b leDefaultActionDescription

Gets or sets the default action desc1iption of the control for use by accessibility client applications. Gets or sets the description of the control used by accessibility client applications. Gets or sets the name of the control used by accessibility client aeplications. Gets or sets the accessible role of the control

AccessibleDescription AccessibleName AccessibleRole

PowerShell Studio - Reference Guide ActiveXlnstance

AllowDroJJ

AllowNavigation

AJJowWebBrowserDrop

Anchor

AutoScrolJOffset AutoSize

BackColor

Backgroundlmage

Bac.kgrou ndlmageLayou t

BindingContext Bottom

Bounds

CanEnabJelme

CanFocus CanGoBack

I 541

This API supports the product infrastructure and is not intended to be used directly from your code. Gets the underlying ActiveX WebBrowser control.(Inherited from WebBrowserBase.) This API supports the product infrastructure and is not intended to be used directly fro1n your code. This property is not supported by this control.(Inherited from WebBrowserBase.) Gets or sets a value indicating whether tl1e control can 11avigate to anotl1er page after its initial page has been loaded. Gets or sets a value indicating whetl1er the WebBrowser control navigates to documents that are dropped onto it. Gets or sets the edges of the container to \¥hicl1 a control is bound a11d determines how a control is resized vvitb its parent. Gets or sets where tllis control is scrolled to in ScrollControllntoView. This API supports the product infrastructure and is not intended to be used directly fro1n yo1u code. This property is not relevant for this class. This API supports the product infrastructure and is not intended to be used directly from your code. This property is not mea1lingful for this co11trol.(Inherited from WebBrowserBase.) This API suppo1ts tlle product infrastructure and is not intended to be used directly fro1n your code. This property is 11ot supported by this control.(Inherited fro1n WebBrowserBase.) Tllis API supports the product infrastructure and is not intended to be ·used directly from yo1rr code. Tllis property is not supported by this control.(Inherited fro1n WebBrowserBase.) Gets or sets the BindingContex.1: for the control. Gets the distance, in pixels ben;veen the botto1n edge of the control and the top edge of its container's client area. Gets or sets the size and location of tl1e control including its nonclient elements, in pi.~els, relative to the parent control. Gets a value indicating whether the ImeMode property can be set to an active value, to enable IME support. Gets a value indicating \Vhether the control can receive focus. Gets a value indicating \¥hether a previous page in navigation history is available, which allows the GoBack method to s11cceed.

542

I PowerShell Studio -

CanGoForward

CanRaiseEvents CanSclect Capture CausesValidation

ClientRectangle C.lientSize CompanyName Container

A Comprehensive Guide Gets a value indicating whether a subsequent page in navigation history is available, which allows the GoFoiward method to succeed. Detennines if events can be raised on the control. Gets a value indicating whether the control can be selected. Gets or sets a value indicating 'vhetl1er the control has captured the inotISe. Gets or sets a value indicating whetl1er the control causes validation to be perfonned on ai1y controls that require validation when it receives focus. Gets the rectangle that represents tl1e client area of tl1e control. Gets or sets the height and width of the client area of the control. Gets the name of the company or creator of the application containing the control. Gets the !Container that contains the Component.

DataBindings

Gets a valtie indicating whether the control, or one of its clrild controls, currently lias the input focus. Gets or sets the shortcut menu associated with the control. Gets or sets the ContextMenuStrip associated with this control. Gets the collection of controls contained within the control. Gets a value indicating whether the control has been created. Gets the required creation parameters when the control handle is created. This API supports the product infrastruchrre and is not intended to be used directly fro1n your code. This property is not supported by this control. (Inherited from WebBrowserBase.) Gets tl1e data bindings for the control.

DefaultCursor

Gets or sets the default cursor for tl1e control.

Defau ltlmeMode

Gets the defa1tlt Input Method Editor (IME) mode supported by tl1e control. Gets the space, in pixels, that is specified by defattlt between controls. Gets the length and height, in pixels, that is specified as the default maximum size of a control. Gets the length and 11eight, in pixels, that is specified as the default minimum size of a control. Gets the intenial spacing, in pixels, of the contents of a control. Gets the default size of the control.(Overrides WebBrowserBase.DefaultSize.)

ContainsFocus ContextMenu ContextMenuStrip Controls Created CreateParams Cursor

DefaultMargin Defau ltMaximumSize DefaultMinimumSize DefaultPadcting DefaultSize

PowerShell Studio - Reference Guide DesignMode Dis11layRectangle Disposing Dock

Document DocumentStream DocumentText DocumeotTitle DocumentType DoubleBuffered

Enabled

Encryption Level

Events Focused

Font

FontHeight ForeColor

Handle Has Children Height ImeMode

I 543

Gets a value tliat indicates vvhether the Component is currently in design mode. Gets the rectangle that represents the display area of the control. Gets a value .indicating \Vhether the base ContTol class is in the process of disposing. Gets or sets wltlch control borders are docked to its parent control and detennines 11ow a control is resized with its parent. Gets an HtmlDocmnent representing the Web page currently displayed in the WebBrowser control. Gets or sets a stream containing the contents of the Web page displayed iI1 the WebBrowser control. Gets or sets the HTML co11tents of the page displayed in tl1e WebBrovvser control Gets the title of the doc1unent currently displayed in the WebBrowser control. Gets the type of the docmnent cttrrently displayed in the WebBro,vser control. Gets or sets a value indicating whetl1er this control should redraw its s1rrface using a secondary buffer to reduce or prevent flicker. Tllis API supports the product infrastn1cture and .is not intended to be used directly from yo1u code. This property is not supported by tllis control.(In11erited from WebBrowserBase.) Gets a value indicating the encryption metl1od used by the document currently displayed in the WebBrowser control. Gets the list of event handlers that are attached to this Component. Gets a value .indicati11g \vhether the co11trol or any of its cl1ild windows has ·input focus.(Overrides Control.Focused.) Tllis API supports the product infrastructure and is not intended to be used directly fron1 your code. Tlris property is not 111ea1ringfu1 for this control.(Inherited fro1n WebBrowserBase.) Gets or sets the height of the font of the control. This API supports the prod11ct infrastructure and is not intended to be used directly from yotir code. This property is not meaningfttl for this control.(Inherited from WebBrowserBase.) Gets the 'vindow handle that the control is boi1nd to. Gets a value indicatiJ.1g whether the control contains one or 111ore child controls. Gets or sets the height of the control. This API supports the product infrastn1ct1ue and is not intended to be used directly fro1n your code. Th.is

544

I PowerShell Studio -

A Comprehensive Guide

lmeModeBase InvokeRequired

IsAccessible IsBusv., lsDisposed IsHandleCreated IsMirrored lsOffline IsWebBrowserContextMenuEnabled LayoutEngine Left

Location

Marg.in MaximumSize Minimum Size Name ObjectForScripting

Padding

Parent PreferredSize ProductN ame ProductVersion ReadyState

property is not meaningful for this control.(lnherited from WebBrowserBase.) Gets or sets the IME nlode of a control. Gets a value indicating whether the caller 1nust call an invoke method when making rnethod calls to the control because the caller is on a different thread thai1 the one the control ,;vas created on. Gets or sets a value indicating wbetl1er the control is visible to accessibility applications. Gets a value indicating \Vhether the WebBrowser control is currently loading a new document. Gets a value indicating whether the control bas been disposed of. Gets a value indicating 'vhether the control bas a llalldle associated \Vith it. Gets a value i11dicating ,;vhetber the control is mirrored. Gets a value indicating \Vhetl1er the WebBrowser control is in offline mode. Gets or a sets a value indicating whether the shortcut menu of the WebBro,vser control is enabled. Gets a cached instance of the control's layout engine. Gets or sets the distance, it1 pixels, between tl1e left edge of the control and the left edge of its container's client area. Gets or sets the coordinates of the upper-left comer of the control relative to the upper-left corner of its container. Gets or sets the space bet"\veen controls. Gets or sets the size that is tl1e upper limit tl1at GetPreferredSize cai1 specify. Gets or sets the size that is tl1e lo\ver limit that GetPreferredSize can specify. Gets or sets the name of the control. Gets or sets an object that can be accessed by scripting code that is contained within a Web page di~layed in tl1e WebBro\.vser control. This API supports the product infrastn1cture and is 11ot intended to be used directly from youT code. This property is not meanit1gful for tllis control. Gets or sets the parent container of the control. Gets the size of a rectangular area into whicl1 the control can fit. Gets the product name of the assembly contai1ring the control. Gets the version of the assembly containing the control. Gets a value indicating the current state of tl1e WebBrowser control.

PowerShell Studio - Reference Guide RecreatingHancUe Region Rende1·RightT0Left

I 545

Gets a value indicating whether the control is currently re-creating its handle. Gets or sets the \vindo\;v region associated with the control. Obsolete.This property is now obsolete.

Size

Gets or sets a value indicating wl1ether the control redra'\ivS itself when resized. Gets the distance, iI1 pixels, ben;veen the right edge of the control and the left edge of its contaiI1er's client area. This API supports the product infrastructtue and is not intended to be used directly fron1 your code. This property is not supported by this control.(In.herited from WebBrowserBase.) Gets a value that deterinines the scaling of child controls. Gets or sets a value indicating'"hether the WebBro,vser displays dialog boxes such as script error messages. Gets or sets a value indicating whether scrolJ bars are displayed iI1 the WebBrowser control. Gets a value indicating \vhether the control should display focus rectangles. Gets a value indicating \Vhether the ltser il1terface is in the appropriate state to show or hide keyboard accelerators. This API supports the product infrastructure and is not intended to be used directly from your code. Gets or sets tl1e site of the control.(Inl1erited from WebBrowserBase.) Gets or sets U1e height and width of the control.

StatusText

Gets the status text of the WebBro\vser control.

Tab Index

Gets or sets t11e tab order of the control withll1 its container. Gets or sets a value indicating whether the user can give the focus to this control using the TAB key. Gets or sets tl1e object that contains data about the control. Tllis API supports the product infrastructure and is not intended to be used directly fron1 yolrr code. This property is not supported by this control.(Inherited fro111 WebBrowserBase.) Gets or sets the distance, in pixels, bet\;veen the top edge of the control and the top edge of its co11tainer's client area. Gets the parent control that is not parented by another Windows Forms control. Typically, this is tl1e outermost Forni that tl1e control is contained in. Gets or sets the URL of the current docu1nent.

ResizeRedraw Right

RigbtToLeft

ScaleChildren ScriptErrorsSupp resscd

ScrollBarsEnabled ShowFocusCues Sbo\vKeyboard Cues

Site

TabStop Tag Text

TO(l

TopLevelControJ

Uri

546

I PowerShell St udio -

A Comprehensive Guide

UseW aitCursor

Version Visible WebBrowserShortcutsEnabled Width Windo,vTarget

This API supports the product infrastructure and is not intended to be used directly from your code. This property is not supported by this control.(Inherited fro1n WebBro°"1serBase.) Gets tl1e version of Internet Explorer installed. Gets or sets a value indicating whether tlle control and all its child controls are displayed. Gets or sets a value indicating whether keyboard shortcuts are enabled within the WebBro,vser control. Gets or sets the width of the control. This API supports the product infrastn1cture and is not intended to be used directly from your code. This property is not relevant for this class.

PowerShell Studio - Reference Guide

I 547

INDEX

.NET OBJECT BROWSER ............................... 114

A ACCESSIB ILITY ...................................... 119, 153 ALLOWDROP ..... 155, 339, 343, 347, 352, 357, 363,368,374,378,390,395, 401 , 405,4 10, 417,422, 427,432,438, 448,451 , 457, 462, 470, 480,487,493,498,503,510,518,525, 530, 535, 540 ALTERNATE CREDENTIALS .............................. 83 ASSEMBLIES SETIINGS ..................................... 40 AUTOSCALEMODE ..... 156, 299, 378, 432, 452, 470 AUTOSCROLL ..... 157, 363, 379, 422, 432, 452, 470, 488, 498, 518 AUTOSCROLLMARGIN ....... 157, 363, 379, 422, 432,452,470,488,498,5 18 AUTOSCROLLMINSIZE 157, 363, 379, 422, 432, 452,470,488,498,5 18 AUTOSIZEMODE ............................................ 157 AUTOVALIDATE .... 155, 299, 379, 432, 452, 471

B BACKCOLOR ..... 153, 168, 200, 201, 269, 299, 338,339,343,352,363,369,374,379,401, 417, 422, 427, 433,448,452, 457, 471,488, 493, 494, 498,519, 524, 525, 530,535,540 BACKGROUNDIMAGE ....... 153, 159, 339, 343, 352,363,369,374,379,401, 417, 422, 427, 433, 448, 452, 457,471,488, 494, 498, 519, 525,530, 535, 540 BACKGROUNDIMAGELA YOUT . 153, 299, 339, 343,352,363,369,374,379, 401 , 417,422, 427,433, 448, 452,457,471, 488, 494, 498, 519,525, 530,536,540 BIT-DEPTH ................... ....................................233

BREAKPOINTS ..... ...................................... ...... 61 BUILD OPTIONS .............................................. 86 BUTION .................. ......... ....... ....... 125, 132, 179 BUTION EVENTS ........................................... 180 BUTION MANIPULATION .. ........................... 182

c CACHE.................................................. 327, 329 CALL STACK PANE....................................... 1O7 CAUSESVALIDATION. 156, 340, 344, 352, 364, 369,375,379, 401,418,423, 428, 433,448, 453,458,471, 488,49 4, 499, 519,526, 530, 536,541 CHART .... ......................... .............. 125, 132, 185 CHECK SYNTAX .............................................. 97 CHECKBOX ..... ... .................................. 125, 191 CHECKLISTBOX .. .......................................... 125 CLIPBOARD .................................................... 57 COLLECTION PROJECT ....................... 171, 172 COLOR DIA LOG ................................... 126, 200 COMBOBOX .. 30, 81, 189, 20 l , 202, 203, 208, 293,336,358,359,361 COMBOBOX ................................ 126, 132, 20 l COMPARE FILES .......................................... ... 93 CONSOLE LAYOUT ...................................... 105 CONSOLE PANE .......................................... 107 CONSOLE SETIINGS ...................................... 27 CONTEXTMENUSTRIP. 126, 155, 203, 204, 205, 206,208, 214, 263,340,344, 353,364,366, 367,370,375,380,402,418, 423,428, 433, 449 , 453,458, 472,489,494, 499,520,526, 531,536,541 CONTEXTMENUSTRIP ........................... 126, 203 CONTROL REFERENCE .. ............ .................... 79 CONTROLSETS ............................................. 125 CONTROLBOX ... ............ .............................. 159 CONTROLS ................................................... 125

CREATE FORM TEMP LA TE .............................. 77 CREATE PROPERTY SET ... ............................... 74 CUSTOMMENU.INF ......................................... 96 D

DATABASE BROWSER .................................. 114 DATABINDINGS .. 155, 340, 344, 353, 364, 370, 375,380, 402, 418,423, 428, 434,449,453, 458,472,489,495,499,520, 526,531,536, 541 DATA GRID ............................................ 126, 209 DATAGR IDVIEW ..... 78, 81, 126, 144, 145, 147, 155, 195, 209, 210, 212, 2 13, 214, 215, 217, 336,368, 369,370,371,372,373,374 DATAGRIDVIEW ................................... 126, 209 DATETIMEPICKER .................................. 126, 215 DEACTIVATE LICENSE .................................... 21 DEBUG CONSOLE PANE ............................. 108 DEBUG LAYOUT ............................................ 105 DEBUG PANE ...... .... ........... .... ... .... ........ ... ..... 107 DEBUGGER SETIINGS..................................... 28 DEBUGGING ................................................... 60 DECLARATION .............................................. 111 DEPLOY ... ... .............. ............ ...... .. ............ . 66, 79 DEPLOYMENT ................................................. 91 DESIGN ER LAYOUT....................................... l 06 DESIGN ER SETTINGS ....................................... 29 DESIGNER TAB ................................................ 68 DIA LOG STYLE FORM ..................... .............. 142 DOCUMENT EXPLORER ................................. 55 DOEVENTS ........... 3 12, 313, 319, 320, 321, 322 DOMAINUPDOWN ............................... 126, 217 DOUBLEBUFFERED ...... 155, 340, 345, 353, 365, 370,376, 380, 402, 418, 424, 429,434,449, 454,459, 472, 490, 495, 500,52 1, 527, 532, 537, 542 E ED IT0 R LAY0 UT. ... ............. ........................... 10 6 EDITOR SETIINGS ............................................ 32 ELEVATED PRIVILEGES ................................. 338 EMPTYFORM ....................... 138, 141, 163, 164 ERRORPROVIDER ........................... .............. 126 EXECUTION RESTRICTIONS ............................ 84

EXPLORER STYLE FORM ........ ........................ 143 EXPORT ............................................................ 79

F FILES AND FOLDERS ....................................... 89 FILESYSTEMWATCHER ........... ............... 126, 224 FIND RESULTS PANE ............................... ....... 110 FIREWALL ......................................................... 20 FLOWLAYOUTPANEL ........................... 127, 227 FOLDERBROWSERDIALOG ... 81, 228, 267, 336 FOLDERBROWSERDIALOG .......................... 127 FOLDERBROWSERMODERNDIALOG. 127, 228 FONTDIALOG ........ ............................... 127, 229 FONTS AND COLORS ........... .......................... 35 FORM BORDER STYLES................................. 139 FORM DESIGN ..................................... 135, 137 FORM PROJECTS .......................................... 165 FORM PROPERTIES ....................................... 153 FORM ATIING SETTINGS ................................. 40 FULL GRID SEARCH TEMP LA TE .................... 144 FUNCTION EXPLORER PANE ........................ 111

G GEN ERA L SETIINGS ........................................ 24 G IT........................................................... 51 , l 02 G LOBAL SCOPE ....... ............ ........................ 170 G LOBALS. PSl ............................... 166, 168, 169 GRID JOB TEMPLATE ............ ........................ 145 GRID SEARCH TEMPLATE ............................. 146 GRID TEMPLATE ............................................ 147 GROUPBOX .. .... .................... 230, 269, 275, 307 GROUPBOX .......................................... 127, 230 H HELP PANE .................................................... 112 HELP TAB ........................................................ l 03 HELPBUTION ................................................. 160 HELPPROVIDER .................................... 127, 231 HEX ................................................ 200 20 l , 338 HOMETAB ................. ... ................................... 57 HSC ROLLBAR ................................................ 127 I

I IMAGELIST ............................................ 127, 232

PowerShell Studio - Reference Guide.

I 549

IMEMODE... 155, 340, 341, 344, 345, 352, 354, 364, 365, 369, 371,375,376, 379, 381,401, 403, 417, 419, 423,425,427, 429, 433, 435, 448, 449, 452, 454, 458,459, 471,473,488, 491, 494, 496, 499, 500, 519, 521 , 525,527, 530, 532, 536, 537, 541 , 543 INSTALLATION COMPLETE................................................... 19 CUSTOM .. ........... .... .................... ............... .. 19 TYPICAL ....................................................... 19 ISMIDCONTAINER ......................................... 160

OBJECT BROWSER PANE ............................ 114 OFFLINE ACTIVATION .............................. ...... 21 OPENFILEDIALOG .......... ........ 81, 267, 268, 336 OPENFILEDIALOG ................................ 129, 267 OUTPUT FOLDER ............................................. 89 OUTPUT PANE ............................................... 115 OUTPUT SETIINGS ........................................... 82

L

p

LABEL .. 167, 222, 234, 235 , 249, 27 6, 291, 293, 296, 307, 401,403,404 LA BEL .................................................... 128, 234 LINKLABEL ............................................. 128, 235 LISTBOX .................. ............................... 128, 236 LISTVIEW........................................ 128, 133, 238 LOCAL CACHE ............................................... 58 LOCAL SCOPE .............................................. 170

MANIFEST ................................................ 83, 173 MASKEDTEXTBOX ................................. 128, 252 MAXIMUMSIZE .... 158, 299, 34 l , 345, 354, 366, 372, 377,381, 403, 420, 425,429 , 435, 450, 455, 460, 473, 491 , 496, 501, 522, 528, 533, 538, 543 MDI FORM ..................................................... 165 MENU TEMPLATE ........................................... 148 MENUSTRIP ........................................... 128, 257 MINIMUM REQUIREMENT ............................... 19 MIN IMUMSIZE ..... 158, 341 , 345, 354, 366, 372, 377, 381 , 403, 420, 425, 429, 435, 450, 455, 460, 473, 491, 496, 501, 522, 528, 533, 538, 543 MODULE PROJECTS ..................................... 172 MONTHCALENDAR ............................. 128, 260 MSI SETIINGS ... ................................................86 MULTI-FORM PROJECTS .... .................. 166, 171

PACKAGER .................................................... 80 PADDING .... 158, 341, 346, 350, 354, 361, 366, 372,377, 381,393, 399,403, 409,415,420, 425, 430, 435, 450,455,460, 466, 474, 485, 491,496, 501, 507,516, 522, 528, 533, 538, 544 PANEL ................................................... 129, 269 PANEL SETIINGS ............................................. 48 PAN ES ........................................................... l 0 7 PERFORMANCE PANE................................. 116 PICTUREBOX ........ 270, 271, 307, 444, 445, 447 PICTUREBOX .......................... ............... 129, 270 PLATFORM ....... ... ............ .... .... ... ..... ... ......... ... . 58 POWERREGEX ................................................ 98 POWERSHELL BROWSER .............................. 114 POWERSHELL HELPWRITER ............................ 98 POWERSHELL SETIINGS ................................. 49 PRESETS .. ......................... ...................... .......... 36 PRIMALSCRIPT ........... 82, 95, 98, 332, 333, 336 PRIMALSQL ........................................ ............. 98 PRIMALXML .................................................... 98 PRIVATE SCOPES ......................................... 170 PROFILE EDITOR ............................................. 98 PROGRESSBA R............................. 129, 133, 271 PROGRESSBAROVERLA Y .................... 129, 271 PROJECTPANE ............................................ 117 PROPERTY PANE .......................................... 119 PROPERTYGRID .. .................................. 129, 273

N

R

NOTIFYICON .................. 20, 129, 262, 265, 266

RADIOBUTION ..................................... 130, 275

M

NOTIFYICON .......... ............................... 129, 262 NUMERICUPDOWN ............................. 129, 266

0

RECOVERY DATA ................................... 30, 167 REMOTE CACHE .................................... 59, 329 REMOTE CONNECTION ................................. 59 REMOTE CONSOLE ........................................ 59 REMOTE SCRIPT EXECUTION ENGINE .......... 20 RESTORE POINTS ....... ...................... .............. l 00 REWIND ............................ 100 RICHTEXTBOX ................... ..................... 130, 27 6 RIGHTTOLEFTLA YOUT. 154, 377, 430, 450, 497, 528,534 RSEE DEPLOYMENT ...................................... 33 1 RSEE RESTRICTIONS ...................................... 334 I

•••••••••• •





•••••• •

••••••••

s SA VEF ILEDIALOG .................. 81, 277, 278, 336 SAVEFILEDIALOG ................................. 130, 277 SCOPE VARIABLES ....................................... 170 SCRIPT ENGINE SETIINGS .............................. 80 SCRIPT MODULE .......................... l 72, l 73, 174 SCRIPT SCOPE .............................................. 170 SCRIPTMERGE ..................................... 19, 93, 94 SIGN SCRIPT .................................................... 9 2 SIGN ING .. .... ....... ... ......... ....... .... .... ............... .. . 83 SIGN ING ......... .... .... ... ..... ....... .... ........ .... ... ... .... 90 SIGNING WIZARD ........................................... 90 SINGLE THREADED APARTMENT ...81 , 155, 336 SN IPPET EDITOR ............................................ 121 SN IPPETS PANE ............................................. 121 SOURCE CONTROL SETTINGS ....................... 50 SOURCE CONTROL TAB ................................ 99 SPLITCONTAINER .................................. 130, 278 SPLITIER................................................. 130, 280 STA ............................................ 8 l , 8 2, l 55, 33 6 STAGING FOLDER ................................... ....... 89 STARTPOSITION ............................ 158, 159, 299 STARTUP.PSS ......................... 166, 168, 169, 172 STATUSBAR ....... ..................................... 130, 28 1 STATUSSTRIP .......................................... 130, 282

T TAB CONTROL TEMPLATE .................. .......... 149 TAB ORDER .............................................. . 72, 73

TA BCONTROL ....................... ............... 130, 284 TABLELAYOUTPANEL ........................... 131, 286 TEMP LA TES ............................................. 73, 138 TEXT BOX TEMPLATE ..................................... 150 TEXT BOX WITH SEARCH TEMPLATE ............ 151 TEXTBOX 81, 167, 192, 196, 208, 210, 219 , 220, 222,228, 268, 276, 277, 280, 28 1,287,288, 293, 307,315,317,336, 361, 507 TEXTBOX ....................................... 131, 133, 288 TIMER .................................................... 131, 289 TOO LBAR .............................................. 131, 292 TOOLBOX PANE ........................................... 125 TOOLS TAB ......................................................92 TOOLSTRIP ................................ ............ 131 , 293 TOOLTIP ................................. ............... 131 , 294 TRACEPOINTS ................................................. 61 TRACKBAR ............................................ 13 1, 295 TREEVIEW ...................... ......... ............... 131, 30 l

u UPDATES ........................................................ 104 USEMNEMON IC ................... 142, 342, 404, 461 USEWAITCURSORl 54, 342, 347, 356, 367, 374, 378,383, 404, 421,426, 431,436,451,456, 461,475,493,498,502,523,529,535,539, 545

v VER IFY SCRIPT ....................... ..........................9 7 VERSION INFORMATION ................................ 85 VERSIONRECALL .......... ...... 26, 51, 98, 100, 101 VIEWTAB ....................................................... 104 VSCROLLBAR ....................................... 132, 302

w WEBBROWSER ...... 303, 540, 542, 543, 544, 545 WEBBROWSER ....................... ............... 132, 303 WIZARD TEMPLATE ....................................... 152 WMI BROWSER ............................................. 114 WMI EXPLORER ............ ......... ... .......................98 WRAP COMMANDS ................ ....................... 39