How to get the current date in a short date format in PowerShell?
To get the current date in a short date format in PowerShell, you should use ToString() function as the following:
$(Get-Date).ToString('yyyy-MM-dd')
Output
![get date in short format in powershell](https://debug.to/?qa=blob&qa_blobid=6677816955720544290)
How to get the current Time in PowerShell?
To get the current Time in Hour:Minutes:Seconds
format in PowerShell, you should use the below cmdlet:
$(Get-Date).ToString('hh:mm:ss')
Output
![get time in powershell](https://debug.to/?qa=blob&qa_blobid=7591819178383689152)
How to get the AM/PM Time in PowerShell?
To get the current Time in AM/PM format in PowerShell, you should use "tt" as below:
$(Get-Date).ToString('hh:mm:ss tt')
Output
![get am pm in powershell](https://debug.to/?qa=blob&qa_blobid=1381952116380765725)