-computername $hostname -errorvariable errorvar
if (-not $errorvar)
{
foreach ($drive in $drives)
{
if ($drive.drivetype -eq “3” )
{
$message= “DeviceID=”+$drive.Deviceid+” Size=”+
Conclusion
This is the fourth part of the article series “Check your SQL Server using Windows PowerShell”. The article illustrated how
to access the hard disk and network card adapter information using Windows
PowerShell and WMI-Object.