Repository navigation
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.
Description
Steps to reproduce
In a new session with -NoProfile specified (so that no commands have run previously)
Get-Alias gci | Format-List *I found this while working on #10784 following a comment from Aditya Patwardhan (@adityapatwardhan). I had to dig down to the SessionStateAliasApis.cs file and put a breakpoint on line 50 to see the state of _currentScope
It doesn't appear to be all aliases, gcm and a bunch of others were fine.
Expected behavior
This works fine as long as you've run at least one command first (that isn't this one or others that interact with the aliases)
HelpUri : https://go.microsoft.com/fwlink/?LinkID=113308
ResolvedCommandName : Get-ChildItem
DisplayName : gci -> Get-ChildItem
ReferencedCommand : Get-ChildItem
ResolvedCommand : Get-ChildItem
Definition : Get-ChildItem
Options : ReadOnly
Description :
OutputType : {System.IO.FileInfo, System.IO.DirectoryInfo}
Name : gci
CommandType : Alias
Source :
Version :
Visibility : Public
ModuleName :
Module :
RemotingCapability : PowerShell
Parameters : {[Path, System.Management.Automation.ParameterMetadata], [LiteralPath,
System.Management.Automation.ParameterMetadata], [Filter,
System.Management.Automation.ParameterMetadata], [Include,
System.Management.Automation.ParameterMetadata]…}
ParameterSets :
Actual behavior
HelpUri :
ResolvedCommandName :
DisplayName : gci -> Get-ChildItem
ReferencedCommand :
ResolvedCommand :
Definition : Get-ChildItem
Options : ReadOnly
Description :
OutputType :
Name : gci
CommandType : Alias
Source :
Version :
Visibility : Public
ModuleName :
Module :
RemotingCapability : PowerShell
Parameters :
ParameterSets :
Environment data
I've checked this in preview 5, 6 and master.
Name Value
---- -----
PSVersion 7.0.0-preview.4
PSEdition Core
GitCommitId 7.0.0-preview.4-211-gbcc565603cee552b10244be82a2797da2ff38cab
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.
Activity
iSazonov commentedon Dec 9, 2019
We already discussed this. To have all the properties we have to import modules. It is very expensive.
Also problem is possible alias conflicts so that we should get aliases only in interactive session and only after importing a module.