MOL PS Toolmaking: where is Lab 4.6 file?

This topic contains 1 reply, has 1 voice, and was last updated by  Jeff Taylor 6 months, 1 week ago.

  • Author
  • #84269

    Jeff Taylor

    the advice is "grab the file from Morelunches" but it is not included in the downloaded.

  • #84271

    Jeff Taylor

    I typed it out (it works) but found some typos in the original (There was no ` after {$OK=$True})

    Function Get-DiskInfo {
        Param (
            $disks=Get-WmiObject -Class Win32_Logicaldisk -Filter "Drivetype=3"
                foreach ($disk in $disks) {$perFree=($disk.FreeSpace/$disk.Size)*100;
                if ($perFree -ge $MinimumFreepercent) {$OK=$True}`
                else {$OK=$False};$disk|Select DeviceID,VolumeName,Size,FreeSpace,`

    Does this look like acceptable formatting per the book?

You must be logged in to reply to this topic.