tag:blogger.com,1999:blog-36207740.post1600023839570996427..comments2024-01-11T23:12:52.849+01:00Comments on PowerShellers: Get-Alias ?aleksandarhttp://www.blogger.com/profile/11946050716712696119noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-36207740.post-27300871520044458712009-02-17T22:21:00.000+01:002009-02-17T22:21:00.000+01:00Jason, thank you for an excellent explanation. As ...Jason, thank you for an excellent explanation. As a matter of fact, we don't have to use quotes at all:<BR/><BR/>PS>get-alias ``?aleksandarhttps://www.blogger.com/profile/11946050716712696119noreply@blogger.comtag:blogger.com,1999:blog-36207740.post-42723193702020397342009-02-17T20:44:00.000+01:002009-02-17T20:44:00.000+01:00@aleksandar, not a bug, just how parsing works. I...@aleksandar, not a bug, just how parsing works. In this case you have two different things parsing your command. You have the command line evaluation, and you have Get-Alias evaluating the expression you give it.<BR/><BR/>Since ? is a special character for Get-Alias, you have to escape it. But, ` is a special character to the command parser. So you either have to escape the escape sequence (``? which becomes `?) or you have to turn parsing off by using single quotes ('`?').Anonymoushttps://www.blogger.com/profile/15144351512413298258noreply@blogger.comtag:blogger.com,1999:blog-36207740.post-38102882953721833352009-02-17T16:26:00.000+01:002009-02-17T16:26:00.000+01:00I've just found out that if you want to use do...I've just found out that if you want to use double quotes, you have to escape it twice:<BR/><BR/>PS>Get-Alias "``?"<BR/><BR/>Is that a bug?aleksandarhttps://www.blogger.com/profile/11946050716712696119noreply@blogger.comtag:blogger.com,1999:blog-36207740.post-72416587425608425762009-02-17T14:20:00.000+01:002009-02-17T14:20:00.000+01:00Good point, that's why I use the long way in m...Good point, that's why I use the long way in my scripts:<BR/><BR/>PS > $alias = "?"<BR/>PS > Get-Alias | Where-Object {$_.name -eq $alias} <BR/><BR/>CommandType Name Definition<BR/>----------- ---- ----------<BR/>Alias ? Where-Object<BR/><BR/><BR/>That way I don't need to worry about escaping.Shay Levyhttps://www.blogger.com/profile/14910279001063843963noreply@blogger.com