Need to alter existing script, not sure how.

Hello,

I'm a noob when it comes to scripting.  I have some experience with VBScripting but not much.

I found a great script from TheSurlyAdmin that is exactly what we are looking for to obtain specific disk info.  I also need a similar script to pull some additional information.

Below is the altered script to capture:

<#
.SYNOPSIS
    Simple tool to get disk information for a computer
.DESCRIPTION
    The purpose of this script is to give the Windows Administrator a simple, fast
    tool for viewing disk information for a computer or group of computers.
    
    For PowerShell 3.0 or higher users, only some properties are displayed by
    default.  If you want to see more or different values you can use Select.
    PowerShell 2.0 users will see all values.
.PARAMETER ComputerName
    List of computers that you want to get disk information for.
.PARAMETER ShowAll
    Use this parameter to have script show all properties
.INPUTS
    Text
.OUTPUTS
    Custom PS Object
        Computer*
        ReportDate*
        MachineType*
        SubtractedAmount*
        OperatingSystem*
        Version*
        TotalAllocation*
        FreeGB*
        FreeMB TotalAllocation*


              
        * In default view
.EXAMPLE
    .\Get-DiskSize.ps1 -ComputerName Server1
    
    Get disk information for Server1
.EXAMPLE
    .\Get-DiskSize.ps1 -ComputerName Server1,Server2 | Select Computer,Drive,FreeMB
    
    Get disk information for Server1 and Server2, but only display computer name,
    drive letter and free space in MB
.EXAMPLE
    .\Get-DiskSize.ps1 -ComputerName Server3 -ShowAll
    
    Get disk information for Server3, display all properties
.EXAMPLE
    Get-Content c:\scripts\servers.txt | .\Get-DiskSize.ps1 | Sort Computer,Drive | Format-Table
    
    Retrieve all server names from Servers.txt and get disk information.  Sort
    that information by Computer name and Drive letter and then send to Format-
    Table.  
.NOTES
    Author:         Martin Pugh
    Twitter:        @thesurlyadm1n
    Spiceworks:     Martin9700
    Blog:           www.thesurlyadmin.com
       
    Changelog:
        1.1         Added % Used and % Free properties
        1.0         Initial Release
.LINK
    community.spiceworks.com/.../2147-get-diskinfo
#>

#requires -version 2.0
[CmdletBinding()]
Param(
    [Parameter(Mandatory=$true,
        ValueFromPipeline=$true)]
    [String[]]$ComputerName,
    [switch]$ShowAll
)
Begin {
    $ServerResults = @()
    # Define an array for csv fragments
    $fragments = @()
    $fragmentsDetail = @()
    $vp = "V"
    $subtractedAmount = '80'
}

Process {
    ForEach ($Computer in $ComputerName)
    {   
    
    $Drives = $computer.group
    
    <#
    This is created to hold disk information used in the Server report
    #>
    
    $csvdetail = $drives | Select @{ Name = "Server"; Expression = { $computer.name } },
                                  @{ Name = "ReportDate"; Expression = { Get-Date -Format g } },
                                  @{ Name = "Drive"; Expression = { $_.DriveLetter } },
                                  @{ Name = "SizeGB"; Expression = { "{0:N2}" -f ($_.Capacity/1GB) } },
                                  @{ Name = "UsedGB"; Expression = { "{0:N2}" -f (($_.Capacity - $_.Freespace)/1GB) } },
                                  @{ Name = "FreeGB"; Expression = { "{0:N2}" -f ($_.FreeSpace/1GB) } }
        
    
    #Figure out how we're going to get the information.  PowerShell 2.0 does not support CIM so have to use
        #WMI.  PowerShell 3.0 supports CIM but not all servers support the WSMAN protocol.  So try that protocol
        #first (much faster) and if that doesn't work try DCOM.
        If ($PSVersionTable.PSVersion.Major -gt 2)
        {   Try {
                Write-Verbose "$($Computer): Attempting to connect using WSMAN..."
                $CimSession = New-CimSession -ComputerName $Computer -ErrorAction Stop
            }
            Catch {
                Write-Verbose "$($Computer): Unable to connect with WSMAN"
                Write-Verbose "$($Computer): Attempting to connect with DCOM..."
                $CimSession = New-CimSession -ComputerName $Computer -SessionOption (New-CimSessionOption -Protocol Dcom) -ErrorAction SilentlyContinue -ErrorVariable EV
            }
            If ($CimSession)
            {   Write-Verbose "$($Computer): Successfully connected using $($CimSession.Protocol)"
                Try {
                    $Servers = Get-WmiObject -Class Win32_volume -computer $computers -filter "drivetype=3 AND DriveLetter != NULL"
                }
                Catch {
                    Write-Warning "$($Computer): Unable to connect to computer because ""$($Error[0])"""
                    Continue
                }
            }
            Else
            {   Write-Warning "$($Computer): Unable to connect to computer because ""$($Error[0])"""
                Continue
            }
        }
        Else
        {   Write-Verbose "$($Computer): Powershell 2.0 or older detected on host, attempting to connect with WMI..."
            Try {
                $Servers = Get-WmiObject -Class Win32_volume -computer $computers -filter "drivetype=3 AND DriveLetter != NULL"
            }
            Catch {
                Write-Warning "$($Computer): Unable to connect to $Computer because ""$($Error[0])"""
                Continue
            }
        }
        
        $operatingSystem = Get-WmiObject -ComputerName $computer.Name -Class 'Win32_OperatingSystem'
         <# Section below is the required information for the report #>
        ForEach ($Server in $Servers)
        {    $ServerResults += New-Object psobject -Property @{
            Server = $computer.Name
            ReportDate = Get-Date -format g
            MachineType = ($vp)
            SubtractedAmount = $subtractedAmount
            OperatingSystem = $operatingSystem.caption
            Version = $operatingSystem.Caption + " " + $operatingSystem.Version
            TotalAllocation = "{0:N2}" -f (($Drives | Measure-Object Capacity -Sum).Sum/1GB)
            FreeGB = "{0:N2}" -f (($Drives | Measure-Object FreeSpace -Sum).Sum/1GB)
            UsedGB = "{0:N2}" -f ((($Drives | Measure-Object Capacity -Sum).Sum/1GB) - (($Drives | Measure-Object FreeSpace -Sum).Sum/1GB))
            BilledAllocation = "{0:N2}" -f ((($Drives | Measure-Object Capacity -Sum).Sum/1GB) - $subtractedAmount)
            
            }
        }
    
        
    <#  saving this to compare other needed items for above report --
        ForEach ($Server in $Servers)
        {   $DiskResults += New-Object PSObject -Property @{
                Computer = $Computer
                Drive = $Server.DeviceID
                CapacityGB = "{0:N2}" -f ($Server.Size / 1gb)
                CapacityMB = "{0:N2}" -f ($Server.Size / 1mb)
                CapacityRaw = $Server.Size
                UsedGB = "{0:N2}" -f (($Server.Size - $Server.FreeSpace) / 1gb)
                UsedMB = "{0:N2}" -f (($Server.Size - $Server.FreeSpace) / 1mb)
                UsedPercent = "{0:P0}" -f (($Server.Size - $Server.FreeSpace) / $Server.Size)
                UsedRaw = ($Server.Size - $Server.FreeSpace)
                FreeGB = "{0:N2}" -f ($Server.FreeSpace / 1gb)
                FreeMB = "{0:N2}" -f ($Server.FreeSpace / 1mb)
                FreePercent = "{0:P0}" -f ($Server.FreeSpace / $Server.Size)
                FreeRaw = $Server.FreeSpace
                VolumeName = $Server.VolumeName
            }
        }
    --#>
    }
}
 
End {
    $ServerResults = $ServerResults | Select Server,ReportDate,MachineType,SubtractedAmount,OperatingSystem,Version,TotalAllocation,FreeGB,UsedGB,BilledAllocation
    If (-not $ShowAll)
    {   #PowerShell 3.0 only, set a default view of only a few items.  
        $ServerResults | Add-Member MemberSet PSStandardMembers ([System.Management.Automation.PSMemberInfo[]]@(New-Object System.Management.Automation.PSPropertySet("DefaultDisplayPropertySet",[String[]]@("Server","ReportDate","MachineType","SubtractedAmount","OperatingSystem","Version","TotalAllocation","FreeGB","UsedGB","BilledAllocation"))))
    }

    $ServerResults
}