Testing Property values

Test if a property of the given object matches a specified value. Returns true if the test succeeds and false in case of failure.


Hint: The execution of these examples requires a connected PowerShell drive.

The following example tests if the property "ComputerType" of Computer "WIN10-01" contains the value "Laptop":

Test-EmdbPropertyValue "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\Production\Workstations\WIN10-01" -Property "Computer.ComputerType" -Value "Laptop"

Note: in the current PSX-version 4.0 you have to specify the Property-groupname and the Property-name (separated via a dot) as you can look up in the Property definition.

In the next example, a test should be performed, if all Computers from the list "List.txt" are activated:

Get-Content C:\temp\List.txt | Get-EmdbComputer -Recurse | Test-EmdbPropertyValue -Property "Computer.OperationMode" -Value 1

Finally we test, if the Software Package "Java SE 8.0 Update 66" has already been released:

$MyPackage = Get-EmdbSoftwarePackage "Java SE 8.0 Update 66" -Recurse

Test-EmdbPropertyValue -Path $MyPackage.Path -Property "Software.ReleaseStatus" -Value 1