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.

Incorrect module path when using .NET interactive

See original GitHub issue

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

When running Install/Update-PSResource in a .NET interactive notebook the installation path is incorrectly set as Documents\WindowsPowerShell, even though powershell core is being used

Notebook code (.dib file)

#!pwsh

$PSVersionTable
Install-PSResource -Name 'Az.Accounts' -Repository PSGallery -Scope CurrentUser -Verbose -TrustRepository

Output:

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
VERBOSE: All paths to search: 'C:\Users\henry.buckle\Documents\WindowsPowerShell\Modules'
VERBOSE: All paths to search: 'C:\Users\henry.buckle\Documents\WindowsPowerShell\Scripts'
VERBOSE: Performing the operation "Install-PSResource" on target "package to install: 'Az.Accounts'".
VERBOSE: Parameters passed in >>> Name: 'Az.Accounts'; Version: ''; Prerelease: 'False'; Repository: 'PSGallery'; AcceptLicense: 'False'; Quiet: 'False'; Reinstall: 'False'; TrustRepository: 'True'; NoClobber: 'False';
VERBOSE: Attempting to search for packages in 'PSGallery'
VERBOSE: Untrusted repository accepted as trusted source.
VERBOSE: Null Type provided, so add PSGalleryScripts repository
VERBOSE: Searching in repository PSGallery
VERBOSE: 2.5.2.0
VERBOSE: Null Type provided, so add PSGalleryScripts repository
VERBOSE: Searching in repository PSGallery
VERBOSE: Searching through package path: 'C:\Users\henry.buckle\Documents\WindowsPowerShell\Modules\Az.Accounts'
VERBOSE: Searching through package path: 'C:\Users\henry.buckle\Documents\WindowsPowerShell\Modules\Az.Accounts'
show more (open the raw output data in a text editor) ...

VERBOSE: Attempting to move 'C:\Users\henry.buckle\AppData\Local\Temp\76e3ca5f-c444-4a13-8225-6e7b6b1069f0\az.accounts\2.5.2' to 'C:\Users\henry.buckle\Documents\WindowsPowerShell\Modules\Az.Accounts\2.5.2'
VERBOSE: Successfully installed package 'Az.Accounts' to location 'C:\Users\henry.buckle\Documents\WindowsPowerShell\Modules'
VERBOSE: Attempting to delete 'C:\Users\henry.buckle\AppData\Local\Temp\76e3ca5f-c444-4a13-8225-6e7b6b1069f0'
VERBOSE: Successfully deleted 'C:\Users\henry.buckle\AppData\Local\Temp\76e3ca5f-c444-4a13-8225-6e7b6b1069f0'

Expected behavior

Installation path should be `Documents\PowerShell`

Actual behavior

Installation path is `Documents\WindowsPowerShell`

Error details

No response

Environment data

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     3.0.11     beta       PowerShellGet                       {Find-PSResource, Get-Install…

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hbucklecommented, Aug 13, 2021

This is PSModulePath from the .NET interactive kernel

C:\Users\henry.buckle\.nuget\packages\microsoft.dotnet-interactive\1.0.240403\tools\net5.0\any\Modules
C:\Users\henry.buckle\Documents\PowerShell\Modules
C:\Program Files\PowerShell\Modules
c:\users\henry.buckle\.nuget\packages\microsoft.dotnet-interactive\1.0.240403\tools\net5.0\any\runtimes\win\lib\net5.0\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
0reactions
anamnavicommented, Jan 9, 2023

@hbuckle thanks for providing such thorough info, we’ll investigate into this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ERROR! no action detected in task. This often indicates a ...
This often indicates a misspelled module name, or incorrect module path · Ask Question. Asked 4 years, 5 months ago. Modified 4 years,...
Read more >
r doesn't work as expected with local libraries · Issue #49
Did this error occur while using dotnet try or online? dotnet-try (jupyter) ... NET Kernel and Jupyter, it complains that the path is...
Read more >
Point IO path invalid or module not responding
It won't let me reset in the 'Module info' tab. I have tried both going from my NIC to the AENTR and from...
Read more >
.NET Interactive with SQL!| .NET Notebooks in Visual ...
NET Interactive now ships with SQL support. Learn about how you can start using SQL and Entity Framework Core in your .NET Notebooks...
Read more >
no valid module file was found in any module directory ...
Problem : When trying to import the PnP PowerShell module, I got an error ... This gets all installed modules in your system...
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