Open JNichNP opened 9 months ago
I get the exact same error in 7.4.0, using the version installed from Microsoft Store. Using 4.3.10 installed from MSI, it works as expected. I have not tried 7.4.0 installed from MSI yet. See attached screenshot.
OS: Windows 10.0.19045 Enterprise Build 19045 Mg-Graph ver. 2.9.1 installed from PSGallery in Windows PowerShell 5 environment.
The issue is resolved for get-mguser using Mg-Graph module version 2.10.0 released earlier today. get-mggroup still gives the same error. Thus this seems to be a module compatibility problem and not a PowerShell 7.4 problem.
(Edit: corrected mistakes)
The issue is resolved for get-mguser using Mg-Graph module version 2.10.0 released earlier today. get-mggroup still gives the same error. Thus this seems to be a module compatibility problem and not a PowerShell 7.4 problem.
(Edit: corrected mistakes)
Seems I was mistaken, see thread in https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/2460. Apparently, this error is related to an experimental feature (WDAC) in PowerShell 7.4.0. The related issue https://github.com/PowerShell/PowerShell/issues/20785 has been classified as a bug.
Prerequisites
Steps to reproduce
When I Connect-MgGraph, and try to use Get-MgUser or Get-MgGroup, I get the same error:
ParentContainsErrorRecordException: C:\Program Files\PowerShell\Modules\Microsoft.Graph.Users\2.9.0\exports\ProxyCmdletDefinitions.ps1:15863
Exception calling "GetSteppablePipeline" with "1" argument(s): "The expression after '&' in a pipeline element produced an object that was not valid. It must result in a command name, a script block, or a CommandInfo object."
Downgraded to 7.3.9 And Get-MgUser and Get-MgGroup work as expected.
Expected behavior
Actual behavior
Error details
Environment data
Visuals
No response