Hi,
I was studying some PowerShell from the following site:
https://technet.microsoft.com/en-us/library/ff730960.aspx
------------------------------------
$a = Get-Date "Date: " + $a.ToShortDateString() "Time: " + $a.ToShortTimeString()
------------------------------------------------------
I understand some of this.. I tried to create my own function called time
-------------
function time {$a=ToShortTimeString()}
-------------
This did not work I was able to create my function by doing the following:
------------------------------
function time {"Time: " + $a.ToShortTimeString()}
PS C:\Users\Administrator.BWCAT> timeTime: 2:42 PM
-------------------------------
I thought "ToShortTimeString()" was a method however, am i wrong? is the entire "Time: " + part of that method also?
It does not seem to work without the "Time: " + so I am just trying to understand the syntax I am using... Its been awhile since I had a .Net programming class and so even the word method is a little vague as I always got method and function confused a bit, but I think I have a vague general idea of method.
Anyway can someone break down in easy to understand perhaps using analogy of the syntax and why its all required so I can understand it?
function time {"Time: " + $a.ToShortTimeString()}
Thanks