.png)
The Winter Scripting Games 2013 started last week with the first practice event.
Unfortunately for me, I was not able to post my script on time. The first Practice event was due on the Tuesday, 5th of February... 11:59 PM GMT! I assume I had until midnight my time..... (My timezone is East GMT-5)
;-(
Summary: Practice Event 1 - Sizing up the Disks
You have been asked to create a Windows PowerShell advanced function named Get-DiskSizeInfo. It must accept one or more computer names, and use WMI or CIM to query each computer. For each computer, it must display the percentage of free space, drive letter, total size in gigabytes, and free space in gigabytes. If a specified computer cannot be contacted, the function must log the computer name to C:\Errors.txt and display no error message.
Minimum Requirements
Optional Criteria
- Display optional verbose output showing the computer name being contacted
My Script
Function Get-DiskSizeInfo {
<#
.DESCRIPTION
Check the Disk(s) Size and remaining freespace.
.PARAMETER ComputerName
Specify the computername(s)
.INPUTS
System.String
.OUTPUTS
System.Management.Automation.PSObject