Azure / azure-powershell-common

Microsoft Azure PowerShell common components
Other
35 stars 56 forks source link

Import-Module PowerShellGet error: Cannot find a variable with the name 'AmsiContext' #304

Open bvbeek opened 2 years ago

bvbeek commented 2 years ago

Can anyone help me with this issue?

When I execute this command:

Import-Module PowerShellGet

I got this error:

Import-Module : Cannot find a variable with the name 'AmsiContext'.
At line:1 char:1
+ Import-Module PowerShellGet
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (AmsiContext:String) [Import-Module], ItemNotFoundException
    + FullyQualifiedErrorId : VariableNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

The second time it goes fine:

image

calumr commented 2 years ago

Seems to be an issue with SentinelOne (virus checker): https://stackoverflow.com/questions/70172291/powershell-cannot-find-a-variable-with-the-name-amsicontext

bvbeek commented 2 years ago

Yes, that was the problem