PowerShell Random Password Generator

powershell generate random password

Recently, one of my clients asked me to create a random password generator. I suggested PowerShell for it. In this tutorial, I will show you how to create a random password generator using PowerShell. Generate Random Password Using PowerShell Now, let me show you different methods to generate random passwords using PowerShell. Method 1: Using … Read more

How to Set Variables in PowerShell?

Set Variables in PowerShell

In PowerShell, you can create a variable by defining a variable name and then setting its value with the Set-Variable command. In this tutorial, I will explain how to set variables in PowerShell using different methods and with examples. To set a variable in PowerShell using the Set-Variable cmdlet, use the following syntax: Set-Variable -Name … Read more

How to Generate Random Strings in PowerShell?

Generate Random Strings in PowerShell

Recently, a system administrator asked me about generating random strings in PowerShell. I explained different examples. In this tutorial, I will explain how to generate random strings in PowerShell with a few examples. To generate a random string in PowerShell using the Get-Random cmdlet, define the desired string length and a set of characters to … Read more

How to Set and Get Environment Variables in PowerShell?

get environment variable PowerShell

Recently, someone from a PowerShell community asked me about setting environment variables in PowerShell. PowerShell provides different cmdlets to do this. Let me share with you here how to set and get environment variables in PowerShell. To set an environment variable in PowerShell, you can simply use the $env variable followed by the variable name … Read more

How to Generate Random Numbers in PowerShell?

powershell random number within range

Recently, someone asked me about different methods to generate random numbers in PowerShell. I suggested different methods with examples. In this tutorial, I will show you how to generate random numbers in PowerShell with examples. To generate random numbers in PowerShell, you can use the Get-Random cmdlet. For example, to generate a single random number, … Read more

PowerShell Pipeline Variables [With Examples]

PowerShell Pipeline Variables

Recently, I gave an online session on pipeline variables for a PowerShell user group. In this tutorial, I will explain everything about PowerShell pipeline variables with examples. Pipeline variables in PowerShell, introduced with the -PipelineVariable parameter in PowerShell 7, allow you to store the output of a command within a pipeline for reuse later in the same … Read more

PowerShell Print Variable [With Examples]

powershell print variable

While working in PowerShell, there will be times when you are required to print the value of variables for debugging or logging purposes. In this tutorial, I will explain how to print variables in PowerShell using different methods and examples. To print a variable in PowerShell, you can use the Write-Output cmdlet, which sends the … Read more

How to Get Computer Name in PowerShell?

Get Computer Name in PowerShell

Recently, someone asked me to get the computer’s name in PowerShell. I tried different methods. In this tutorial, I will show you how to get the computer name in PowerShell using various cmdlets. To get the computer name in PowerShell, you can use several methods. The simplest is using the environment variable $env:COMPUTERNAME. Alternatively, you … Read more

How to Restart a Computer Using PowerShell?

I will show you here how to restart a computer using PowerShell. We will see different cmdlets with examples. To restart a computer using PowerShell, you can use the Restart-Computer cmdlet. For a local restart, simply run Restart-Computer in an elevated PowerShell session. To restart a remote computer, use Restart-Computer -ComputerName “RemoteComputerName” and provide credentials … Read more

How to Change Directory in PowerShell?

Do you need to know how to change the directory in PowerShell? In this tutorial, I will show you different methods to change the directory in PowerShell. To change directories in PowerShell, you can use the cd command followed by the path of the directory you wish to navigate to. For example, to switch to … Read more

100 PowerShell cmdlets download free

100 POWERSHELL CMDLETS E-BOOK

FREE Download an eBook that contains 100 PowerShell cmdlets with complete script and examples.