# Weird behavior when using psversiontable with 'Get-GPO'

**URL:** <https://forums.powershell.org/t/weird-behavior-when-using-psversiontable-with-get-gpo/14836>\
**Category:** PowerShell Help\
**Created:** [August 20, 2020, 8:16pm UTC](https://forums.powershell.org/t/weird-behavior-when-using-psversiontable-with-get-gpo/14836 "2020-08-20T20:16:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexw](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/alexw/32/74_2.png) [@alexw](https://forums.powershell.org/u/alexw)\
**Post date:** [August 20, 2020, 8:16pm UTC](https://forums.powershell.org/t/weird-behavior-when-using-psversiontable-with-get-gpo/14836/1 "2020-08-20T20:16:52Z")

</div>

I stumbled upon this weird behavior, I wanted to show the powershell version and then grab GPO info.  
When I append $psversiontable, I get a super funky output  
I tested this on a Windows Server 2019 , 1809 box.

```
$psversiontable;get-gpo 'ad logging' 
# vs 
get-gpo 'ad logging'
```

When I run it with the $psversiontable, it is not showing the User or computerversion.

```
PS C:\Users\Administrator> 
$psversiontable;get-gpo 'ad logging'

Name Value
---- -----
PSVersion 5.1.17763.592
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.592
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Id : a4ff4b99-3712-4c3c-90cb-93621b24711f
DisplayName : AD Logging
Path : cn={A4FF4B99-3712-4C3C-90CB-93621B24711F},cn=policies,cn=system,DC=ad,DC=test,DC=com
Owner : AD\Domain Admins
DomainName : ad.test.com
CreationTime : 8/20/2020 9:05:17 PM
ModificationTime : 8/20/2020 9:09:50 PM
User : Microsoft.GroupPolicy.UserConfiguration
Computer : Microsoft.GroupPolicy.ComputerConfiguration
GpoStatus : AllSettingsEnabled
WmiFilter :
Description :

PS C:\Users\Administrator> 
get-gpo 'ad logging'

DisplayName : AD Logging
DomainName : ad.test.com
Owner : AD\Domain Admins
Id : a4ff4b99-3712-4c3c-90cb-93621b24711f
GpoStatus : AllSettingsEnabled
Description :
CreationTime : 8/20/2020 9:05:17 PM
ModificationTime : 8/20/2020 9:09:50 PM
UserVersion : AD Version: 0, SysVol Version: 0
ComputerVersion : AD Version: 13, SysVol Version: 13
WmiFilter :
```

Does anyone have the same weird behavior or has seen this before?

---

<div class="post-metadata">

**Author:** ![alex-aymonier](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@alex-aymonier](https://forums.powershell.org/u/alex-aymonier)\
**Post date:** [September 7, 2020, 8:44pm UTC](https://forums.powershell.org/t/weird-behavior-when-using-psversiontable-with-get-gpo/14836/2 "2020-09-07T20:44:28Z")

</div>

The 3 most important cmdlets in PowerShell are `Get-Command, Get-Help and Get-Member` Try piping the output to `Get-Member` at the end of either line and see what is returned.

---

<div class="post-metadata">

**Author:** ![js2010](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@js2010](https://forums.powershell.org/u/js2010)\
**Post date:** [September 8, 2020, 4:55am UTC](https://forums.powershell.org/t/weird-behavior-when-using-psversiontable-with-get-gpo/14836/3 "2020-09-08T04:55:32Z")

</div>

Funny things happen when combining the output of multiple commands. Format-table runs in the background and doesn’t handle it exactly the way you’d expect. I think pipe the second one to format-list \* to see all the properties.

---

<div class="post-metadata">

**Author:** ![kvprasoon](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/kvprasoon/32/4449_2.png) [@kvprasoon](https://forums.powershell.org/u/kvprasoon)\
**Post date:** [September 8, 2020, 10:08am UTC](https://forums.powershell.org/t/weird-behavior-when-using-psversiontable-with-get-gpo/14836/4 "2020-09-08T10:08:17Z")

</div>

This behavior is because of the formatting subsystem. When multiple expression comes in a single pipeline, then the formatting for the first one will be applied and the remaining will not get the proper formatting. You can pipe the second expression to Out-Default.

I think user config and computer config values are calculated during formatting. You can check it in the GPO modules folder which will probably have a formatting file in xml format. I had an old blog post regarding formatting. You can have a look at it.

> **[Hidden Formatting in PowerShell](http://www.viapowershell.com/2016/06/hidden-formatting.html)**
>
> PowerShell

PS: this behavior is changed in PowerShell core for built-in cmdlets.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:28pm UTC](https://forums.powershell.org/t/weird-behavior-when-using-psversiontable-with-get-gpo/14836/5 "2024-05-16T20:28:56Z")

</div>

Closed on May 16, 2024, 8:28pm UTC


