I'm a PowerShell noob.
I have a look-up table wherein there is an Attribute called PW_Email. Ultimately, I want to capture the value of that attribute as a variable in a FOREACH.
Here's my FOREACH so far:
FOREACH ($i in $lookuptable) { $Document = Get-PWDocumentsByGUIDs -DocumentGUIDs $i.DocumentGUID }
So, $Document.Attributes then returns:
Key Value --- ---- PW_Email JDoe@ACME.com
I think I need to finish the following to include in the FOREACH::
$EmailAddress = $Document.Attributes.Where(
Am I close? Can anyone help me to fill in the blanks?
Thanks in advance for any help,
$Document.Attributes is a Sorted List while $Document.CustomAttributes is a HashTable. Using the HashTable you can select the value of the PW_Email attribute for the document with the code below.
$EmailAddress = $Document.CustomAttributes['PW_Email']
Answer Verified By: Jeff Bowlin
Thank you! Just what I needed.
Jeff