Live Developer Training starts 5 October 2026. Seats are limited.Live training starts 5 OctReserve your seat →Reserve →

Export Arrays to CSV in PowerShell

Export Arrays to CSV in PowerShell

Over the years, I’ve found that exporting data to CSV files is one of the most common tasks when working with PowerShell. Recently, one of my clients asked us to export arrays to CSV in PowerShell. There are various methods to do so. In this tutorial, I will explain several ways to export arrays to … read more…

How to Convert Date to String in PowerShell (5 Simple Methods)

powershell convert date to string

When working with PowerShell scripts, I frequently need to convert dates to strings for various purposes – whether it’s creating log files, generating reports, or naming files with timestamps. There are various methods to do in PowerShell. In this tutorial, I will explain five different methods to convert dates to strings in PowerShell, using practical … read more…

PowerShell Functions [Create and Use Functions]

powershell function

PowerShell functions are essential building blocks that help simplify scripts and make code more reusable. These blocks of code perform specific tasks when called by name, saving time and reducing repetition in PowerShell scripts. Functions work like mini-programs within your larger script, accepting inputs, processing data, and returning results. In this tutorial, I will explain … read more…

How to Add Items to an Array in PowerShell (5 Simple Methods)

powershell add item to array

Recently, I was developing an automation script to manage a large inventory of servers, and I needed to add items to an array as the script ran dynamically. The challenge is that PowerShell handles arrays differently than many other programming languages. In this tutorial, I will show you five proven methods to add items to … read more…

PowerShell Test-Path: How to Verify File and Folder Existence

PowerShell Test-Path Example

The PowerShell Test-Path cmdlet is used for checking if a file or folder exists on your computer. It returns “true” if the path exists and “false” otherwise, so you can quickly confirm file locations before running commands or scripts. This saves time and helps avoid annoying errors when you’re dealing with files and directories. PowerShell … read more…

PowerShell Write to File UTF-8: Complete Guide with Examples

PowerShell Write to File UTF-8

When working with PowerShell scripts, I often need to output data to text files. Over the years, I have learned that using the correct encoding, particularly UTF-8, is crucial for handling special characters and international text accurately. In this tutorial, I’ll show you multiple methods to write data to files using UTF-8 encoding in PowerShell. … read more…

How to Write to a File in a PowerShell Loop (5 Efficient Methods)

powershell write to file in loop

When working with PowerShell automation, I often need to process data in loops and write the results to files. This is a common requirement when generating reports, logging application activities, or processing batches of data. Over my years of PowerShell experience, I’ve discovered several effective approaches to writing data to files within loops. In this … read more…

PowerShell Execution Policy: A Comprehensive Guide

powershell set execution policy

Have you encountered an error “execution of scripts is disabled on this system” while trying to run a PowerShell script? I am sure you must have at least at the beginning. This is because of PowerShell’s execution policy settings. In this article, I will walk you through everything you need to know about PowerShell execution … read more…

How to Write to File without Carriage Return in PowerShell

"More text added" | Out-File -FilePath C:\Bijay\output.txt -Append -NoNewline

Recently, I was working on a PowerShell script that needed to output data to a file in a very specific format. The challenge was that I needed to write content to a file without adding carriage returns (line breaks) at the end of each line. This can be particularly important when you’re generating configuration files, … read more…

How to Append Text to Files in PowerShell

Append Text to Files in PowerShell

As a PowerShell user, I’ve found that one of the most common tasks is writing data to files, especially appending content to existing files without overwriting previous information. This will be helpful in scenarios such as creating logs, generating reports, or saving script output, etc. In this tutorial, I’ll walk you through the different methods … read more…

PowerShell Write to File [With Examples]

powershell write to file

If you are working as a PowerShell administrator, then you should know how to write to a file in PowerShell. PowerShell provides different methods for writing to files. I will show you here how to write data to a file using PowerShell, using different methods and examples. Method 1: Using Out-File Cmdlet The Out-File cmdlet … read more…