Powershell GUI fronted (WPF) to run categorized console scripts

⌈⌋ ⎇ branch:  ClickyColoury


Check-in [ef70674889]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Sample plugin, warning message for `# confirm: 1` meta flag. (Used for server restarts, or more involved delete operations, e.g.)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ef7067488933e0042a2624248fb38a582b41f852
User & Date: mario 2018-04-22 19:32:30
Context
2018-04-22
19:36
text file fixup (evil Notepad!!) check-in: bec07bd1d8 user: mario tags: trunk
19:32
Sample plugin, warning message for `# confirm: 1` meta flag. (Used for server restarts, or more involved delete operations, e.g.) check-in: ef70674889 user: mario tags: trunk
19:26
Whitespace: CSS got ignored by MSIE target, thus use normal CRLF-to-BR conversion at all times. check-in: 05738ae271 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added tools/plugins/plugin_before_confirm.ps1.



































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# api: multitool
# title: dangerous action confirmation
# description: prompt prior executing irreversible scripts
# type: init 
# category: plugin
# state: beta
# priority: standard
# version: 0.1
# confirm: 1
# config: -
#
# Brings up a warning for scripts qualified with any of the meta flags:
#
#   # danger: 1
#   # confirm: 1
#   # cagegory: server
#
# Cancels the according script prior exection by overriding $e.command
#


#-- register as plugin before script start
$plugins.before += {
    if (($e.danger, $e.confirm, $e.dangerous, $e.category) -match "1|true|yes|server|danger") {
        $title = $e.title +  " / " + $e.description
        $OK = [System.Windows.MessageBox]::Show("Proceed with '$title'?", "Danger, Will Robinson!", "OKCancel", "Warning")
        if ($OK -ne "OK") {
            $e = @{
                command = 'Write-Host -f Red "Cancelled."'
            }
        }
    }
}