PowerShell Examples: Using Bing to measure the popularity of cmdlets in a specific PowerShell module

This blog is part of a series that shows example PowerShell code for those learning the language. This time we’re using PowerShell to find out which PowerShell cmdlet in a specific module is the most popular. To do this, we’re using a Bing search and producing a list with the name and number of web … Continue reading PowerShell Examples: Using Bing to measure the popularity of cmdlets in a specific PowerShell module

PowerShell Examples – Random words and their popularity via Bing

This blog is part of a series that shows example PowerShell code for those learning the language. This time we’re using PowerShell to generate random words and check if they are popular by using a Bing search. The words are color-coded as white (not found on the web), green (between 1 and 1,000 hits on … Continue reading PowerShell Examples – Random words and their popularity via Bing

PowerShell Examples: Guess the number

This blog is part of a series that shows example PowerShell code for those learning the language. This time we’re using PowerShell create a simple game where you need to guess a number. This example explores basic loops, logical operations (like –ne, –ge, –lt) and entering data with Read-Host.   ## Guess the number# [int] … Continue reading PowerShell Examples: Guess the number

PowerShell Examples: Counting words in a text file

This blog is part of a series that shows example PowerShell code for those learning the language. This time we’re using PowerShell to count lines, count words, find the largest word and find the most frequently used words in a text file. To make it interesting, we’re using a plain text version of “Alice in … Continue reading PowerShell Examples: Counting words in a text file

PowerShell Examples: Generating Random Names

This blog is part of a series that shows example PowerShell code for those learning the language. This time we’re using PowerShell to generate random full names using common first names and common last names. It basically combines a random first name with a random letter for middle initial and a random last name. This … Continue reading PowerShell Examples: Generating Random Names

PowerShell Examples: Calculating the value of Pi

This blog is part of a series that shows example PowerShell code for those learning the language. This time we’re using PowerShell to find the value of Pi. This is done using one of the many methods available, using a division between n! (factorial) and (n*2+1)! (factorial of odd numbers). This example explores loops and … Continue reading PowerShell Examples: Calculating the value of Pi

PowerShell Examples: Calculating Prime Numbers

This blog is part of a series that shows example PowerShell code for those learning the language. This time we’re using PowerShell to find prime numbers. This is not using any sophisticated method, just checking the remainder for all numbers between 2 and the square root of the number. This example explores loops and general … Continue reading PowerShell Examples: Calculating Prime Numbers

PowerShell Examples: Calculating very small and very large numbers

This blog is part of a series that shows example PowerShell code for those learning the language. This time we’re using PowerShell to find some very small and very large floating point numbers. The principal here is that if you keep dividing a number by 2, there will be a point where the number is … Continue reading PowerShell Examples: Calculating very small and very large numbers

New version of the Storage Spaces physical disk validation PowerShell script

The Storage Spaces team has just published a new version of the Storage Space disk validation script written in PowerShell. This script makes sure that the physical disks in a system have everything that is needed by Storage Spaces. That includes checking functional requirements and performance characteristics. In the same way that we ask you … Continue reading New version of the Storage Spaces physical disk validation PowerShell script