Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

question about 'date'

$
0
0

Part of me doesn't care, but part of me is curious.  Where does 'date' translate to 'Get-Date'?

If I type 'date' in powershell 2.0 and 3.0, it seems to be an alias for Get-Date:

--begin example--

PS Scripts:\> date

Sunday, June 30, 2013 3:58:42 PM

PS Scripts:\> date /?
Get-Date : Cannot bind parameter 'Date'. Cannot convert value "/?" to type "System.DateTime". Error: "String was not
recognized as a valid DateTime."
At line:1 char:6

--end example--

But it isn't an alias:

--begin--

PS Scripts:\> Get-Alias -Name date
Get-Alias : This command cannot find a matching alias because an alias with the name 'date' does not exist.
At line:1 char:1
+ Get-Alias -Name date

--end--

and it isn't a command:

--begin--

PS Scripts:\> Get-Command -Name date
Get-Command : The term 'date' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

--end--

It works . . . but why?  Any ideas?


-------- Ask why.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>