|
| 1 | +# FindVSphereCommand module |
| 2 | + |
| 3 | +This module contains a single `Find-VSphereCommand` cmdlet. This cmdlet maps a vSphere Automation API path (path + HttpMethod) to a PowerCLI SDK cmdlet. |
| 4 | + |
| 5 | +## Examples |
| 6 | + |
| 7 | +### Find a cmdlet for VM creation |
| 8 | + |
| 9 | +``` powershell |
| 10 | +PS C:\Users\la001741> Find-VSphereCommand -Name *create*vm* |
| 11 | +
|
| 12 | +Name CommandName Method Path |
| 13 | +---- ----------- ------ ---- |
| 14 | +CreateVmHardwareCdr… Invoke-CreateVmHardwareCdrom POST /api/vcenter/vm/{vm}/hardware/cdrom |
| 15 | +CreateVmDataSets Invoke-CreateVmDataSets POST /api/vcenter/vm/{vm}/data-sets |
| 16 | +CreateTemporaryVmFi… Invoke-CreateTemporaryVmFilesystemDirec… POST /api/vcenter/vm/{vm}/guest/filesystem/directories?ac… |
| 17 | +CreateVmFilesystemD… Invoke-CreateVmFilesystemDirectories POST /api/vcenter/vm/{vm}/guest/filesystem/directories?ac… |
| 18 | +CreateVmHardwareDisk Invoke-CreateVmHardwareDisk POST /api/vcenter/vm/{vm}/hardware/disk |
| 19 | +CreateVmHardwareEth… Invoke-CreateVmHardwareEthernet POST /api/vcenter/vm/{vm}/hardware/ethernet |
| 20 | +CreateTemporaryVmFi… Invoke-CreateTemporaryVmFilesystemFiles POST /api/vcenter/vm/{vm}/guest/filesystem/files?action=c… |
| 21 | +CreateVmHardwareFlo… Invoke-CreateVmHardwareFloppy POST /api/vcenter/vm/{vm}/hardware/floppy |
| 22 | +CreateNamespaceInst… Invoke-CreateNamespaceInstancesRegister… POST /api/vcenter/namespaces/instances/{namespace}/regist… |
| 23 | +CreateVmTemplateLib… Invoke-CreateVmTemplateLibraryItems POST /api/vcenter/vm-template/library-items |
| 24 | +CreateVmHardwareAda… Invoke-CreateVmHardwareAdapterNvme POST /api/vcenter/vm/{vm}/hardware/adapter/nvme |
| 25 | +CreateVmHardwarePar… Invoke-CreateVmHardwareParallel POST /api/vcenter/vm/{vm}/hardware/parallel |
| 26 | +CreateVmGuestProces… Invoke-CreateVmGuestProcesses POST /api/vcenter/vm/{vm}/guest/processes?action=create |
| 27 | +CreateVmHardwareAda… Invoke-CreateVmHardwareAdapterSata POST /api/vcenter/vm/{vm}/hardware/adapter/sata |
| 28 | +CreateVmHardwareAda… Invoke-CreateVmHardwareAdapterScsi POST /api/vcenter/vm/{vm}/hardware/adapter/scsi |
| 29 | +CreateVmHardwareSer… Invoke-CreateVmHardwareSerial POST /api/vcenter/vm/{vm}/hardware/serial |
| 30 | +CreateVmConsoleTick… Invoke-CreateVmConsoleTickets POST /api/vcenter/vm/{vm}/console/tickets |
| 31 | +CreateVmGuestFilesy… Invoke-CreateVmGuestFilesystem POST /api/vcenter/vm/{vm}/guest/filesystem?action=create |
| 32 | +CreateVm Invoke-CreateVm POST /api/vcenter/vm |
| 33 | +CreateCertificateMa… Invoke-CreateCertificateManagementVmcaR… POST /api/vcenter/certificate-management/vcenter/vmca-root |
| 34 | +
|
| 35 | +``` |
| 36 | + |
| 37 | +### Explore '/api/vcenter/vm' with Post http method |
| 38 | + |
| 39 | +``` powershell |
| 40 | +PS C:\Users\la001741> Find-VSphereCommand -Path /api/vcenter/vm -Method Post |
| 41 | +
|
| 42 | +Name CommandName Method Path |
| 43 | +---- ----------- ------ ---- |
| 44 | +CreateVm Invoke-CreateVm POST /api/vcenter/vm |
| 45 | +
|
| 46 | +``` |
| 47 | + |
| 48 | +### Explore '/api/vcenter/storage/policies/*' with Get http method |
| 49 | + |
| 50 | +``` powershell |
| 51 | +PS C:\Users> Find-VSphereCommand -Path /api/vcenter/storage/policies/* -Method Get |
| 52 | +
|
| 53 | +Name CommandName Method Path |
| 54 | +---- ----------- ------ ---- |
| 55 | +ListPoliciesEntitie… Invoke-ListPoliciesEntitiesCompliance GET /api/vcenter/storage/policies/entities/compliance |
| 56 | +ListPoliciesComplia… Invoke-ListPoliciesComplianceVm GET /api/vcenter/storage/policies/compliance/vm |
| 57 | +ListPolicyPoliciesVm Invoke-ListPolicyPoliciesVm GET /api/vcenter/storage/policies/{policy}/vm |
| 58 | +
|
| 59 | +``` |
| 60 | + |
| 61 | +## Using the module |
| 62 | + |
| 63 | +### Clone PowerCLI-Example-Scripts GitHub repository |
| 64 | + |
| 65 | +#### Full repository clone |
| 66 | + |
| 67 | +``` powershell |
| 68 | +cd <local-repositories-root> |
| 69 | +git clone [email protected]:vmware/PowerCLI-Example-Scripts.git |
| 70 | +``` |
| 71 | + |
| 72 | +#### Partial (Scripts/FindVSphereCommand) repository clone only |
| 73 | + |
| 74 | +``` powershell |
| 75 | +cd <local-repositories-root> |
| 76 | +git clone -n --depth=1 --filter=tree:0 [email protected]:vmware/PowerCLI-Example-Scripts.git |
| 77 | +cd PowerCLI-Example-Scripts |
| 78 | +git sparse-checkout set --no-cone Scripts/FindVSphereCommand |
| 79 | +git checkout |
| 80 | +``` |
| 81 | + |
| 82 | +### Import the module |
| 83 | + |
| 84 | +``` powershell |
| 85 | +Import-Module <local-repositories-root>/Scripts/FindVSphereCommand/FindVSphereCommand.psd1 |
| 86 | +``` |
0 commit comments