February 2017
Beginner
737 pages
15h 22m
English
When you are scripting, there are times where you may need to get the date and time of a system. PowerShell offers the get-date cmdlet, which provides the date and time in many different formats of your choice.
To obtain the date object, execute the following command:
$time = get-date $time
The output of this is shown in the following screenshot:

The standard get-date cmdlet, without any triggers, will generate the long date and time format. When you store the date object in a variable, it is important to remember that the data captured from the cmdlet is a snapshot in time. You'll have to call the get-date cmdlet again to ...
Read now
Unlock full access