Part Two – Computing email address hash value using Windows PowerShell

In part one I discussed computing the hash value using the MD5 hash algorithm for an email address, in this post I am going to discuss using other hash algorithms available in the HashAlgorithm Class to compute the value. The available hash algorithms are MD5, RIPEMD160, SHA1, SHA256, SHA384 and SHA512 therefore in the advanced function we will … More Part Two – Computing email address hash value using Windows PowerShell

Part One – Computing email address hash value using Windows PowerShell

I was recently discussing tracking email addresses and in particular protecting sensitive information and ensuring that the email address may not be re-used on deactivation. This got me thinking of how we could achieve this using Windows PowerShell. As the advanced function required an email address I wanted to validate the  parameter specified for an email … More Part One – Computing email address hash value using Windows PowerShell

A simple script to create Windows PowerShell Module structure

As part of creating Windows PowerShell modules, I have recently created a script to create the structure required, as follows: [CmdletBinding()] Param ( [String] $ModuleName = "TestModule", [String] $Author = "", [String] [ValidateScript({Get-Item $_ })] $Path = "C:\Sandbox\PowerShell\Modules" ) New-Item ($Path + "\" + $ModuleName + "\" + $ModuleName) -Type Directory | Out-Null New-Item ($Path … More A simple script to create Windows PowerShell Module structure

Generating log output using Windows PowerShell

I previously wrote a post in regards to streaming output to a log file synchronously in Windows PowerShell, which was required for a specific reason to lock the file during the script invocation and event message generation. I have since created an advanced function to provide the ability to generate event messages to the console and/or a log file … More Generating log output using Windows PowerShell

Inheriting Verbose Preference in Windows PowerShell Module Functions

When specifying verbose preference this will only be inherited by the scripts module functions, if specified in the global scope. However, it is possible to use an advanced function to access the variable preference using the ‘$PSCmdlet.GetVariableValue()’ method to access the SessionState object and inherit the preference value. [CmdletBinding()] Param ( $VerbosePreference = $PSCmdlet.GetVariableValue('VerbosePreference') ) view … More Inheriting Verbose Preference in Windows PowerShell Module Functions