The title generator script is a script that when passed as string containing series of words it will respond with a string where the words are properly capitalized as you would find in a title. The script should accept two arguments named Title and AllCaps. The title argument is where the user will pass a string to be properly capitalized. The AllCaps argument is a switch type argument that, if specified, the title will be returned in all capital letters rather than just the first character of each word. Here are some examples
Make-Title.ps1 “a tale of two cities” Returns: "A Tale of Two Cities"
Make-Title.ps1 “a tale of two cities” –AllCaps Returns: "A TALE OF TWO CITIES"
Make-Title.ps1 “a TALE of two cities” Returns: "A Tale of Two Cities"
Make-Title.ps1 “A TALE OF TWO CITIES” Returns: "A Tale of Two Cities"
1) Create a script named Make-Title.ps1
2) Script Accepts two arguments, Title and AllCaps
a) Title accepts a string of words that are to be turned into a title
b) AllCaps is a switch argument, if specified all the letters are capitalized
3) The script must contain a function named Proper that takes a single word and capitalizes the first letter and converts the remaining letters to lowercase.
4) The main script splits the string sent as the Title parameter into words then calls the Proper function to fix the case.
5) If the AllCaps switch is specified the original string is return as all capital letters
6) The script outputs a single string not an array of strings with all the words properly capitalized
7) The following words should only be capitalized if they are the first word of the title.
a) to, a, the, at, in, of, with, and, but, or
1) Look at the methods of a string “somestring”|get-member
4) –contains or –notcontains