Powershell – How Can I Create A New Folder Using a Name Based on the Current Date?

Note 3 things here :

  • $() enables you to use  the output of a command in a string;
  • The ()  around get-date again say "Execute this first" so that we can use the Methods of the DateTime Object returned by get-date;
  • the toString() Method of a DateTime object takes a formattingstring as input;

 I added the second example as I think that is a far more usable version (not culture specific and sortable).

SOURCE

LINK

LANGUAGE
ENGLISH