-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core modulecmdlets in the Microsoft.PowerShell.Core module
Milestone
Description
Windows PowerShell started from a pwsh.exe from preview.4 gives preference to pwsh module path.
As an effect, module load fails with Modules_InsufficientPowerShellVersion,Microsoft.PowerShell.Commands.ImportModuleCommand
Steps to reproduce
PS D:\> powershell
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS D:\> Write-Verbose "Test" -verbose
Write-Verbose : The 'Write-Verbose' command was found in the module 'Microsoft.PowerShell.Utility', but the module could not be loaded. For more information, run 'Import-Module
Microsoft.PowerShell.Utility'.
At line:1 char:1
+ Write-Verbose "Test" -verbose
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Write-Verbose:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
PS D:\> Import-Module Microsoft.PowerShell.Utility
Import-Module : The version of Windows PowerShell on this computer is '5.1.18200.1000'. The module 'C:\program
files\powershell\6-preview\Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1' requires a minimum Windows PowerShell version of '6.1' to run. Verify that you have the minimum
required version of Windows PowerShell installed, and then try again.
At line:1 char:1
+ Import-Module Microsoft.PowerShell.Utility
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (C:\program file...ll.Utility.psd1:String) [Import-Module], InvalidOperationException
+ FullyQualifiedErrorId : Modules_InsufficientPowerShellVersion,Microsoft.PowerShell.Commands.ImportModuleCommandWorkaround
After starting Windows PowerShell adjust the PSModulePath
$env:Psmodulepath = "C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;$env:PSModulePath"cc @rjmholt
Expected behavior
Write-Verbose should work
Actual behavior
Modules_InsufficientPowerShellVersion,Microsoft.PowerShell.Commands.ImportModuleCommand
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.1.0-preview.4
PSEdition Core
GitCommitId 6.1.0-preview.4
OS Microsoft Windows 10.0.18200
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core modulecmdlets in the Microsoft.PowerShell.Core module