-1

I'd like to have an output of get-date for the current day in PowerShell to the following format:

11-Apr-2018

I've tried playing around with this and have not been successful. Ideas?

shoppers1d3e
  • 101
  • 2
  • 4

2 Answers2

0
 Get-Date -format "dd-MMM-yyyy"

Formatting strings follow .NET standards.

See also official docs here.

WBT
  • 2,249
  • 3
  • 28
  • 40
0

If you did a little bit of research, you will find a list with all the date format patterns and the description to them aswell here https://ss64.com/ps/syntax-dateformats.html

In your case

Get-Date -format "dd-MMM-yyyy"
Modro
  • 416
  • 2
  • 14