Was this page helpful?
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

Converting VBScript's Now Function

Windows PowerShell

Definition: Returns the current date and time according to the setting of your computer's system date and time.


If you’re looking for easy one then you came to the right place: assigning the current date and time to a variable is no more difficult than using the Get-Date Cmdlet. For example:

$a = get-date

When you run this command and then echo back the value of $a you should get something similar to the following:

Tuesday, September 05, 2006 10:24:04 AM

Return to the VBScript to Windows PowerShell home page

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft