Disk space from bulk computers

Welcome Forums General PowerShell Q&A Disk space from bulk computers

  • This topic has 1 reply, 2 voices, and was last updated 2 weeks ago by
Viewing 1 reply thread
  • Author
    • #229429
      Topics: 9
      Replies: 12
      Points: 138
      Rank: Participant



      I’ve got the script which provides disk space on remote computers:

      Get-CimInstance -ClassName Win32_LogicalDisk -ComputerName PC1 -Filter DriveType=3 |
      Select-Object DeviceID,
      @{'Name' = 'Size (GB)'; 'Expression' = { [string]::Format('{0:N0}', [math]::truncate($_.size / 1GB)) } },
      @{'Name' = 'Free (GB)'; 'Expression' = { [string]::Format('{0:N0}', [math]::truncate($_.freespace / 1GB))}},
      @{'Name' = '(%)'; 'Expression' = { [string]::Format('{0:P}', $_.freespace / $_.Size )}}

      how can i use it on a bulk computers? better to export a csv file for better visual results.

      I’ve tried coma separate on the computer name but it didn’t work.


      Thanks in advanced.

    • #229435
      Topics: 4
      Replies: 2249
      Points: 5,494
      Helping Hand
      Rank: Community MVP

      … but it didn’t work.

      What exactly does that mean? I’d recommend to add a property to get the name of the computer but an array for the parameter -ComputerName works just fine.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.