making a network share clickable.

by fwhorf at 2012-09-17 10:24:57

Hi my first post.

I’m trying to make the network path “fullname” clickable the closest I’ve come is

@{Label=“fullname”;Expression={ ‘<a href=“http://powershell.com/requests.ps1x?PID=$($.PID)&fullname=$($.fullname)”>$($_.fullname)</a>’ }}

I’m just showing a list where the profile is found. I’d like to be able to click on the Fullname link to rename the found folder.

Thank you,
Frank

Script
$a = “<style>”
$a = $a + “BODY{background-color:peachpuff;}”
$a = $a + “TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}”
$a = $a + “TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}”
$a = $a + “TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:PaleGoldenrod}”
$a = $a + “</style>”


$Profilename = null
$Profilename = Read-Host ‘What is the Profile Name? use * for wild card’ # Prompts for Server Name
$Profilename = $Profilename + "*"
cls

$path_m = ‘\network\one’
$path_n = ‘\network\two’
$path_o = ‘\network\three’
$path_p = ‘\network\four’
$path_q = ‘\network\five’
$path_r = ‘\network\six’
$path_s = ‘\network\seven’
$path_t = ‘\network\eight’

$m = Get-childitem -Path $path_m,$path_n,$path_o,$path_p,$path_q,$path_r,$path_s,$path_t -Filter $Profilename |select name,lastwritetime,fullname | ConvertTo-HTML -head $a -body “<H2>Citrix Profile Locations</H2>” | Out-File C:\Test.htm

invoke-Expression C:\Test.htm
by poshoholic at 2012-09-17 10:40:17
I don’t think ConvertTo-Html will allow you to set hyperlinks as part of the HTML it generates. In my testing, any HTML you try to put in manually gets converted to text by using escape characters in the HTML that is generated. Given that is the case, if you want to set up links your best bet would probably be to generate the html manually (i.e. without using ConvertTo-Html) or use ConvertTo-Html and then perform a string replace on the generated content to convert the column you want to be a hyperlink into hyperlink format.
by fwhorf at 2012-09-18 07:32:28
Thank Kirk, I appreciate your help. Would you or anyone else happed to have an example?

Best Regards,
Frank