microsoftgraph / msgraph-sdk-powershell

Powershell SDK for Microsoft Graph
https://www.powershellgallery.com/packages/Microsoft.Graph
Other
696 stars 168 forks source link

No PowerShell command for runHealthCheck API #1161

Closed AshleyYangSZ closed 2 years ago

AshleyYangSZ commented 2 years ago

See this link https://docs.microsoft.com/en-us/graph/api/cloudpconpremisesconnection-updateaddomainpassword?view=graph-rest-beta&tabs=http No PowerShell script generate for this API image

georgend commented 2 years ago

@AshleyYangSZ We recently added a new Cmdlet that allows you to search for cmdlets that correspond to a URL. Find-MgGraphCommand For Example:-

❯ Find-MgGraphCommand -Uri "https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/onPremisesConnections/{Id}/UpdateAdDomainPassword"

   APIVersion: beta

Command                                                                    Module                   Method URI                                                                                                             OutputType Permissions Variants
-------                                                                    ------                   ------ ---                                                                                                             ---------- ----------- --------
Update-MgDeviceManagementVirtualEndpointOnPremisConnectionAdDomainPassword DeviceManagement.Actions POST   /deviceManagement/virtualEndpoint/onPremisesConnections/{cloudPcOnPremisesConnection-id}/updateAdDomainPassword            {}          {Update, UpdateExpanded, U…

Does the cmdlet Update-MgDeviceManagementVirtualEndpointOnPremisConnectionAdDomainPassword achieve the desired results?

peombwa commented 2 years ago

Thanks for looking into this @georgend!

@AshleyYangSZ, the HTTP snippet/docs is not correct in this case. In the snippet, updateAdDomainPassword sends a PATCH request, yet updateAdDomainPassword is declared as an OData action in the metadata:

<Action Name="updateAdDomainPassword" IsBound="true">
  <Parameter Name="bindingParameter" Type="graph.cloudPcOnPremisesConnection" />
  <Parameter Name="adDomainPassword" Type="Edm.String" Unicode="false" />
</Action>

OData actions should always be POST requests.

AshleyYangSZ commented 2 years ago

Hi @peombwa thanks for digging the reason, could you first add the Update-MgDeviceManagementVirtualEndpointOnPremisConnectionAdDomainPassword PS script first? Then we will switch to use POST in https request next month.

peombwa commented 2 years ago

@AshleyYangSZ, the command is already available in the latest version of the SDK:

➜ Find-Command Update-MgDeviceManagementVirtualEndpointOnPremisConnectionAdDomainPassword | select ModuleName, Version

ModuleName                               Version
----------                               -------
Microsoft.Graph.DeviceManagement.Actions 1.9.3
AshleyYangSZ commented 2 years ago

Thanks a lot! @peombwa we really appreciated your effort on this.