@dm10169
You can try this way and it worked for me.
You have to run the script every time you need to find get parameters and input the cmdlet you are looking for.
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> .\myPowershellscript.ps1
cmdlet myPowershellscript.ps1 at command pipeline position 1
Supply values for the following parameters:
CommandName[0]: Get-VMHost
CommandName[1]:
Command: VMware.VimAutomation.Core/Get-VMHost
Set: Default
Name Aliases Position Mandatory Pipeline ByName Provider Type
---- ------- -------- --------- -------- ------ -------- ----
Datastore {da} Named False True False All StorageResource[]
Location {l} Named False True False All VIContainer[]
Name {na} 0 False False False All String[]
NoRecursion {no} Named False False False All SwitchParameter
PipelineVariable {pv, pi} Named False False False All String
Server {se} Named False False False All VIServer[]
State {st} Named False False False All VMHostState[]
Command: VMware.VimAutomation.Core/Get-VMHost
Set: SecondaryParameterSet
Name Aliases Position Mandatory Pipeline ByName Provider Type
---- ------- -------- --------- -------- ------ -------- ----
Datastore {da} Named False True False All StorageResource[]
Location {l} Named False True False All VIContainer[]
Name {na} 0 False False False All String[]
NoRecursion {no} Named False False False All SwitchParameter
PipelineVariable {pv, pi} Named False False False All String
ResourcePool {r} Named False False False All ResourcePool[]
Server {se} Named False False False All VIServer[]
VM {vm} Named False True False All VirtualMachine[]
Command: VMware.VimAutomation.Core/Get-VMHost
Set: DistributedSwitch
Name Aliases Position Mandatory Pipeline ByName Provider Type
---- ------- -------- --------- -------- ------ -------- ----
DistributedSwitch {di} Named False True False All DistributedSwitch[]
Name {na} 0 False False False All String[]
PipelineVariable {pv, pi} Named False False False All String
Server {se} Named False False False All VIServer[]
Command: VMware.VimAutomation.Core/Get-VMHost
Set: ById
Name Aliases Position Mandatory Pipeline ByName Provider Type
---- ------- -------- --------- -------- ------ -------- ----
Id {i} Named False False False All String[]
PipelineVariable {pv, pi} Named False False False All String
Server {se} Named False False False All VIServer[]
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI>