On one of the my colleagues new laptop we were setting up Visual Studio Code environment. After installing Microsoft PowerShell extension on VSCode when executing PowerShell ps1 script, it was getting stuck/freeze/hang with message "Starting up PowerShell" at the bottom-right side, and it was showin…
Blog posts : "Powershell"
Resovled issue with PowerShell - Trust relationship Rejoin computers in domain without restart
While working with The trust relationship between this workstation and the primary domain failed issue on Windows Servers, I used PowerShell cmdlet Test-ComputerSecureChannel and cmd command netdom to resolve the broken AD computer account trust relationship without reboot. Apart from these com…
PowerShell fix repair The trust relationship between this workstation and the primary domain failed
This is the issue I have always seen with Windows Server Administrator. They face below issue a lot in their day to day activities while logging with their domain account. When they login with local account it was successful. The cause of this issue is simple, whenever computer joins into domain the…
PowerShell save export data to XML file
I wanted to create XML file using PowerShell and PowerShell offers different ways to create XML file in different formats, with PowerShell you can create and generate different types of XML format. One of the simple way I shown in this article PowerShell Create XML document with XmlWriter .net obj…
PowerShell Create XML document with XmlWriter .net object
XML stands for eXtensible Markup Language it was designed to store and transport data and to be both human- and machine-readable. I wanted to create a simple readable XML files using PowerShell for few of the projects. There are native cmdlets (Export-CliXML and ConvertTo-XML) available in the Po…
Powershell Create new file if not exist, if exist Rename file
This small PowerShell script helps to create a new file inside the folder if file does not exist, if file exists rename it with the date and times. This logic I always use in my scripts when I want to implement logs system for my script. When the file is renamed (While creating new file) it adds dat…
PowerShell XML OperationStopped: No coercion operator is defined between types 'System.Object&' and 'System.Object'
While working with XML files using Powershell, I imported XML file and started exploring data inside XML. On the left hand side I have opened XML file in notepad. XML has nested objects. While accessing the nested data (Address) inside XML table I was receiving error OperationStopped: No coercion o…
PowerShell Encode or Decode an WebURL
While working few web scrapping project, I was able to get the table data, but few of the data had few special characters in the table, which was in http encoded format. Related article is a Powershell web scrapping extract table from html. The encoded http data was not readable. This data can be …
PowerShell convert string to base64 value
Base-64 encoding is a way of taking binary data and turning it into text so that it's more easily transmitted in things like e-mail and HTML form data. I had few requirement to convert / encode text string to Base64 string and vice versa, From encoded Base64 string to convert/decode to normal string…
Create an interactive HTML report with PowerShell data
Basically I wrote this project as an fun/poc, but it went very well. I wanted to show the HTML + PowerShell capabilities to my (Asset collection team) colleagues as there are endless possibilities what you can build using HTML + Powershell. After launching the html file in the chromium browser the w…
Automate Many-to-One client certificate mappings for IIS hardening using PowerShell
Recently while talking to one of my colleage from another department, he wanted help on PowerShell scripts to automate few IIS Webserver (Internet Information Services) advanced configuration where he was struggling setting few IIS settings of manyToOneMappings for hardning purpose, other setting…
Configure vCenter 7 Profile from PowerShell GUI
While working on POC of new feature VMware vCenter Server 7 Profiles, as there is no GUI available to configure it. At the moment of writing it can be only consumed and configured with Rest APIs. Although Rest API can be configured from vCenter Server developer center > API explorer, but it is not…
Powershell WPF MahApps.Metro update theme library
This script is just an update to new dll libraries of MahApps.Metro theme for Powershell WPF. I had already written basics of Part 3: Powershell wpf MahApps.Metro theme step by step guide but, It is almost 2 years back and I was using MahApps.Metro 1.6 version and new version of MahApps.Metro v2…
Powershell adding leading zeros to string or int
I was working on a script project where I wanted to create and defined names for multiple virtual machine in the series, with maintaining length of the string of names with numbers adding leading zeros, Below -f format operator one-liner command helps me to create the list.
… |
Powershell Dell iDrac redfish Rest API basic authentication
In one of my blog Configure Dell iDrac9 Rest API with Powershell I showed how use x-auth-token to connect to Dell iDrac, here I instead of token, using basic authentication (use UserName and Password each time to connect to Redfish iDRAC rest api), This is just a example and I will be using expli…
Powershell web scrapping extract table from html
This is small script I use to collect the table data from website to Powershell Object and then further it can be saved to csv file. For this example I am taking table example from https://datatables.net. I will try to convert table to Powershell Object. HTML tables has tags th (Table header) and …
PowerShell slice array into groups of smaller arrays
This is a small script to slice or break array into groups of smaller array, and I use it in my scripts most often. This script is very helpful when I want to batch process multiple server at time but not on all the server, instead fewer servers at servers in batch. Once I have a very big fat list o…
Powershell Convert range of numbers into another list of numbers maintaining ratio
Recently I was working on some PowerShell GUI project, Where I wanted to convert a range of number into another range of number maintaining ratio, for this I had to use one Arithmetic Math formula and, for example I have numbers between 1 to 200, Which I wanted to fit into new number of range bet…
Powershell Find application window state minimized or maximized
While working on one of the small freelance project there was a requirement to find whether launched application/process is minimized or maximized (For example when I open Microsoft excel what is the state whether it is minimized or maximized). This value of window state you can easily get with UIAu…
Configure Dell iDrac9 Rest API with Powershell
After writing 2 articles related on HPE ILO rest api, I had to automate Dell iDRAC9 systems using powershell. Dell iDRAC9 rest API is based on Redfish resources. HPE ILO5 also uses redfish for APIs but the resources and parameter usage are somewhat totally different, So I wrote Dell iDRAC codes fr…
Blog Search
Page Views
10399311
Archive
- September 2023 (6)
- July 2023 (15)
- June 2023 (5)
- May 2023 (9)
- April 2023 (4)
- March 2023 (7)
- February 2023 (1)
- January 2023 (1)
- December 2022 (10)
- November 2022 (15)
Comments
-
Rob LloydSeptember 25, 2023 06:06AM
-
September 21, 2023 03:16AM
-
Shahab HussainSeptember 11, 2023 01:28PM
-
josephAugust 31, 2023 04:25PM
-
SaraAugust 25, 2023 11:59AM