Join Don Jones for an in-depth discussion in this video Use the -F operator, part of PowerShell DrillBits.
- One of the little used operators in Windows PowerShell…is the minus F or -f operator.…It's used for formatting strings.…Here's how it works.…Start with a string.…You can put double or single quotes.…I'll just use double quotes here.…Type whatever it is you want to go in there…and use curly brackets and a number…to insert a placeholder.…The placeholders should be numbered sequentially.…
So my first placeholder is always zero,…the second one is always one, and so forth.…End your string and then provide the -f operator.…After the operator, provide a comma separated list…of values to be inserted into the placeholders.…For the first one, I'll use a parenthetical expression…to retrieve date.…That will be inserted into the first placeholder,…number zero.…Then a comma and I'll use another parenthetical expression…to get a random number.…That will be inserted into the second placeholder,…number one.…
You can actually do quite a bit of clever formatting…with these things, as well.…For example, let's say that I really, instead of having…
Skill Level Beginner
1. Windows PowerShell v2
2. Windows PowerShell v3
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.