I'm trying to hone my PowerShell skills, and as an exercise I'm trying to get all aliases pointing to Get-Content
(note: I'm fully aware that the easy way to do this is simply Get-Alias -Definition Get-Content
, but I'm trying to do this using pipeing)
My attempt is to run something like:
Get-Alias | Where-Object -Property ReferencedCommand -eq Get-Content
or
Get-Alias | Where-Object -Property ReferencedCommand -eq "Get-Content"
but that returns blank.
Running Get-Alias | Get-Member
reveals that the ReferencedCommand is a System.Management.Automation.CommandInfo
which could explain why my attempts does not return anything.
Now I don't know where to go from here.
Anyone?