Please see the following example:
[pre]@{Name=“ExpiryDate”;Expression={[DateTime]::FromFileTime($_.“msDS-UserPasswordExpiryTimeComputed”)}}[/pre]
outputs something like this: “7/5/2019 6:23”
what I would like is “7/5/2019”
Any form of help / suggestions are highly appreciated.
Thank you.
Olaf
2
If you have a DateTime object you can use all its methods and properties. You can show them like this:
Get-Date | Get-Member
There you can see something like “ToShortDateString”. Adapted to your code snippet this would lead to something like this:
@{Name=“ExpiryDate”;Expression={([DateTime]::FromFileTime($_.“msDS-UserPasswordExpiryTimeComputed”)).ToShortDateString()}}