#dotnethelpers.com
Explore tagged Tumblr posts
dotnet-helpers-blog · 6 years ago
Text
How to Use Multidimensional arrays in Powershell
How to Use Multidimensional arrays in Powershell
Tumblr media
Before I show you how multi-dimensional arrays work, let we start what is an array. By default, PowerShell assumes that the elements of an array are of the type variant. This means that you can mix different data types—that is, combine numerical values, dates, or strings in a single variable. The data elements of a PowerShell array need not be of the same type, unless the data type is declared…
View On WordPress
0 notes
dotnet-helpers-blog · 7 years ago
Text
Power Shell - Containment Operators
Power Shell – Containment Operators
Power Shell Containment Operators The containment operators (-contains and -notcontains) are similar to the equal operators. However, the containment operators always return a Boolean value, even when the input is a collection. The conditional operator -Contains is similar to -eq, except it returns ‘True’ or ‘False’. -Contains is designed for situations where you wish to test for one particular…
View On WordPress
0 notes
dotnet-helpers-blog · 7 years ago
Text
PowerShell : Do-While & Do-Until Loop
Do-While & Do-Until Loop in PowerShell Loops are an essential construct in any programming language as they enable a block of code to be repeatedly executed based on the condition. This can be useful for iterating through items in an object or repeatedly performing an operation. PowerShell supports involves setting a condition which either allows the loop to process as long as the condition is…
View On WordPress
0 notes
dotnet-helpers-blog · 7 years ago
Text
PowerShell - Replacement Operator
PowerShell – Replacement Operator
Replacement Operator PowerShell provides several options to help you replace text in a string with other text. The -replace operator replaces all or part of a value with the specified value using regular expressions. It replaces every occurrence of the exact string you specify with the exact replacement string that you provide. The -replaceoperator provides much more flexibility because its…
View On WordPress
0 notes
dotnet-helpers-blog · 7 years ago
Text
PowerShell - Matching Operators
PowerShell – Matching Operators
-like and -notlike Operators The like operators find elements that match or do not match a specified pattern using wildcard expressions. How its handle single & Collection values? If we input scalar value, comparison operators return a Boolean value. When the input is a collection of values, the comparison operators return any matching values. If there are no matches found in a collection then…
View On WordPress
0 notes
dotnet-helpers-blog · 7 years ago
Text
PowerShell - Equal Operators
PowerShell – Equal Operators
Equal Operators: The equal operators return a value of TRUE if its identical or return a value of FALSE if it is not identical. The entire pattern must match an entire value. By default, all comparison operators are case-insensitive. To make a comparison operator case-sensitive, precede the operator name with a “c”. For example, the case-sensitive version of -eq is -ceq. To make the…
View On WordPress
0 notes
dotnet-helpers-blog · 7 years ago
Text
PowerShell Basics: Comparison Operators and Conditional Logic
Comparison Operators and Conditional Logic Comparison operators let you specify conditions for comparing values and finding values that match specified patterns. To use a comparison operator, specify the values that you want to compare together with an operator that separates these values. Equality Operators  Description -eq equals -ne not equals -gt greater than -ge greater than or equal -lt…
View On WordPress
0 notes
dotnet-helpers-blog · 7 years ago
Text
Working with PowerShell's Data Types
Working with PowerShell’s Data Types
An important property of a PowerShell variable is its name, which is always preceded by the dollar sign “$” and can only contain letters, numbers, and the underscore. If you feel a strong urge to use other characters, you have to enclose the name in curly braces. You should not use the name of variables that have been pre-defined. Windows PowerShell uses the Microsoft .NET Framework data types.…
View On WordPress
0 notes
dotnet-helpers-blog · 7 years ago
Text
PowerShell's Variables
PowerShell’s Variables
Windows PowerShell is designed to be an interactive command-line shell and it’s also a programming language. A PowerShell script is really nothing more than a simple text file. The file contains a series of PowerShell commands, with each command appearing on a separate line. If we need to run the PowerShell script using the notepad then its filename needs to save as .PS1 extension. Powershell…
View On WordPress
0 notes
dotnet-helpers-blog · 7 years ago
Text
5 - Getting Help Information
5 – Getting Help Information
The PowerShell includes detailed Help topics that explain PowerShell concepts. There are also Help topics for each cmdlet and provider and Help topics for many functions and scripts. Getting Help for Cmdlets To get Help about Windows PowerShell cmdlets, use the Get-Help cmdlet. Here let we see some of the cmdlets help. To get a list of all the cmdlet Help topics in your session use below,…
View On WordPress
0 notes
dotnet-helpers-blog · 7 years ago
Text
Add Binding To IIS - PowerShell
Add Binding To IIS – PowerShell
Hi Guys, today we are going to disuses about how to add the binding to IIS using Powershell. In most case, during the deployments, the one of the painful activity is adding binding for new sites. So this below posts will help those members to one step towards of Automation.
The New-WebBinding cmdlet adds a new binding to an existing website.
#Assigining the URL which need to bind $_WebsiteUrl =…
View On WordPress
0 notes
dotnet-helpers-blog · 7 years ago
Text
Powershell Script for Website Availability Monitoring with Excel Report as output
Powershell Script for Website Availability Monitoring with Excel Report as output
In our previous post we already discussed about “How to check response code from a website using PowerShell“ by using single URL in example. Here let we discuss how to read the list of URLs from the text file and validate the list of URL . Finally script will generate the Excel file with the output result.
$URLListFile = "D:\PowerShell\URLList.txt" #Reading the list of URLs from the URLList.txt…
View On WordPress
0 notes
dotnet-helpers-blog · 7 years ago
Text
What's New With PowerShell
What’s New With PowerShell
Windows PowerShell® 5.0 includes significant new features that extend its use, improve its usability, and allow you to control & manage Windows-based environments more easily. Windows Server 2012 R2 introduced the notion of Desired State Configuration, PowerShell 5.0 advances this concept through OneGet. OneGet is a new module which way to search and install hundreds of software packages from the…
View On WordPress
0 notes
dotnet-helpers-blog · 7 years ago
Text
4 - How to validate the version of installation
4 – How to validate the version of installation
We can use $PSVersionTable.PSVersion to determine the engine version. If the variable does not exist is shown then it is safe to assume the engine is version 1.0 We also use,$Host, get-host , $PSVersionTable to get deep information about our power shell tool. Please find the snap for how to get the details.
View On WordPress
0 notes
dotnet-helpers-blog · 7 years ago
Photo
Tumblr media
How to get the array as input using Powershell To read an array into Read-Host, you would need to put it in a loop because anything entered into Read-Host will be interpreted as a string.
0 notes
dotnet-helpers-blog · 7 years ago
Text
PowerShell : Continue Keyword
PowerShell : Continue Keyword
Continue Keyword in PowerShell One of the things that is a bit confusing for powershell beginner is the Continue statement. This is partially because it does not act like it might in some other languages. Next question will arise, then what does the Continue statement do in Windows PowerShell? the answer is it returns flow to the top of the innermost loop that is controlled by a While, For,…
View On WordPress
0 notes