Ola pessoal,
Hoje vamos ver como fazer relatórios HTML simples utilizando o PSHTML.
Install-Module -Name PSHTML -Scope CurrentUser
$Processes = Get-Process
$HTML = html{
head{
$css = @"
table, td, th {
border: 2px solid black; border-collapse: collapse;
}
"@
style { $css } -type 'text/css'
}
body{
h4 'Esta é uma lista de Processos'
hr
Table -Content {
tr -Content {
th -Content 'Name'
th -Content 'CPU'
}
tr -Content {
Foreach($Process in $Processes){
tr -Content {
Td -Content { $Process.Name }
Td -Content { $Process.CPU }
}
}
}
}
}
}
$HTML | Out-File -FilePath $ENV:USERPROFILE\Desktop\teste.html
Invoke-Item -Path $ENV:USERPROFILE\Desktop\teste.html
Dúvidas? Sugestões? Comente!
Até a próxima!
1 Comment
I have one for you
server inventory:
server name/OU/version
cpu count
memory
HDD (list each one)(and size)
administrators (groups under local admins)
IP address and DNS servers