PowerShell Module DictionaryFile v 2.0

PowerShell Module DictionaryFile has been updated to version 2.0. The module has been redesigned to include more functionality with better inputs and outputs. We will go though the module to help you understand what you are able to do with it.

Module Description

PowerShell Module DictionaryFile v 2.0 will create all password combinations that you are able to have using a specific character set. Using this module you will be able to find number of all password combinations. You are able to create the combinations either on the screen or use them with other cmdlets in your scripts. Also, you are able to create a dictionary file, containing the generated passwords. If you have already generated a password file, you are able to import the file that you have already created and process its data by using the output with other cmdlets in your scripts.

In v 2.0 the module has the following cmdlets:

Get-PasswordNumber

Get-PasswordCombination

New-DictionaryFile

Get-DictionaryFile

Install DictionaryFile Module

To install the module you need to use the below:

Code:

Install-Module -Name DictionaryFile

To import the module use the below:

Code:

Import-Module -Name DictionaryFile

The module is Auto-import enabled so there is not need to import it every time you need to use any of the cmdlets.

Update DictionaryFile Module

If you have already installed DictionaryFile module before and you want to update it to the latest version, use the below:

Code:

Update-Module -Name DictionaryFile

[adinserter name=”In Article”]

Get-PasswordNumber

Get-PasswordNumber will calculate the number of possible passwords that you are able to generate based on your input and parameters. You can use this command to know beforehand what is the expected output when you want to create a dictionary file. It will provide you the number of combinations before you go and create them on screen or in a dictionary file. The cmdlet has a help file also so you can find more information about it.

Syntax:

Get-PasswordNnumber [-CharacterSet <String> or "alphabet"] [-MinCharacters <uint32>] [-MaxCharacters <uint32>] [-IncludeCapital] [-CapitalOnly] [<CommonParameters>]

For more information about this cmdlet, see Get-PasswordNumber.

Get-PasswordCombination

Get-PasswordCombination creates all possible passwords based on the character set and parameters that you will use and provides the results in the output. If you will not pipe the results in another cmdlet, the generated password will appear in console.

Syntax:

Get-PasswordCombination [-CharacterSet] <String> [-MinCharacters] <UInt32> [-MaxCharacters] <UInt32> [-IncludeCapital] [-CapitalOnly] [<CommonParameters>]

For more information about this cmdlet, see Get-PasswordCombination.

[adinserter name=”In Article”]

New-DictionaryFile

New-DictionaryFile creates all possible passwords based on the character set and parameters that you will use and saves those passwords in a text file.

Syntax:

New-DictionaryFile [-CharacterSet] <String> [-MinCharacters] <UInt32> [-MaxCharacters] <UInt32> [-IncludeCapital] [-CapitalOnly] [-Path] <String> [-WhatIf] [-Confirm] [<CommonParameters>]

For more information about this cmdlet, see New-DictionaryFile.

Get-DictionaryFile

Syntax:

Get-DictionaryFile [-Path] <String> [<CommonParameters>]

For more information about this cmdlet, see Get-DictionaryFile.

[adinserter name=”In Article”]

Examples

Example 1

In this example we will see the number of passwords that we are able to generate when we will have a character set of “a,b,c,1,2,3,$*&” . We define also that we need the passwords to be minimum 2 characters and maximum 5.

Code:

Get-PasswordNumber -CharacterSet "a,b,c,1,2,3,$,*,&" -MinCharacters 2 -MaxCharacters 5

Output:

Example 2

For our second example we create all combinations that we are able to have using “a,b,c” character set with minimum characters 1 and maximum characters 2.

Code:

PS C:\> Get-PasswordCombination -CharacterSet "a,b,c" -MinCharacters 1 -MaxCharacters 2

Output:

Example 3

Using Get-DictionaryFile , we are able to retrieve the values of a previously created file.

Code:

PS C:\> Get-DictionaryFile -Path C:\Scripts\DictionaryFile.txt

Output:

[adinserter name=”In Article”]

Tests and Timings

As the number of possible passwords increases exponentially, the time to create the passwords is also increased exponentially. The below screen shot shows one of the tests to find out the time that is needed to get the results.

The specifications of the PC that I run the tests are:

CPU: Intel Core [email protected]

RAM: 16 GB

OS: Windows 10 1803

PowerShell Version: 5.1

Hope you like DictionaryFile module.

You feedback is appreciated.

If you have any questions or anything else please let me know in the comments below.

[adinserter name=”In Article”]

Related Links

[adinserter name=”Matched-Content”]