While working with CSV file I had few column in the true and false boolean value. But when I was importing csv file in PowerShell it was treating them as a string value instead of boolean in the output. Here I will explore how to convert true and false values to boolean.
At first glance, as in the below shared PowerShell script looks like a simple set of nested foreach loops printing numbers. But it has very powerful - and always overlooked - control structure: calledLoop Label.
When you’re running PowerShell scripts as scheduled tasks, background jobs, Runspace jobs, or on remote servers, normal Write-Host or Write-Debug output often disappears. That’s where System.Diagnostics.Trace comes in.
System.Diagnostics.Trace is a built-in.NET class designed to instrument, monit…
While working with VMware Tools, I needed to audit exactly which features/components were installed on a VM. VMware Tools isn’t just one package — it installs several sub-features like drivers, services, and utilities. I wanted a clean report showing each component and whether it was actually instal…
When writing long-running PowerShell scripts, displaying real-time feedback keeps users engaged and reassures them that the script hasn't frozen. However, flooding the console with hundreds of lines of text makes it unreadable, and using Clear-Host causes an annoying screen flicker.
This script focuses on automating the audit of Active Directory and LDAP settings across multiple generations of HPE iLO using PowerShell and the Redfish API. Before running the script First you will need to create a CSV file with HPE Generation, IP, username and password information as shown in the…
In this article, I demonstrate how to test network connectivity for a list of computer names or IP addresses using PowerShell. Each target system is tested for ICMP reachability (ping) and TCP connectivity on port 445, which is commonly used for SMB.
I will explore Enter-AzVM cmdlet in this blog article which is a part of az.ssh module and establishes a connection over SSH port 22. In this article I will show how to setup windows server to accept SSH connection. Before you start, make sure you've using below commands.:
In this article I will explore running commands remotely on Azure VM without login and this doesn't require full RDP session. This is very useful feature if some information need to fetched or any configuration need to be done without much efforts. If you check on Azure portal navigate to Virtual Ma…
Enumeration is the action of mentioning a number of things one by one, often to count them or describe them but it has specific meanings in computer science, data types like enum for named constants.
In the PowerShell to list the enumeration information for a parameter, you will need to use elem…
This simple PowerShell script clones Nutanix Linux virtual machines. To use this script, first download and install the PowerShell cmdlets from Nutanix Prism Central. You can find the installed plugin folder under C:\Program Files(x86)\Nutanix folder. From there you can load plugins.
I recently received a task to rename a bunch of files by changing their numbering in the filename while working on a PowerShell DevOps project. I had multiple Markdown files with numbers at the start of their names, and I needed to change these numbers with the filename based on a mentioned in CSV f…
This article dives into the Test-TcpPort function, a compact script that resolves hostnames to IPs, pings for basic reachability, and tests port connectivity with a timeout. I will break down its mechanics in short. At its core, Test-TcpPort leverages .NET's System.Net and System.Net.Sockets namespa…
In this article, I will explore two PowerShell scripts that test network connectivity (Ping) and port availability (Port Query) on multiple computers. I will discuss the scripts, their differences, and how to use them effectively. First Script is used for Synchronous Network Testing. The first scrip…
While working with PowerShell Remoting (PSRemoting), I was able to successfully connect to a remote machine using Enter-PSSession, but any administrative command—such as resetting the local Administrator password—failed with:
After successfully configuring Microsoft PowerShell PSRemoting, I was able to login with local Administrator user without any issue. But after creating another user, adding it to Administrators group then logging with it was throwing error message of Access is denied.
This is very simple and easy instructions to configure PowerShell PSRemoting WinRM on Windows system which is not joined into domain (Basically they are in workgroup). On the the first system login and and open PowerShell as administrator and Run below commands to configure PowerShell Remoting.
This PowerCLI GUI script I have written to audit VMware ESXi clusters high availability (HA) inside vCenter Server. This script validates below ideal configuration is defined on the cluster and tells me whether configuration is correct with green tick and non-compliant with red cross.
When sorting CSV data with PowerShell, I observed unexpected results, as shown in the screenshot below. The initial command, Import-Csv C:\Temp\Numberings.csv, shows that the numbers in the CSV are out of sequence. To sort these numbers, I used the simple pipeline command Sort-Object specifying the
This is another script I have written to encode and decode string for Terraform using PowerShell GUI. These scripts helps me in the live demonstrations and PowerPoint to client about infrastructure as a code. Once script is executed in PowerShell GUI, it looks like below, It helps to Base64 Encode g…