Forum Discussion
Using 'Get-GPInheritance' Command in Powershell 7
Interesting. Thanks for looking into this.
Any progress on this? It's been 2 years and this issue still persists in PowerShell 7.
Kind regards
Henrik André Olsen
- mmsengAug 18, 2023Copper ContributorI also just came across this. Does anyone even know whether this is intended behavior or a bug?
- Henrik_Andre_OlsenAug 18, 2023Copper Contributor
mmseng
No it's a bug:
https://github.com/PowerShell/PowerShell/issues/18519- LainRobertsonAug 19, 2023Silver Contributor
I'm not a habitual PowerShell (as distinct from Windows PowerShell) user, but working with the Get-GPInheritance commandlet in this thread:
- I can replicate the listed issue when using:
Import-Module -Name GroupPolicy;
- The commandlet returns the expected result when having used:
Import-Module -Name GroupPolicy -SkipEditionCheck
It's worth noting that - at least under my now out-of-date PowerShell 7.2.6 - it provides a warning message upon loading this module that it's using the compatibility process described in the documentation:
This may or may not having been around back when this post was created - I have no idea (as I don't use PowerShell.)
I should add that this is assuming you're on Windows (I'm not sure if the GroupPolicy module exists for other platforms), and I fully recognise that testing this one specific scenario is a very long way from being comprehensive.
That disclaimer out of the way, when running the same type check against InheritedGpoLinks (having used -SkipEditionCheck) - in line with the previous posts, it confirms the module is running in-process, meaning serialisation and de-serialisation are no longer an issue.
Cheers,
Lain
- I can replicate the listed issue when using: