Get-OMEDeviceDisks.ps1
#aliases for table functions function Get-OMEDeviceDisks { <# .SYNOPSIS Gets information about the device disks. .DESCRIPTION Gets information about the device disks. Alias for the Get-OMEDeviceInventory -Table 3 .PARAMETER Id Query inventory for the device with the specific Id. .PARAMETER Name Query inventory for the device with the specific Name. .PARAMETER AssetTag Query inventory for the device with the specific Asset Tag. .PARAMETER ServiceTag Query inventory for the device with the specific Service Tag. .PARAMETER Session Specifies the Session Id for the OME server. .EXAMPLE Get-OMEDeviceDisks -Session $session -Name server45.example.com ArrayDiskUsedSpace : 558 ArrayDiskEnclosureId : Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1 ArrayDiskFreeSpace : 0 ArrayDiskMediaType : Hard Disk Drive ArrayDiskChannel : 0 ArrayDiskNumber : 3 ArrayDiskVendorName : SEAGATE ArrayDiskLength : 558 DeviceId : 325 ArrayDiskSerialNumber : 6DF4545FG ArrayDiskModelNumber : ST9600205SS ArrayDiskStatus : OK ArrayDiskBusType : SAS ArrayDiskTargetId : 2 ArrayDiskRevision : CS09 .NOTES Author: Mike Khar .LINK http://www.dell.com/support/home/us/en/04/product-support/product/dell-openmanage-essentials-v2.2/research https://$Server:$Port/api/OME.svc/$DeviceID/TableInventory/3 #> [CmdletBinding(DefaultParametersetName="Id" )] Param( [parameter(Mandatory=$true,ParameterSetName="Id",ValueFromPipeline=$true)] $Id, [parameter(Mandatory=$true,ParameterSetName="Name")] [String]$Name, [parameter(Mandatory=$true,ParameterSetName="AssetTag")] [String]$AssetTag, [parameter(Mandatory=$true,ParameterSetName="ServiceTag")] [String]$ServiceTag, $Session="OMEConnection.DefaultOMESession" ) Begin { $CurrentSession = Get-Variable -Scope Global -Name $Session -ErrorAction SilentlyContinue -ValueOnly If (!$CurrentSession) { Write-Warning "Please use Set-OMEConnection first" Break Return } else { $BaseUri="https://"+$CurrentSession.Server+":"+$CurrentSession.Port+"/api/OME.svc" } } Process { $string="Get-OMEDeviceInventory -Session $Session -Table 3" if ($Id) { $string+=' -Id $Id' } if ($Name) { $string+=' -Name $Name' } if ($AssetTag) { $string+=' -AssetTag $AssetTag' } if ($ServiceTag) { $string+=' -ServiceTag $ServiceTag' } if ($Credentials) { $string+=' -Credentials $Credentials' } return Invoke-Expression $string } End{} } |