When you run Get-Alias, it shows you all the aliases currently available. You might want to know which aliases were Custom aliases. That is to say, which aliases did not come built in with PowerShell. So what does it take to answer this question?
- We already know how to get all the current aliases (Get-Alias).
- You can run PowerShell without running the profile files by specifying the –NoProfile switch.
- PowerShell supports command substitution which allows you to run a command and use its results as input into another command.
- Compare-Object takes 2 sets of objects and compares them based upon a set of properties.
With those 4 things in focus, you can answer the question:
PS> Compare-Object (Get-Alias) (PowerShell -NoProfile {Get-Alias}) -Property
Name |sort SideIndicator,Name
Name SideIndicator
—- ————-
?: <=
?? <=
?s <=
adl <=
alias <=
aliases <=
apropos <=
asp <=
bd <=
bda <=
bdl <=
be <=
bea <=
bp <=
bph <=
bpsd <=
bpskip <=
bpskipa <=
bpskiplist <=
bpss <=
catfun <=
compare <=
ctcd <=
ctfd <=
cvxml <=
dbp <=
e <=
ebp <=
efun <=
eghp <=
egp <=
ehp <=
ep <=
epf <=
ephy <=
fxml <=
gac <=
galpscx <=
gcb <=
gel <=
GERI <=
gfvi <=
ghm <=
gph <=
gpv <=
gsg <=
gshelp <=
gsn <=
gsp <=
gst <=
gtn <=
gvs <=
gwo <=
ipas <=
iphy <=
ln <=
look <=
lsfun <=
mail <=
measure <=
mkdir <=
new <=
np <=
nts <=
ocb <=
oie <=
ra <=
rfun <=
rnfun <=
rsn <=
rsps <=
rver <=
rvsn <=
sac <=
sans <=
saps <=
SERC <=
SERD <=
skbp <=
snsn <=
snstc <=
spell <=
sprdp <=
sro <=
ss <=
ssg <=
ssn <=
start <=
swr <=
table <=
touch <=
ucul <=
xeval <=
xnav <=
xselect <=
cd =>
dir =>
Enjoy!
NOTE: This post was done using WORD 2007 so please let me know whether it shows up properly in your reader. Thanks.
Jeffrey Snover [MSFT]
Windows PowerShell/MMC Architect
Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
0 comments