PowerShell and retrieving environment variables from a content file

I was recently creating a Windows PowerShell script which retrieved content from a JSON-formatted file containing configuration information to be used as variables. A number of  configuration values contained an evironment variable for the user profile of the current user. When retrieving the value the string would be returned as a string and not the dynamic … More PowerShell and retrieving environment variables from a content file

Windows PowerShell Exit Codes, SSIS and the Environment.Exit Method

I was recently compiling a PowerShell script which would be integrated into a SSIS package, depending on the status of the script invocation this would return custom error codes to determine success or failure as part of the package. By default, I would generally use Try/Catch statements and provide and exit code. However, when invoking … More Windows PowerShell Exit Codes, SSIS and the Environment.Exit Method

Powershell.org – Scripting Games Puzzle August 2015

So the PowerShell.org Scripting Games Puzzle for August is about to expire, so rather later than never I decided to give it a go and meet the challenges set by the puzzle, in short challenge was as follows: At http://www.telize.com/geoip, you’ll find a JavaScript Object Notation endpoint. It’s public. Being able to query information from … More Powershell.org – Scripting Games Puzzle August 2015

Consolidating unmounted and open snapshots after virtual machine backup

At times, one or more disks from a virtual machine will remain mounted and snapshots will remain following the backup of a virtual machine. The cause of this is generally due to their not being enough time to unmount the disks and consolidate the snapshots when the job completes. This would require user interaction to … More Consolidating unmounted and open snapshots after virtual machine backup

PowerCLI: Retrieving ESXi Host System Management Network IP Address

I was recently looking at retrieving the allocated management network IP address for a large number of ESXi host systems and therefore decided to use the ‘Get-VMHostNetworkAdapter’ cmdlet  to which I would filter based on the device name value retrieved from the ESXi host system. In its simpliest form the cmdlet can be invoked as below: … More PowerCLI: Retrieving ESXi Host System Management Network IP Address