user interface - How to creat clickable links from a list in powershell GUI -


i writing powershell tool friend him manage more server checks. have folder store daily logfiles. want option tool lists files , can click on , opens automatically.

this code reads folder:

function reportlist {     $reportfiles = $psscriptroot + "\reports\"     $reportlist = get-childitem -path $reportfiles     foreach ($report in $reportlist)     {         $outputbox.text += "" + $report + "`n"      }  } 

so read files using get0chiditem , stuff whole thing textbox line line. , how looks in gui window ( can't post images)

report_1_date_xx_xx_xxxx.html report_2_date_xx_xx_xxxx.html report_3_date_xx_xx_xxxx.html report_4_date_xx_xx_xxxx.html report_5_date_xx_xx_xxxx.html 

these files turn links in html example. possible achieve gui? when list different windows propertys in textbox result appears link don't know how written. how great.

here how create de output box. rich textbox

$outputbox = new-object system.windows.forms.richtextbox  $outputbox.location = new-object system.drawing.size(400,40)  $outputbox.size = new-object system.drawing.size(600,500)  $outputbox.multiline = $true  $outputbox.scrollbars = "vertical"  $outputbox.font = "courier new" $form.controls.add($outputbox)  

as ui genertaion, every object defined similar way. not using xaml method (i'v seen way creat powershell gui)

this definition of main form:

$form = new-object windows.forms.form $form.size = new-object system.drawing.size(1050,600) $form.showdialog() 

take @ out-gridview cmdlet. know not hyperlink, think creates result want.

$data = 1..10  $data | foreach-object{set-content -value $_  -path "$_.txt"}  get-childitem *.txt | out-gridview -passthru | %{& $_} 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -