How to Comment Out Code in PowerShell Script

This guide gives you an overview of code commenting options in PowerShell. Just like any other programming language, you can comment out code in a PowerShell script for documentation purposes. Single-line comments in PowerShell To comment out a single line, put '#' in the beginning: Multiline Comments in PowerShell To comment out multiple lines, put ... Read more

How to Create Multiple Hyper-V Virtual Machines Using PowerShell

Hyper-V PowerShell

Creating multiple Hyper-V virtual machines using Hyper-V manager is not a quick method. The quickest and time-saving method is to create them via Windows PowerShell. This tutorial has been written to show you how to create three Hyper-V virtual machines with a PowerShell script. Create Multiple Hyper-V Virtual Machines Using PowerShell Step 1. Open notepad editor ... Read more

Save List of Services to a File using PowerShell in Windows 10

List services using PowerShell

Microsoft Windows services allow running long-running applications in the background. When the computer is booted, the services start automatically and continue running until the computer is turned off, but you can also pause and disable the service. The Windows Services application lists all services, including those that are running and those that are stopped. If ... Read more

How to Find Out Specifications of Server Using PowerShell

Get Server specs using PowerShell

When you are running a Windows server core version and you need to find out the specs of your server then this tutorial will show you how to do that with a small PowerShell script. Get Server Details with PowerShell Step 1. Open PowerShell with elevated privileges. Step 2. Execute the following two commands (as ... Read more

How to Read a File using PowerShell

If you are working as an admin on Windows Core Server and want to check the contents of a file, you can execute the following command: get-content C:\testfile.txt This command will display the contents of the file using PowerShell. To save the contents in a variable, you can execute: $FileContent = get-content C:\testfile.txt To read the ... Read more

How to Start Multiple Services With the Help of PowerShell

Run multiple PowerShell Commands at once

This short guide will show you how to start multiple services simultaneously with the help of PowerShell. Start Multiple Services or Applications with PowerShell 1. Open PowerShell with administrative privileges. 2. Execute the following command (Suppose when you are required to search all exchange related services and start them, just replace the parameter). Get-Service "*Exchange*" ... Read more

How to View Office 365 User Account Details in PowerShell

PowerShell get-msoluser command

In this article, I'll show you to retrieve Office 365 user account details with the help of PowerShell using get-msoluser. Prerequisites Download and install the following modules. Microsoft Online Service Sign-in Assistant for IT Professionals RTW Windows Azure Active Directory Module for Windows PowerShell (64-bit version) View Office 365 User Account Details in PowerShell - ... Read more