HI Team,
In below the script is generating output in HTML format. which looks good but in here I tried to get the hyperlink in Action Tab & which will invoke the command corresponding to same machine for same app pool for which it is targeting.

Script Details.
Sumeet Gill
$Header = @'
<Title>App Pools Status</Title>
<style>
body { background-color:#E5E4E2;
font-family:Monospace;
font-size:10pt; }
td, th { border:0px solid black;
border-collapse:collapse;
white-space:pre; }
th { color:white;
background-color:black; }
table, tr, td, th { padding: 2px; margin: 0px ;white-space:pre; }
tr:nth-child(odd) {background-color: lightgray}
table { width:95%;margin-left:5px; margin-bottom:20px;}
h2 {
font-family:Tahoma;
color:#6D7B8D;
}
.footer
{ color:green;
margin-left:10px;
font-family:Tahoma;
font-size:8pt;
font-style:italic;
}
</style>
'@
$sb = {
Try{
Import-Module WebAdministration -ErrorAction Stop
Get-ChildItem IIS:\AppPools -ErrorAction Stop
}
catch{
Write-Host $_ -ForegroundColor Green
}
}
Get-Content C:\WebSite\ServerBaseAppstatus\Machines.txt |
ForEach-Object{
Invoke-command -ComputerName $_ -ScriptBlock $sb -ArgumentList $machine -ErrorAction SilentlyContinue
} |
Select-Object PsComputerName, name, State, ManagedRuntimeVersion, Action |
ConvertTo-Html -Head $Header |
Out-File -FilePath C:\WebSite\ServerBaseAppstatus\Machines.html