The question is answered, but there is some more info missing:
Variable vs. Cmdlet
You have a value in $Date
variable and -f
operator does work in this form: 'format string' -f values
. If you call Get-Date -format "yyyyMMdd"
you call a command let with some parameters. The value "yyyyMMdd" is value for parameter Format
(try help Get-Date -param Format
).
-f
operator
There is plenty of format strings, look at least at part1 and part2. She uses string.Format('format string', values')
. Think of it as 'format-string' -f values
, because -f
operator works very similarly as string.Format
method (although there are some differences (for more info look at question at StackOverflow: how exactly does the RHS of the -f operator work?