Posts

Showing posts from September, 2020

PowerShell String

Image
Introduction to String in PowerShell As we have already discussed that PowerShell is build  on .Net Framework. According to the .NET definition of  string – “A string is a sequential collection of characters  that is used to represent text”. The PowerShell string is simply an object of  System.String type. How to Define String Anything mentioned within single quote or double  quote considered as string in PowerShell. Only difference between the two is that strings in  double quote support string expansion, while a single  quote will only represent literal strings. Operations on String To find out what operation can be performed on string, Use Get-member command which will return all methods applicable to string. Length of String Length property will return the number of characters  in string.  Split Operations on String Split operation will divide string into multiple line from where  split character is present. Lets take our environment PS module path  example, Apply split operation o

HTML Links

Image
In this tutorial, you will learn how to link one web page to another in HTML. Creating Links in HTML A link or hyperlink is a connection from one web resource to another. Links allow users to move seamlessly from one page to another. A link has two ends, called anchors. The link starts at the source anchor and points to the destination anchor, which may be any web resource, for example, an image, an audio or video clip, a PDF file, an HTML document or an element within the document itself. HTML Link Syntax Links are specified in HTML using the <a> tag ie anchor tag. It is paired and inline tag. A link or hyperlink could be a word, group of words, or image. <a href="url">Link text</a> Anything between the opening <a> tag and the closing </a> tag becomes the part of the link that the user sees and clicks in a browser. The most important attribute of the <a>  tag is the href attribute, which indicates the link's destination. It's value

PowerShell Hashtable

Image
Hashtable in PowerShell PowerShell Hashtable is a compact data structure that stores key/value pairs in a hash table. For example, it may contain student’s roll number as key and their name as value. A key/value pair is essentially a set of two elements that are related in some manner. How to create Hashtable Just like array, hashtable can also be created in  Multiple ways. Begin the hash table with an at sign (@). Enclose the hash table in braces ({}). It will create an empty hashtable for you. You can add Data in hashtable using add method. 3. You can also add keys and values to a hashtable when you create it. For example, the following statement creates a hash table with three keys. Use an equal sign (=) to separate each key from its value. Use a semicolon (;) or a line break to separate the key/value pairs. Keys that contains spaces must be enclosed in quotation marks.  Strings as values must be in quotation marks, even if they do not include spaces. If you want to maintain orde

PowerShell Array

Image
  Array in PowerShell The array is a type of data structure that can be used to  store a collection of items, the collection of items can  be either of the same datatype or different.  The elements in an array can be accessed using  the index. The index of the array usually starts at 0 just  like other programming languages, so to access the first element, use index [0].  Define Array in PowerShell Array in PowerShell can be defined in multiple  ways. To create and initialize an array, assign comma separated multiple values to a variable.  Pass values to variable within bracket  beginning with @ like $var = @() When no data type is specified, PowerShell creates each array as an object array (System.Object[]).      3. We can create array to hold value of specific type also, like below How to access an Array We can refer to an array by using its variable name. To display all the elements in the array, type the array name. We can also refer to the elements in an array by using an index, b