Hi Guys,
I have written up a small disk space report script to show me disk space status on my servers. Nothing ground-breaking but it does what I need it to do. It works perfectly in the console when I run it however, now I want it to output to an HTML file and eventually send it to me on a weekly basis.
Somehow I just cant get it to output into a readable format, it seems to show up some machine code characters. Once I get the output working, I can write up the code to send an email to me which would be quite simple, but I need to fix this output issue first!
Any ideas?
I will continue to search the internet for similar issues but thought I’d ask here as well…
Here is my script
Get-WmiObject win32_logicaldisk -ComputerName $servers -Credential $cred -Filter "drivetype=3" | select PSComputerName,Name,FileSystem,VolumeName, @{n="Free Space in GB";e={[math]::truncate($_.freespace / 1GB)}},@{n="Size of Disk";e={[math]::truncate($_.size/ 1GB)}} | Format-table -GroupBy PSComputerName | ConvertTo-Html -CssUri 'C:\powershell\Scripts\Disk Size\style.css' -Title "Disk Report" | Out-File C:\Atkins\disk.html
-A