Skip to content

Commit b41b3cd

Browse files
committed
Added initial variable support to NewPlus
1 parent f6ad00e commit b41b3cd

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

hub/powertoys/newplus.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,58 @@ The option enables you to toggle the display of filename extensions. When this o
4444

4545
The option enables you to toggle the display of starting digits, spaces and dots. When this option is toggled off (the default), a file named "1. filename" will be displayed as is. However, when this option is toggled on, the template will be displayed as "filename". This is useful when using digits, spaces, and dots at the beginning of filenames to control the display order of templates.
4646

47+
### Filenaming options
48+
49+
#### Expand variables in filenames
50+
51+
With this option on (the default) certain variables in filenames will expand when the template file is copied. Any non-valid-filename charactors are replaced with spaces.
52+
53+
##### Examples
54+
55+
| Example template filename | Would on copy expand to |
56+
| :--- | :--- |
57+
|`$YYYY-$MM-%DD, $hh $mm $ss - $PARENT_FOLDER_NAME by %USERNAME%` | `2024-11-22, 12 08 54 - PowerShell project by cgaarden` |
58+
|`File where variable value contains invalid charactors %USERPROFILE%` | `File where variable value contains invalid charactors C Users cgaarden` |
59+
60+
##### Date and time related variables
61+
62+
Note these variable patterns are the same as for PowerRename and are case-sensitive.
63+
64+
| Variable pattern | Explanation |
65+
| :--- | :--- |
66+
| `$YYYY` | Year, represented by a full four or five digits, depending on the calendar used. |
67+
| `$YY` | Year, represented only by the last two digits. A leading zero is added for single-digit years. |
68+
| `$Y` | Year, represented only by the last digit. |
69+
| `$MMMM` | Name of the month. |
70+
| `$MMM` | Abbreviated name of the month. |
71+
| `$MM` | Month, as digits with leading zeros for single-digit months. |
72+
| `$M` | Month, as digits without leading zeros for single-digit months. |
73+
| `$DDDD` | Name of the day of the week. |
74+
| `$DDD` | Abbreviated name of the day of the week. |
75+
| `$DD` | Day of the month, as digits with leading zeros for single-digit days. |
76+
| `$D` | Day of the month, as digits without leading zeros for single-digit days. |
77+
| `$hh` | Hours, with leading zeros for single-digit hours. |
78+
| `$h` | Hours, without leading zeros for single-digit hours. |
79+
| `$mm` | Minutes, with leading zeros for single-digit minutes. |
80+
| `$m` | Minutes, without leading zeros for single-digit minutes. |
81+
| `$ss` | Seconds, with leading zeros for single-digit seconds. |
82+
| `$s` | Seconds, without leading zeros for single-digit seconds. |
83+
| `$fff` | Milliseconds, represented by full three digits. |
84+
| `$ff` | Milliseconds, represented only by the first two digits. |
85+
| `$f` | Milliseconds, represented only by the first digit. |
86+
87+
##### Special variables
88+
89+
Note these special variables are case-sensitive, so they will only work when written exactly as shown here.
90+
91+
| Special variable | Explanation |
92+
| :--- | :--- |
93+
| `$PARENT_FOLDER_NAME` | will expand to the name of the parent folder. |
94+
95+
##### Environment variables
96+
97+
Note these variables are case-insensitive, so you can write them in upper or lowercase, as you prefer.
98+
99+
* `%environment_variable%`, will get replaced by the value of that environment variable.
100+
47101
[!INCLUDE [install-powertoys.md](../includes/install-powertoys.md)]

0 commit comments

Comments
 (0)