Powershell GUI fronted (WPF) to run categorized console scripts

⌈⌋ ⎇ branch:  ClickyColoury


Check-in [b78ab94f09]

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

Overview
Comment:Support for RTF and XAML news files.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b78ab94f092387aece8284483148ecea9e75d3a4
User & Date: mario 2018-05-16 18:04:53
Context
2018-05-16
18:05
Rewrite WMI output into GB. check-in: 20dd6899aa user: mario tags: trunk
18:04
Support for RTF and XAML news files. check-in: b78ab94f09 user: mario tags: trunk
18:04
add Out-DisplayDispatch for bulk plugins. add Create-RegPath check-in: f01ce7ec89 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tools/plugins/init_intro.ps1.

1
2
3
4
5
6
7
8
9
10
11
12
13

14
15








16





17
18




19















20
# api: ps
# title: init screen
# description: writes something on the Output window on startup
# version: 0.0.4
# type: init-gui
# depends: wpf
# category: misc
# hidden: 1
# priority: core

if ($GUI.w -and !$CLI) {

    # combine version of all scripts

    $sigma_ver = ($menu | % { $_.version } | ? { $_ -match "\d" } | % { $_ -replace "-.+$","" -replace "\D","" } | Measure -Sum).Sum -replace "(?<=\d)(?!$)","."









    # output





    Out-Gui -f Yellow -b "#223388" "ClickyColoury frontend to Multi-Tools  Σ ≈ $sigma_ver"
    Out-Gui -f "#88bb22" " ✉ New user interface, Powershell 5 compatible"




    Out-Gui -f "#88bb22" " ✉ Color clipboard not fully ported"















}


|
|






<

<
>
|

>
>
>
>
>
>
>
>
|
>
>
>
>
>

|
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# api: ps
# title: init screen
# description: writes stats+MOTD into output window on startup
# version: 0.5
# type: init-gui
# depends: wpf
# category: misc
# hidden: 1
# priority: core




#-- some stats
$sigma_ver = ($menu | % { $_.version } | ? { $_ -match "\d" } | % { $_ -replace "-.+$","" -replace "\D","" } | Measure -Sum).Sum -replace "(?<=\d)(?!$)","."

#-- load RTF over temporary FlowDocument
function Load-RTF($fn) {
    $temp = WD FlowDocument
    $tr = New-Object System.Windows.Documents.TextRange -ArgumentList @($temp.ContentStart,$temp.ContentEnd)
    $fs = [System.IO.FileStream]::new($_, "Open")
    $tr.Load($fs, "Rich Text Format");
    $fs.close()
    ForEach ($b in (@()+@($temp.Blocks))) {
        $GUI.output.Blocks.Add($b)
    }
}

#-- only text output
if ($cfg.main.version -lt "0.9") {
    Out-Gui -f Yellow -b "#223388" "ClickyColoury frontend to Multi-Tools  Σ ≈ $sigma_ver"
    Out-Gui -f "#88bb22" (Get-Content data/motd.txt | Out-String)
}
#-- clicky >= 0.9
else {
    # header
    Out-Gui -xaml @"
    <Paragraph xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>
       <Paragraph.Background><LinearGradientBrush><GradientStop Color="#112233" Offset="0.5"/><GradientStop Color="#112288" Offset="0.0"/></LinearGradientBrush></Paragraph.Background>
       <Run Foreground="#ccaa44" FontSize="36" FontFamily="Verdana">Clicky 0.9</Run><LineBreak/>
       <Span Foreground="Gray">ui = <Run Foreground="White">1.2.0</Run> / tools Σ ≈ <Bold Foreground="White">$sigma_ver</Bold></Span>
       <!--Figure Width="200" HorizontalAnchor="ContentLeft" >
         <BlockUIContainer>
           <Path StrokeThickness="40" Stroke="#FFEF8900" HorizontalAlignment="Center" Margin="50,20,0,20" Data="M30,10 A1,1 0 0 0 20,70" />
         </BlockUIContainer>
       </Figure-->
    </Paragraph>
"@
    # extra message files
    dir data/MOTD*.txt | % { Out-Gui -f "#88bb22" (Get-Content -Raw $_) }
    dir data/MOTD*.xaml| % { Out-Gui -XAML (Get-Content -Raw $_) }
    dir data/MOTD*.rtf | % { Load-RTF $_ }
}