Get Hardware Definitions
The following examples get the configured hardware definitions.
- Connect to the administration web service.
Code Sample
# Gets all hardware definitions.
$hardwareDefinitions = $administration.GET_HardwareDefinitions();
foreach ($hardwareDefinition in $hardwareDefinitions.HardwareDefinition)
{
Write-Host $hardwareDefinition.DisplayName;
Write-Host $hardwareDefinition.Identifiers.Manufacturers;
Write-Host $hardwareDefinition.Identifiers.Models;
Write-Host
}
# Get the hardware definition with the specified identifier.
$hardwareDefinition = $administration.GET_HardwareDefinition("e1fa7db7-6f47-423e-befa-efb32875e193");
Write-Host $hardwareDefinition.DisplayName;
Write-Host $hardwareDefinition.Identifiers.Manufacturers;
Write-Host $hardwareDefinition.Identifiers.Models;
Write-Host
# Get the hardware definition for the specified manufacturer and model.
$hardwareDefinition = $administration.GET_HardwareDefinitionByIdentifiers("Hewlett-Packard", "D6000");
if ($hardwareDefinition -eq $null) { Write-Host "No definition was found"; }
else
{
Write-Host $hardwareDefinition.DisplayName;
Write-Host $hardwareDefinition.Identifiers.Manufacturers;
Write-Host $hardwareDefinition.Identifiers.Models;
Write-Host
}
# Get the image for the hardware definition.
$binaryData = $administration.GET_HardwareDefinitionImage("e1fa7db7-6f47-423e-befa-efb32875e193");
[System.IO.File]::WriteAllBytes("C:\temp\image.png", $binaryData);