If you want to display a substring in Power Shell, you will type in the below command line within the Power Shell console:-
"Hello World!".substring.Invoke(1, 10)
The above command will produce the below outcome:-
ello World
Basically, what the above command does is to grab the substring of “Hello World!” which started from index 1 up until 10 characters in total! “”.substring will return the information object about the substring methods that you can then use with the Invoke method to return the substring of “Hello World” as mentioned before. The Invoke method above actually will invoke the string Substring(int startindex, int length) method where the start index represents the beginning of the index where you want to begin to extract the substring and the length is the total length of that substring that you wish to extract.