Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 230663

Re: How to stop/disable autoload of PowerShell modules?

$
0
0

Hi, many thanks for your answers.

The problem is that the modules will be loaded automatically without notice.

I tried the $PSModuleAutoloadingPreference method but it seems to have no effect at all.

 

For example my code looks like this:

$PSModuleAutoloadingPreference = 'None'

$computer = "srv01"

Remove-Module vmware*

Import-Module Hyper-V

get-vm -ComputerName "srv01"

 

The output is a list of all my Hyper-V VMs. So far so good.

 

When I execute the cmd "get-vm -ComputerName "srv01" " alone it brings me this:

WARNING: Please consider joining the VMware Customer Experience Improvement Program, so you can help us make PowerCLI a better product. You can join using the following command:

Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true

VMware's Customer Experience Improvement Program ("CEIP") provides VMware with information that enables VMware to improve its products and services, to fix problems, and to advise you on how best to deploy and use our products.  As part of the CEIP, VMware collects technical information about your organization’s use of VMware products and services on a regular basis in association with your organization’s VMware license key(s).  This information does not personally identify any individual.

For more details: type "help about_ceip" to see the related help article.

To disable this warning and set your preference use the following command and restart PowerShell:

Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true or $false.

ERROR: Get-VM : A parameter cannot be found that matches parameter name 'ComputerName'.

MoveIT_OneGlass-PSScriptImporter.ps1 (38, 8): ERROR: At Line: 38 char: 8

ERROR: + get-vm -ComputerName "srv01"

ERROR: +        ~~~~~~~~~~~~~

ERROR:     + CategoryInfo          : InvalidArgument: (:) [Get-VM], ParameterBindingException

ERROR:     + FullyQualifiedErrorId : NamedParameterNotFound,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVM

ERROR:

 

This is totally weird. :-(

 

Cheers

Chris


Viewing all articles
Browse latest Browse all 230663

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>