exchange12rocks / PSGPPreferences

A way to manage Group Policy Preferences through PowerShell
MIT License
35 stars 2 forks source link

Get-GPPGroupMember returns Deserialize-GPPSectionGroups.ps1 errors in 0.3.0 #34

Closed Borgquite closed 2 years ago

Borgquite commented 2 years ago

Having installed 0.3.0:

New-GPO "Test GPO"
$newmember = New-GPPGroupMember -Name "NETBIOSNAME\Domain Admins" -Action ADD
New-GPPGroup -GPOName "Test GPO" -Update -Name "Administrators" -Members $newmember
Get-GPPGroupMember -GPOName "Test GPO" -GroupName "Administrators" -Name "NETBIOSNAME\Domain Admins"

Cannot find an overload for "new" and the argument count: "4". At C:\Program Files\WindowsPowerShell\Modules\PSGPPreferences\0.3.0\Serialization\Groups\Deserialize-GPPSectionGroups.ps1:57 char:17

  • ... $GroupsMembers.Add([GPPItemGroup]::new($GPPItemProperties ...
  • 
    + CategoryInfo          : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodCountCouldNotFindBest

Same error also occurs if you run New-GPPGroup again after that:

New-GPPGroup -GPOName "Test GPO" -Update -Name "Administrators" -Members $newmember

Cannot find an overload for "new" and the argument count: "4". At C:\Program Files\WindowsPowerShell\Modules\PSGPPreferences\0.3.0\Serialization\Groups\Deserialize-GPPSectionGroups.ps1:57 char:17

  • ... $GroupsMembers.Add([GPPItemGroup]::new($GPPItemProperties ...
  • 
    + CategoryInfo          : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodCountCouldNotFindBest

Can you fix? :)

exchange12rocks commented 2 years ago

Oops, not all changes for #29 got into that commit 🤦‍♂️ I am sorry. Should be all right with v.0.3.1 - already in the gallery

Borgquite commented 2 years ago

Seems to be working :)