PowerShell Script to Remotely Update Registry keys and Restart Services on multiple Computers with Progress bar showing the Status of the Script

Requirement: In an enterprise automation its very often a requirement to REMOTELY Query list of servers/computers/desktops Apply a registry change to the servers/computers/desktops Restart a Service on the servers/computers/desktops Solution: Implementing a PowerShell script for such an automation requirement helps you easily build enterprise capabilities to the script like: Showing a Progress bar indicating current activity of the script and how much percentage the processing is completed Implement safety check to avoid attempts connect to an inaccessible or offline servers/computers/desktops Display output to standard output channel Examples: PowerShell in PowerGUI: Code: $Servers = Get-Content “C:\Temp\Servers.txt” $TotalServersCount = ($Servers).Count $PerCentageCounter = […]

Read more

PowerShell : Finding number of lines in a File

Requirement: In Automation using PowerShell Scripting its very often a requirement to read input from a file.  Usually the input is separated by new line in the file. Your PowerShell should read all lines from the file and process the input line by line. Say, you have list of servers in file and you want to check service status for each of the server in the file.  Solution: In PowerShell Get-Content is used for most cases to read a file and process it line by line. It just works fine in most of the cases. But if you need to […]

Read more