20,212 questions
So when you click view report of going to URL winservera.adatum/localhost it's going to file:///C:/Users/Administrator/winservera.adatum/localhost
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a powershell script that loads computer names and displays a table of a few properties then converts it to an HTML file. One column I'm trying to get is hyperlinks so that when you click on it, it sends you to a url in the format of winserver.adatum$computername. The output however is appending it to the local path rather than creating the exact URL like so.
function Get-ComputerInfo{
BEGIN {}
PROCESS {
$computername = $_
$ComputerInfo = get-wmiobject win32_operatingsystem -ComputerName $computername | select-object -property @{l='Computer Name' ;e={$_.PSComputerName}},
@{l='Windows Edition' ;e={$_.Caption}},
@{l='Version' ;e={(Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ReleaseId}},
@{l='Build Number' ;e={$_.BuildNumber}},
@{l='Reporting' ;e={"<a href = 'winservera.adatum/$computername' > View Report </a>"}}
$Report = [pscustomobject] $ComputerInfo
$Report
}
END {}
}
Add-Type -AssemblyName System.Web
$Test = get-content computerlist.txt | Get-ComputerInfo | ConvertTo-Html -As Table -Head $header
[System.Web.HttpUtility]::HtmlDecode($Test) | Out-file ComputerList.html
So when you click view report of going to URL winservera.adatum/localhost it's going to file:///C:/Users/Administrator/winservera.adatum/localhost