question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PowerShell Integrated Console unable to import certain modules

See original GitHub issue

Issue Description

I am experiencing a problem with powershell integrated console. When I’m trying to import module Centrify.DirectControl.PowerShell I receive an error, however when I open a new powershell terminal with ps5.1 or ps7 import works fine.

Attached Logs

=====> PowerShell Integrated Console v2020.6.0 <=====

PS C:\Users\user\Desktop> Import-Module Centrify.DirectControl.PowerShell

Import-Module : Could not load file or assembly 'util, Version=5.7.0.168, Culture=neutral, PublicKeyToken=1f9cb67793557b0b' or one of its dependencies. The system cannot find the file specified.
At line:1 char:1
+ Import-Module Centrify.DirectControl.PowerShell
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand

Follow the instructions in the README about capturing and sending logs.

PowerShell 7.0.3
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/powershell
Type 'help' to get help.

PS C:\Users\user\Desktop> Import-Module Centrify.DirectControl.PowerShell
PS C:\Users\user\Desktop> 
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.   

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\user\Desktop> Import-Module Centrify.DirectControl.PowerShell
PS C:\Users\user\Desktop> 

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.18363
VSCode 1.49.2
PowerShell Extension Version 2020.6.0

PowerShell Information

Name Value
PSVersion 5.1.18362.752
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.18362.752
BuildVersion 10.0.18362.752
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
csv-editor estivo 0.2.2
powershell ms-vscode 2020.6.0
saltstack korekontrol 0.0.8
shell-format foxundermoon 7.0.1
shell-launcher Tyriar 0.4.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
rjmholtcommented, Sep 28, 2020

Here’s a GIF of changing which PowerShell the Integrated Console uses

change_ps_version

0reactions
rjmholtcommented, Sep 29, 2020

Thanks for this. Now I feel bit stupid that I was not able to deal with this. I’m a still bit new with vscode though.

No worries, getting the right PowerShell is actually complicated, and given that we share a UI with the rest of VSCode and the extensions, it can be tricky to navigate it all.

It seems we could improve documentation here I think.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The specified module 'Module Name' was not loaded because ...
This error is because the PowerShell console or ISE is unable to get the module from given module path's in the environment variable...
Read more >
Can't import PowerShell module that depends on NuGet library
I have a C# PowerShell module coded for .NET 6.0. It depends on a C# library that started life in the same solution....
Read more >
'using module' error in VScode : r/PowerShell - Reddit
I can Import the module just fine with no errors in a default and separate powershell 5.1 console window, and run Cmdlets with...
Read more >
Integrated Terminal doesn't load my Powershell profile
import -module : The specified module 'posh-git' was not loaded because no valid module file was found in any module directory. At line:1...
Read more >
PowerShell Module won't import from $profile - Stack Overflow
Is there anything before that in your profile script that may be failing? Try moving the Import-Module PSReadline to the very top of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found