PowerShell errors come in two flavors – terminating and non-terminating errors.
Continue readingCategory Archives: Powershell
Read File Into Array in Powershell
PowerShell offers different tools to use to read files into arrays. In this article, we will discuss two of them:
- Get-Content cmdlet and
- Import-Csv cmdlet
Import CSV Files Into Array in PowerShell
This article discusses how to load a CSV file into a PowerShell array using two methods:
- Method 1: Using Import-Csv cmdlet, and
- Method 2: Reading CSV data with Get-Content and then processing each row.
Find the Position of a Substring in PowerShell
This article discusses ways of finding a substring’s position in a PowerShell string. We will, in particular, discuss the following three methods, each serving a unique purpose.
Continue readingWrite to Table in Powershell
This article uses examples to discuss different methods of writing data into a table in PowerShell. In particular, we will discuss how to write user-defined data to a PowerShell table, read data from a file and write it to a table, format PowerShell output as a table, and write output into a tabular form data file like a CSV.
Continue readingDelete Windows Service in Powershell
Sometimes, we may need to remove Windows services installed on our PCs. For example, we may want to delete orphaned services left over after uninstalling the application running them, or you may want to delete Windows Services simply because you don’t need them.
Continue readingList Windows Services using PowerShell
Windows services are Windows executables that run in the background to support the working of some Windows processes. These services can be started, stopped, restarted, suspended, resumed, or even removed.
Continue readingAdd a New Line in Powershell
PowerShell includes different options for formatting console output. This article will discuss four methods of adding a new line in the PowerShell output.
Continue readingget-date Format yyyymmddhhmmss in Powershell
The Get-Date cmdlet gets the current date and time. Here is an example,
Continue readingget-date Format Milliseconds in Powershell
A millisecond is a thousandth of a second. Get-Date, by default, gets the current datetime without milliseconds. For example,
Continue reading