Powershell GUI fronted (WPF) to run categorized console scripts

⌈⌋ ⎇ branch:  ClickyColoury


Check-in [f01ce7ec89]

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

Overview
Comment:add Out-DisplayDispatch for bulk plugins. add Create-RegPath
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f01ce7ec89d8e0c61d39225556d40be3385e8dfc
User & Date: mario 2018-05-16 18:04:24
Context
2018-05-16
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
18:03
Fix plugin filters (api check for user plugins, separate NotFilter). Better init plugin stacktrace. check-in: 04cf6b4bca user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tools/plugins/funcs_base.ps1.

139
140
141
142
143
144
145
146
147
148
149
150




































    if ($path -match "^\\\\(\w+)\\(\w+)\\(.+)\\([^\\]+)$") {
        $R = Open-RemoteRegistry -machine $matches[1] -hive $matches[2] -path $matches[3] -Silent
        $R.setValue($matches[4], $value, $type)
    }
}
function Get-RemoteRegistry {
    Param($path = "\\localhost\HKLM\SOFTWARE\Etc\Key")
    if ($path -match "^\\\\(\w+)\\(\w+)\\(.+)\\([^\\]+)$") {
        $R = Open-RemoteRegistry -machine $matches[1] -hive $matches[2] -path $matches[3] -writemode $false -Silent
        return $R.getValue($matches[4])
    }
}











































|




>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
    if ($path -match "^\\\\(\w+)\\(\w+)\\(.+)\\([^\\]+)$") {
        $R = Open-RemoteRegistry -machine $matches[1] -hive $matches[2] -path $matches[3] -Silent
        $R.setValue($matches[4], $value, $type)
    }
}
function Get-RemoteRegistry {
    Param($path = "\\localhost\HKLM\SOFTWARE\Etc\Key")
    if ($path -match "^\\\\([\w-]+)\\(\w+)\\(.+)\\([^\\]+)$") {
        $R = Open-RemoteRegistry -machine $matches[1] -hive $matches[2] -path $matches[3] -writemode $false -Silent
        return $R.getValue($matches[4])
    }
}

#-- add and open nested registry paths
function Create-RegPath($r, $path) {
    ForEach ($key in $path.split("[\\//]+")) {
        if ($next = $r.OpenSubKey($key)) {
            $r = $next;
        }
        elseif ($r = $r.CreateSubKey($key)) {
        }
        else {
            return $null
        }
    }
    $r
}



#-- output variants (Table|HTML|CSV|List|Grid)
function Out-DisplayDispatch {
    Param(
        $result = @(),
        $display = $cfg.gridview,
        $export_fn = "P:\temp.txt",
        $width = 250
    )
    # if ($export_fn -notmatch ":\\") {...}
    switch -regex ($display) {
        "Table" {  $result | FT -Wrap | Out-String -Width $width | Write-Host  }
        "HTML"  {  Set-ClipboardHtml ($result | ConvertTo-Html);  Write-Host -f Green "☛ Clipboard set"  }
        "CSV"   {  $result | Export-CSV $export_fn -Delimiter ";" -Encoding UTF8;  Write-Host -f Green "Saved to $export_fn"  }
        "List"  {  $result | FL | Out-String | Write-Host  }
        "Grid"  {  $result | Out-GridView  }
    }
}