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.

pwsh -c 'Get-Module' not work on new version of WSL linux kernel (5.10.102.1-microsoft-standard-WSL2)

See original GitHub issue

Prerequisites

Steps to reproduce

  1. Start a bash shell in Ubuntu (using WSL in my case)
  2. Run: `pwsh -c ‘Get-Module’

Expected behavior

~:pwsh -c 'Get-Module'
ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.9.0                 Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     6.0.1                 Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}
Manifest   7.0.0.0               Microsoft.PowerShell.Management     {Add-Content, Clear-Content, Clear-Item, Clear-ItemProperty…}
Manifest   7.0.0.0               Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object…}
Script     2.1.0                 PSReadLine                          {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler…}

Actual behavior

~:pwsh -c 'Get-Module'
~:

Error details

No error

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.6
PSEdition                      Core
GitCommitId                    7.2.6
OS                             Linux 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

Bug

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
237dmitrycommented, Sep 25, 2022

on new version of linux kernel

I propose to clarify the title on new version of WSL linux kernel. For example, in my case everything works with new kernel:

$  uname -r
5.19.10-arch1-1

In addition, the Linux kernel is too broad a concept to use without specifics. It can be vanilla or set up by maintainers for different distributions with different patches and settings.

0reactions
pacorreiacommented, Sep 28, 2022

If I understand the issue correctly Get-Module works well in PowerShell session but not with pwsh -c 'Get-Module', yes? Questions:

  • is there the issue with other cmdlets? pwsh -c 'Get-Date'
  • what is we remove quo

cmdlets-bash

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Windows Subsystem for Linux
Provides detailed information about common errors and issues people run into while running Linux on the Windows Subsystem for Linux.
Read more >
WSL 2 does not have /lib/modules - linux kernel
I had to do this for an assignment, so I figure I'll share my solution here. The base WSL2 kernel does not allow...
Read more >
Ubuntu 22.04 LTS on WSL: "Failed to retrieve available ...
Every time I install new packages using sudo apt install , I will get 2 messages saying that: Failed to retrieve available kernel...
Read more >
linux - How can I update the kernel in WSL2 kernel to latest ...
To be sure of getting updates to the WSL2 kernel: Open Settings > Update & recovery > Windows Update; Click on "Advanced options" ......
Read more >
"usbipd not found for kernel" when using USB/IP with WSL
uspip is called by usbipd wsl attach -b 2-2 from PowerShell because I am trying to attach a USB device to Ubuntu; Kernel...
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