You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code does not work: Get-MgApplication | Where-Object {$_.displayname -eq 'test'} | Remove-MgApplication
The response from Remove-MgApplication is InputObject has null value for InputObject.ApplicationId.
This response is valid as the output from Get-MgApplication returns Id and AppId rather than ObjectId and ApplicationId.
I believe that the intention shown by previously existing Powershell cmdlets is that there should be a consistent capability to pipe one command to another, especially when they are within the same module/family, so that we do not have to encounter errors and then have to dig around the incomplete documentation to discover the quirks of newer cmdlets that run contrary to the behaviours that have been long established.
To workaround, I assumed the following would then work: Get-MgApplication | Where-Object {$_.displayname -eq 'test'} | Foreach-Object {Remove-MgApplication -ApplicationId $_.AppId}
Unfortunately, this is also incorrect as I need to send $_.Id (because the API expects ObjectID as per #1715 which was closed stating 'by design')
I can accept that the cmdlet expects ObjectId because of upstream API requirement, so why do these two cmdlets have their parameter misleadingly named as 'ApplicationId' rather than the more correct 'ObjectId'? Also, to assist in piping the commands together, could Remove-MgApplication have an alias for ApplicationId(aka ObjectId) that accepts InputObject.Id so that it matches the naming that these cmdlets themselves output?
Finally, can the documentation of the cmdlets be updated so as to remove ambiguity around the usage of Id, ObjectId, ApplicationId and AppId?
Thanks.
Expected behavior
Should be able to pipe output from Get-MgApplication to Remove-MgApplication
How to reproduce
Create an application called 'test'
Run connect-MgGraph
Run Get-MgApplication | Where-Object {$_.displayname -eq 'test'} | Remove-MgApplication
</details>
### Configuration
Name Value
---- -----
PSVersion 7.4.5
PSEdition Core
GitCommitId 7.4.5
OS Debian GNU/Linux 12 (bookworm)
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
X64 architecture
devcontainer based on mcr.microsoft.com/dotnet/sdk:8.0
not specific to this configuration
### Other information
_No response_
The text was updated successfully, but these errors were encountered:
Describe the bug
The following code does not work:
Get-MgApplication | Where-Object {$_.displayname -eq 'test'} | Remove-MgApplication
The response from Remove-MgApplication is InputObject has null value for InputObject.ApplicationId.
This response is valid as the output from Get-MgApplication returns Id and AppId rather than ObjectId and ApplicationId.
I believe that the intention shown by previously existing Powershell cmdlets is that there should be a consistent capability to pipe one command to another, especially when they are within the same module/family, so that we do not have to encounter errors and then have to dig around the incomplete documentation to discover the quirks of newer cmdlets that run contrary to the behaviours that have been long established.
To workaround, I assumed the following would then work:
Get-MgApplication | Where-Object {$_.displayname -eq 'test'} | Foreach-Object {Remove-MgApplication -ApplicationId $_.AppId}
Unfortunately, this is also incorrect as I need to send $_.Id (because the API expects ObjectID as per #1715 which was closed stating 'by design')
I can accept that the cmdlet expects ObjectId because of upstream API requirement, so why do these two cmdlets have their parameter misleadingly named as 'ApplicationId' rather than the more correct 'ObjectId'? Also, to assist in piping the commands together, could Remove-MgApplication have an alias for ApplicationId(aka ObjectId) that accepts InputObject.Id so that it matches the naming that these cmdlets themselves output?
Finally, can the documentation of the cmdlets be updated so as to remove ambiguity around the usage of Id, ObjectId, ApplicationId and AppId?
Thanks.
Expected behavior
Should be able to pipe output from Get-MgApplication to Remove-MgApplication
How to reproduce
Create an application called 'test'
Run connect-MgGraph
Run
Get-MgApplication | Where-Object {$_.displayname -eq 'test'} | Remove-MgApplication
SDK Version
2.25.0
Latest version known to work for scenario above?
No response
Known Workarounds
Run
Get-MgApplication | Where-Object {$_.displayname -eq 'test'} | Foreach-Object {Remove-MgApplication -ApplicationId $_.Id}
Debug output
Click to expand log
```The text was updated successfully, but these errors were encountered: