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 readingCategory Archives: Powershell
Write 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 readingFix Truncated Powershell Output
PowerShell output is truncated for two main reasons: output cannot fit the console window or when PowerShell uses explicit parameters to determine how much output is displayed.
Continue readingLoop Through a CSV File Using Foreach in Powershell
CSV is a file of Character-Separated values where a comma is used in most cases as a delimiter. This article discusses two ways of looping through the values of a given CSV file.
Continue readingConcatenate Files in PowerShell
In this article, we will discuss ways of concatenating multiple files into one single file using PowerShell.
Continue reading