How-to guides¶
Task-oriented recipes for the NativeHTMLKit PowerShell SDK 0.1.2 (module NativeHTMLKit, Core
1.0.3). New to the SDK? Start with getting started and the
todo tutorial. Exact syntax is in the cmdlet reference.
| Guide | You want to... |
|---|---|
| Application lifecycle | structure a script: start, ready, wait, quit, close; ask before quitting; save on shutdown |
| Events and callbacks | react to clicks and typing; delegate events; understand closures and scope |
| Updating the page | change text, attributes and classes; render lists safely; batch updates; nodes without ids |
| Forms and validation | read form values, use HTML validation, add your own rules |
| Windows | open several windows, keep per-window state, veto closing |
| Native file dialogs | let the user open, save or choose a folder |
| HTML dialogs and popovers | show modal <dialog>s and popover elements |
| Clipboard and desktop | copy and paste text, open links and files, read desktop preferences |
| Keyboard and focus | add shortcuts, stop default key actions, move the focus, work with the caret |
| Styling and layout | lay out an app window, use stylesheets and dark mode, know what HTML/CSS the host supports |
| Live bitmaps | draw charts or images from PowerShell pixels |
| Background work | run slow work without freezing the window; progress, cancel, timers, several jobs |
| Diagnostics and troubleshooting | find out why something does not happen; collect a support bundle |
| Packaging and distribution | ship an app to users, with or without the PowerShell Gallery |
| Project scaffolding | generate a multi-file project and its manifest |
| Security | handle untrusted text, HTML, files and secrets safely |
PowerShell-specific:
| Guide | You want to... |
|---|---|
| Windows PowerShell 5.1 and PowerShell 7 | write scripts that run unchanged on both editions |
Every guide links to runnable applications in the examples.
Source: nativehtmlkit-powershell/docs/guides/README.md ยท edit the page there.