User Tools

Site Tools


vmware:esx_powercli_misccmd

Powercli Command line Misc

Connect to a virtual center

PowerCLI C:\> Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -WarningAction SilentlyContinue  -confirm:$false
PowerCLI C:\> Connect-VIServer -Server vc01.domain.local -User administrator@vsphere.local -Password ThisIsNotSecure

Disconnect from virtual Center

PowerCLI C:\> Disconnect-VIServer * -Confirm:$false

Check response time

PowerCLI C:\> Measure-Command { Get-VMHost } | fl TotalSeconds
TotalSeconds : 0,3400701

Check response time at first connection

PowerCLI C:\> $credential = Get-Credential
PowerCLI C:\> Measure-Command {connect-viserver xxxx -Credential $credential -Protocol:https } | fl TotalSeconds
TotalSeconds : 57.1843299

Cluster command

PowerCLI C:\> Get-Cluster
Name                     HAEnabled  HAFailover DrsEnabled DrsAutomationLevel                
----                     ---------  ---------- ---------- ---------------
MY-PROD                  False      1          True       Manual
SAAI                     False      1          True       FullyAutomated

Get modules VMware

PowerCLI C:\> Get-Module -ListAvailable
    Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Manifest   1.0.0.0    AppBackgroundTask                   {Disable-AppBackgr...
Manifest   2.0.0.0    Appx                                {Add-AppxPackage, ...
Manifest   1.0.0.0    BitLocker                           {Unlock-BitLocker,...
Manifest   1.0.0.0    BitsTransfer                        {Add-BitsFile, Com...
Manifest   1.0.0.0    CimCmdlets                          {Get-CimAssociated...
Manifest   1.0        Defender                            {Get-MpPreference,...
Manifest   1.0.0.0    DirectAccessClientComponents        {Disable-DAManualE...
Script     3.0        Dism                                {Add-AppxProvision...
Manifest   1.0.0.0    DnsClient                           {Resolve-DnsName, ...
Manifest   2.0.0.0    International                       {Get-WinDefaultInp...
Manifest   1.0.0.0    iSCSI                               {Get-IscsiTargetPo...
Script     1.0.0.0    ISE                                 {New-IseSnippet, I...
Manifest   1.0.0.0    Kds                                 {Add-KdsRootKey, G...
Manifest   3.0.0.0    Microsoft.PowerShell.Diagnostics    {Get-WinEvent, Get...
Manifest   3.0.0.0    Microsoft.PowerShell.Host           {Start-Transcript,...
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Content, Clea...
Manifest   3.0.0.0    Microsoft.PowerShell.Security       {Get-Acl, Set-Acl,...
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Format-List, Form...
Manifest   3.0.0.0    Microsoft.WSMan.Management          {Disable-WSManCred...
Manifest   1.0        MMAgent                             {Disable-MMAgent, ...
Manifest   1.0.0.0    MsDtc                               {New-DtcDiagnostic...
Manifest   2.0.0.0    NetAdapter                          {Disable-NetAdapte...
Manifest   1.0.0.0    NetConnection                       {Get-NetConnection...
Manifest   1.0.0.0    NetEventPacketCapture               {New-NetEventSessi...
Manifest   2.0.0.0    NetLbfo                             {Add-NetLbfoTeamMe...
Manifest   1.0.0.0    NetNat                              {Get-NetNat, Get-N...
Manifest   2.0.0.0    NetQos                              {Get-NetQosPolicy,...
Manifest   2.0.0.0    NetSecurity                         {Get-DAPolicyChang...
Manifest   1.0.0.0    NetSwitchTeam                       {New-NetSwitchTeam...
Manifest   1.0.0.0    NetTCPIP                            {Get-NetIPAddress,...
Manifest   1.0.0.0    NetworkConnectivityStatus           {Get-DAConnectionS...
Manifest   1.0.0.0    NetworkTransition                   {Add-NetIPHttpsCer...
Manifest   1.0.0.0    PcsvDevice                          {Get-PcsvDevice, S...
Manifest   1.0.0.0    PKI                                 {Add-CertificateEn...
Manifest   1.1        PrintManagement                     {Add-Printer, Add-...
Manifest   1.0        PSDesiredStateConfiguration         {Set-DscLocalConfi...
Script     1.0.0.0    PSDiagnostics                       {Disable-PSTrace, ...
Binary     1.1.0.0    PSScheduledJob                      {New-JobTrigger, A...
Manifest   2.0.0.0    PSWorkflow                          {New-PSWorkflowExe...
Manifest   1.0.0.0    PSWorkflowUtility                   Invoke-AsWorkflow
Manifest   1.0.0.0    ScheduledTasks                      {Get-ScheduledTask...
Manifest   2.0.0.0    SecureBoot                          {Confirm-SecureBoo...
Manifest   2.0.0.0    SmbShare                            {Get-SmbShare, Rem...
Manifest   2.0.0.0    SmbWitness                          {Get-SmbWitnessCli...
Manifest   1.0.0.0    StartScreen                         {Export-StartLayou...
Manifest   2.0.0.0    Storage                             {Add-InitiatorIdTo...
Manifest   2.0.0.0    TLS                                 {New-TlsSessionTic...
Manifest   1.0.0.0    TroubleshootingPack                 {Get-Troubleshooti...
Manifest   2.0.0.0    TrustedPlatformModule               {Get-Tpm, Initiali...
Manifest   2.0.0.0    VpnClient                           {Add-VpnConnection...
Manifest   1.0.0.0    Wdac                                {Get-OdbcDriver, S...
Manifest   1.0.0.0    WindowsDeveloperLicense             {Get-WindowsDevelo...
Script     1.0        WindowsErrorReporting               {Enable-WindowsErr...
Manifest   1.0.0.0    WindowsSearch                       {Get-WindowsSearch...

    Directory: C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Modules

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Binary     6.0.0.0    VMware.DeployAutomation
Binary     6.0.0.0    VMware.ImageBuilder
Binary     6.5.0.4... VMware.VimAutomation.Cis.Core
Binary     6.5.0.4... VMware.VimAutomation.Cloud
Manifest   6.5.0.4... VMware.VimAutomation.Common
Binary     6.5.0.2... VMware.VimAutomation.Core           HookGetViewAutoCom...
Binary     6.0.0.0    VMware.VimAutomation.HA
Binary     7.0.2.4... VMware.VimAutomation.HorizonView
Binary     6.5.0.4... VMware.VimAutomation.License
Binary     6.5.0.4... VMware.VimAutomation.PCloud
Manifest   6.5.0.4... VMware.VimAutomation.Sdk            Get-PSVersion
Binary     6.5.0.4... VMware.VimAutomation.Storage
Binary     6.5.0.4... VMware.VimAutomation.Vds
Binary     6.5.0.4... VMware.VimAutomation.vROps
Binary     6.0.0.0    VMware.VumAutomation

Use directly Powershell by including VMware PowerCLI Modules

PS C:\temp> Get-ChildItem -Path "C:\Program Files*\VMware\Infrastructure\vSphere PowerCLI\Modules" -Include *.ps1 -Recurse | Select-String -Pattern add-pssnapin
vmware/esx_powercli_misccmd.txt · Last modified: 2021/01/01 21:25 (external edit)