• cmille19 (1/8/2009)


    There are some extra returns in the code in the article. Try this instead (notice the line breaks are different):

    param ( [string]$ComputerName = "." )

    Get-WmiObject -computername "$ComputerName" Win32_LogicalDisk -filter "DriveType=3" |

    foreach { add-member -in $_ -membertype noteproperty UsageDT $((Get-Date).ToString("yyyy-MM-dd"))

    add-member -in $_ -membertype noteproperty SizeGB $([math]::round(($_.Size/1GB),2))

    add-member -in $_ -membertype noteproperty FreeGB $([math]::round(($_.FreeSpace/1GB),2))

    add-member -in $_ -membertype noteproperty PercentFree $([math]::round((([float]$_.FreeSpace/[float]$_.Size) * 100),2)) -passThru } |

    Select UsageDT, SystemName, DeviceID, VolumeName, SizeGB, FreeGB, PercentFree

    Thanks...though its so silly this article is still not updated, to get a 5 start rating known issue should have been fixed and a full set of files should have been attached for anyone to try quickly...

    So i am able to export, lets see how does import do...

    Prakash

    Prakash Heda
    Lead DBA Team - www.sqlfeatures.com
    Video sessions on Performance Tuning and SQL 2012 HA