vmware / PowerCLI-Example-Scripts

http://blogs.vmware.com/powercli
Other
765 stars 608 forks source link

Add a module with a command to map a vSphere API to a PowerCLI SDK cmdlet #636

Closed lyuboasenov closed 3 weeks ago

lyuboasenov commented 3 weeks ago
PS C:\Users> find-VSphereCommand -path /api/vcenter/storage/policies/compliance/vm -Method Get

Name                : ListPoliciesComplianceVm
CommandInfo         : Invoke-ListPoliciesComplianceVm
ApiName             : VmApi
Path                : /api/vcenter/storage/policies/compliance/vm
Tags                : Vm
RelatedCommandInfos :
Method              : GET

PS C:\Users> find-VSphereCommand -path /api/vcenter/storage/policies/* -Method Get

Name                : ListPoliciesEntitiesCompliance
CommandInfo         : Invoke-ListPoliciesEntitiesCompliance
ApiName             : ComplianceApi
Path                : /api/vcenter/storage/policies/entities/compliance
Tags                : Compliance
RelatedCommandInfos :
Method              : GET

Name                : ListPoliciesComplianceVm
CommandInfo         : Invoke-ListPoliciesComplianceVm
ApiName             : VmApi
Path                : /api/vcenter/storage/policies/compliance/vm
Tags                : Vm
RelatedCommandInfos :
Method              : GET

Name                : ListPolicyPoliciesVm
CommandInfo         : Invoke-ListPolicyPoliciesVm
ApiName             : VmApi
Path                : /api/vcenter/storage/policies/{policy}/vm
Tags                : Vm
RelatedCommandInfos :
Method              : GET

PS C:\Users\la001741> Get-Help (find-VSphereCommand -path /api/vcenter/storage/policies/compliance/vm -Method Get | Select -ExpandProperty CommandInfo) -Full

NAME
    Invoke-ListPoliciesComplianceVm

SYNOPSIS
    Returns compliance information about at most 1000 virtual machines matching the filter VM.FilterSpec. If there are no
    virtual machines matching the VM.FilterSpec an empty List is returned. Virtual machines without storage policy
    association are not returned.

SYNTAX
    Invoke-ListPoliciesComplianceVm [-Status] <PSObject[]> [[-Vms] <String[]>] [[-Server] <Object>] [-WithHttpInfo]
    [-WhatIf] [-Confirm] [<CommonParameters>]

...
vmwclabot commented 3 weeks ago

@lyuboasenov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

lyuboasenov commented 3 weeks ago

I've added formatting and now the result looks like:

PS C:\Users> find-VSphereCommand -path /api/vcenter/storage/policies/* -Method Get

Name                 CommandName                              Method  Path
----                 -----------                              ------  ----
ListPoliciesEntitie… Invoke-ListPoliciesEntitiesCompliance      GET   /api/vcenter/storage/policies/entities/compliance
ListPoliciesComplia… Invoke-ListPoliciesComplianceVm            GET   /api/vcenter/storage/policies/compliance/vm
ListPolicyPoliciesVm Invoke-ListPolicyPoliciesVm                GET   /api/vcenter/storage/policies/{policy}/vm
vmwclabot commented 3 weeks ago

@lyuboasenov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.