Skip to content

Latest commit

 

History

History
 
 

ErrorAction-ignored

As expected, Get-ItemPropertyValue respects ErrorAction if a specified item does not exists.

But if a property of an existing item is missing then Get-ItemPropertyValue ignores ErrorAction. According to the tests, it writes terminating errors if it is called with try or trap. Otherwise it writes non-terminating errors.

The symptoms are similar to Errors-of-unusual-type. The test 2 error is caused by PSArgumentException "Property NonExistentProperty does not exist at ...". Presumably the cmdlet does not catch such exceptions in order to process them with WriteError().

Scripts