Automation

 View Only
  • 1.  Modules Loading slow

    Posted Feb 27, 2020 02:31 PM

    Why is it taking so long to load the powershell modules. Below is an example of me loading the modules and it taking almost 1 minute to load the modules. However on a few machines it is much faster. Is this a known issue? Any way to speed this up?

    PS C:\scripts> measure-command {import-module vmware.hv.helper, vmware.vimautomation.core, vmware.vimautomation.horizonview}

    Days              : 0

    Hours             : 0

    Minutes           : 0

    Seconds           : 49

    Milliseconds      : 921

    Ticks             : 499213694

    TotalDays         : 0.000577793627314815

    TotalHours        : 0.0138670470555556

    TotalMinutes      : 0.832022823333333

    TotalSeconds      : 49.9213694

    TotalMilliseconds : 49921.3694

    PS C:\scripts> Get-Module -name *vmware* -ListAvailable

        Directory: C:\Program Files\WindowsPowerShell\Modules

    ModuleType Version    Name                                ExportedCommands

    ---------- -------    ----                                ----------------

    Script     6.7.0.1... VMware.DeployAutomation             {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-D...

    Manifest   1.3.1      VMware.Hv.Helper                    {Get-HVMachineSummary, New-HVHomeSite, Set-HVlicense, Get-...

    Script     6.7.0.1... VMware.ImageBuilder                 {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-Esx...

    Manifest   11.5.0.... VMware.PowerCLI

    Script     6.7.0.1... VMware.Vim

    Script     11.5.0.... VMware.VimAutomation.Cis.Core       {Connect-CisServer, Disconnect-CisServer, Get-CisService}

    Script     11.0.0.... VMware.VimAutomation.Cloud          {Add-CIDatastore, Connect-CIServer, Disconnect-CIServer, G...

    Script     11.5.0.... VMware.VimAutomation.Common         {Get-Task, Stop-Task, Wait-Task}

    Script     11.5.0.... VMware.VimAutomation.Core           {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAd...

    Script     11.5.0.... VMware.VimAutomation.Hcx            {Connect-HCXServer, Disconnect-HCXServer, Get-HCXAppliance...

    Script     7.10.0.... VMware.VimAutomation.HorizonView    {Connect-HVServer, Disconnect-HVServer}

    Script     11.3.0.... VMware.VimAutomation.License        Get-LicenseDataManager

    Script     11.5.0.... VMware.VimAutomation.Nsxt           {Connect-NsxtServer, Disconnect-NsxtServer, Get-NsxtPolicy...

    Script     11.5.0.... VMware.VimAutomation.Sdk            {Get-ErrorReport, Get-PSVersion, Get-InstallPath}

    Script     11.0.0.... VMware.VimAutomation.Security       {Get-SecurityInfo, Get-VTpm, Get-VTpmCertificate, Get-VTpm...

    Script     11.5.0.... VMware.VimAutomation.Srm            {Connect-SrmServer, Disconnect-SrmServer}

    Script     11.5.0.... VMware.VimAutomation.Storage        {Add-KeyManagementServer, Add-VsanObjectToRepairQueue, Cop...

    Script     1.3.0.0    VMware.VimAutomation.StorageUtility Update-VmfsDatastore

    Script     11.2.0.... VMware.VimAutomation.Vds            {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, E...

    Script     11.5.0.... VMware.VimAutomation.Vmc            {Add-VmcSddcHost, Connect-Vmc, Disconnect-Vmc, Get-AwsAcco...

    Script     10.0.0.... VMware.VimAutomation.vROps          {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, Get-O...

    Script     6.5.1.7... VMware.VumAutomation                {Add-EntityBaseline, Copy-Patch, Get-Baseline, Get-Complia...



  • 2.  RE: Modules Loading slow
    Best Answer

    Posted Feb 27, 2020 02:36 PM


  • 3.  RE: Modules Loading slow

    Posted Feb 27, 2020 05:09 PM

    That seemed to work well

    In IE i unchecked "Check for publishers certificate revocation" and "Check for server certificate revocation" and then ran the command again and it takes around 16 seconds now which is MUCH better.

    c:\scripts> measure-command{import-module vmware.hv.helper, vmware.vimautomation.core, vmware.vimautomation.horizonview}

    Days              : 0

    Hours             : 0

    Minutes           : 0

    Seconds           : 16

    Milliseconds      : 24

    Ticks             : 160249918

    TotalDays         : 0.00018547444212963

    TotalHours        : 0.00445138661111111

    TotalMinutes      : 0.267083196666667

    TotalSeconds      : 16.0249918

    TotalMilliseconds : 16024.9918



  • 4.  RE: Modules Loading slow

    Posted Jan 24, 2024 03:58 PM

    Unfortunaletly, most of the setting you suggest to be disabled are enforced by policies setup by security team (and for good reasons at that!)

    Can you provide an alternative?



  • 5.  RE: Modules Loading slow

    Posted Jan 24, 2024 05:21 PM

    No, I'm afraid I don't know of another alternative.

    Btw, posting the same entry on 2 different threads doesn't really help.