Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Display output in HTML

$
0
0

Hello Guys,

Am new to powershell, i have the below script to find the directory space. 

My requirement: 

1. I need to display the output (diskspace in GB) in a HTML format.

2. The HTML will display the output as a pie chart or bar chart. (indicates in red or green respectively if it cross particular disk size)

3. HTML with header and with time and date it generated the report.

 

Please help in assisting. 

 

write-host "- $directory" -foreground "GREEN"
[string]$result = robocopy.exe /b /l /mir "
\\Server\directory" "C:\temp" /r:0 /w:0 /ns /nc /nfl /ndl /njh /Bytes

if (!($lastexitcode -eq 16))
{
$pos = ($result).indexof("Bytes : ")
$start = $pos + 8
$length = $result.length
$end = $length - $start
$newstring = ($result).substring($start,$end) 
$newstring = $newstring.trim()
$result = $newstring.split()[0]
echo $result

$final = [math]::round($result /1Gb, 3)

echo $final

}
else
{
echo "CANNOT ACCESS"
}


Viewing all articles
Browse latest Browse all 6937

Trending Articles