• Skip to primary navigation
  • Skip to main content
  • Skip to footer

Stephanos Constantinou Blog

PowerShell Scripting

  • Home
  • Blogs
    • PowerShell Tutorials
    • PowerShell Scripts
    • PowerShell Modules
      • Modules Cmdlets
    • Software Reviews
  • About
  • Contact
You are here: Home / PowerShell Modules / PowerShell Module DictionaryFile

PowerShell Module DictionaryFile

13/09/2018 by Stephanos Leave a Comment

PowerShell Module DictionaryFile

In this post I will provide you with some information about PowerShell Module DictionaryFile, which I wrote and published in PowerShell Gallery. This is my first module that I publish and I hope that you will like it.

Note: Module has been updated to version 2.0. Please check here to find the current version.

Module description

DictionaryFile will provide you with the ability to calculate the possible number of passwords based on your input and parameters. This module will allow you also to create those passwords and it will save them in a dictionary file that you are able to use at a later stage. The module currently will provide you with only two cmdlets. After you install the module and import it will make available the below cmdlets.

  • Get-PasswordNumber
  • Get-DictionaryFile 

In this post I will not go through and explain the code behind the module but I will provide you with the features and how you are able to use the module. You can install the module by using the below:

Code:

Install-Module DictionaryFile

To import the module use the below:

Code:

Import-Module 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.

[adinserter name=”In Article”]

Get-PasswordNumber

Get-PasswordNumber will calculate the number of possible password 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 an answer before try to generate the file in order to whether to proceed to create such file or not. The cmdlet has a help file also so you can find more information about it.

Syntax:

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

If you want to find more about the specific cmdlet while you in PowerShell you can use the below to get the help file.

Code:

Get-Help Get-PasswordNumber

Output:

PowerShell Module DictionaryFile - Get-PasswordNumber - Help

You are also able to see the full version of help for the cmdlet by using the below:

Code:

Get-Help Get-PasswordNumber -Full

Now lets see few examples about Get-PasswordNumber

[adinserter name=”In Article”]

Example 1

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

Code:

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

Output:

PowerShell Module DictionaryFile - Get-PasswordNumber - Example 1

Example 2

By using -IncludeCapital parameter, we tell the cmdlet use also the upper case letters for the specified ones. The actual letters that will be used will be “a,b,c,A,B,C”.

Code:

Get-PasswordNumber -Characters "a,b,c" -Numbers "1,2,3" -Symbols "$,*,&" -MinCharacters 2 -MaxCharacters 5 -IncludeCapital

Output:

PowerShell Module DictionaryFile - Get-PasswordNumber - Example 2

Example 3

-CapitalOnly parameter will convert or lower case letters to upper case letters and it will calculate based on that.

Code:

Get-PasswordNumber -Characters "a,b,c" -Numbers "1" -Symbols "$" -MinCharacters 2 -MaxCharacters 5 -CapitalOnly

Output:

PowerShell Module DictionaryFile - Get-PasswordNumber - Example 3

Example 4

Instead of specifying the exact letters that you would like to use, you are able also to use “alphabet” as input for -Characters parameter. This will include all letters in English alphabet.

Code:

Get-PasswordNumber -Characters alphabet -Numbers "1,2,3" -Symbols "$,*,&" -MinCharacters 2 -MaxCharacters 5

Output:

PowerShell Module DictionaryFile - Get-PasswordNumber - Example 4

[adinserter name=”In Article”]

Get-DictionaryFile

The second cmdlet that DictionaryFile module will provide you is Get-DictionaryFile. This cmdlet will actually create the dictionary file with all possible passwords that you are able to generate using the specified letters, numbers and symbols. Get-DictionaryFile will first calculate the number of possible passwords and it will wait for your confirmation whether to proceed or not to create the file with those password. 

Syntax:

Get-DictionaryFile
    [-Characters <String[]> or "alphabet"]
    [-Numbers <String[]>]
    [-Symbols <String[]>]
    [-MinCharacters <uint32>]
    [-MaxCharacters <uint32>]
    [-IncludeCapital]
    [-CapitalOnly]
    [-Path <String[]]
    [<CommonParameters>]

 

If you want to find more about the specific cmdlet while you in PowerShell you can use the below to get the help file.

Code:

Get-Help Get-DictionaryFile

Output:

PowerShell Module DictionaryFile - Get-DictionaryFile - Help

You are also able to see the full version of help for the cmdlet by using the below:

Code:

Get-Help Get-DictionaryFile -Full

Now lets see some examples for Get-DictionaryFile cmdlet.

[adinserter name=”In Article”]

Example 1

In example 1 we are using “a,b,c,1,$” as our character set and we can see in the output below that the number of possible passwords is 3900. After our confirmation, it will check for the file and it will perform the appropriate changes in order to have a fresh dictionary file to start working with.

Code:

Get-DictionaryFile -Characters "a,b,c" -Numbers "1" -Symbols "$" -MinCharacters 2 -MaxCharacters 5

Output:

PowerShell Module DictionaryFile - Get-DictionaryFile - Example 1

Test:

PowerShell Module DictionaryFile - Test 1

[adinserter name=”In Article”]

Example 2

Here we can see that we are also able to provide our own path where we need to save out dictionary file.

Code:

Get-DictionaryFile -Characters "a,b,c" -Numbers "1" -Symbols "$" -MinCharacters 2 -MaxCharacters 5 -Path C:\Scripts_Output\MyFile.txt

Output:

PowerShell Module DictionaryFile - Get-DictionaryFile - Example 1PowerShell Module DictionaryFile - Get-DictionaryFile - Example 2

Test:

PowerShell Module DictionaryFile - Test 2

[adinserter name=”In Article”]

Example 3

In this example, we are using -IncludeCapital parameter, which adds also the upper case letters of the specified ones. As you can see the number of possible passwords now is bigger as we have more characters now. The actual characters that it is using now are “a,b,c,1,$,A,B,C”.

Code:

Get-DictionaryFile -Characters "a,b,c" -Numbers "1" -Symbols "$" -MinCharacters 2 -MaxCharacters 5 -IncludeCapital

Output:

PowerShell Module DictionaryFile - Get-DictionaryFile - Example 3

Test:

PowerShell Module DictionaryFile - Test 3

[adinserter name=”In Article”]

Example 4

Here by using -CapitalOnly parameter we force our cmdlet to convert all lower case letters to upper case letters.

Code:

Get-DictionaryFile -Characters "a,b,c" -Numbers "1" -Symbols "$" -MinCharacters 2 -MaxCharacters 5 -CapitalOnly

Output:

PowerShell Module DictionaryFile - Get-DictionaryFile - Example 4

Test:

PowerShell Module DictionaryFile - Test 4

[adinserter name=”In Article”]

Example 5

Code:

Get-DictionaryFile -Characters alphabet -Numbers "1" -Symbols "$" -MinCharacters 2 -MaxCharacters 5

Output:

PowerShell Module DictionaryFile - Get-DictionaryFile - Example 5

Test:

PowerShell Module DictionaryFile - Test 5

[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. As you saw in my examples, I have provided also the timings for the command to run and create the file.

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

  • CPU: Intel Core i7-3770K@4.60GHz
  • 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:

  • PowerShell Scripts
  • PowerShell Tutorials
  • Install-Module – Microsoft Docs
  • PowerShell Gallery DictionaryFile
  • PowerShell Arithmetic Operators
  • Import-Module – Microsoft Docs
  • PowerShell Comparison Operators
  • Get-Help – Microsoft Docs
  • Add-Content – Microsoft Docs
  • ForEach-Object – Microsoft Docs
  • New-Alias – Microsoft Docs
  • New-Item – Microsoft Docs
  • Out-Null – Microsoft Docs
  • about_For | Microsoft Docs
  • about_If | Microsoft Docs
  • about_Switch | Microsoft Docs
  • about_Throw | Microsoft Docs
  • Read-Host – Microsoft Docs
  • Remove-Item – Microsoft Docs
  • Select-Object – Microsoft Docs
  • Split-Path – Microsoft Docs
  • Test-Path – Microsoft Docs
  • Write-Output – Microsoft Docs
  • Write-Warning – Microsoft Docs
  • Publish-Module – Microsoft Docs
  • New-ModuleManifest – Microsoft Docs
  • Get-Help – Microsoft Docs

[adinserter name=”Matched-Content”]

Summary
PowerShell Module DictionaryFile
Article Name
PowerShell Module DictionaryFile
Description
PowerShell Module DictionaryFile. Here you will find information about PowerShell Module DictionaryFile and its use. Stephanos Constantinou Blog
Author
Stephanos
Publisher Name
Stephanos Constantinou Blog
Publisher Logo
Stephanos Constantinou Blog

Filed Under: PowerShell Modules Tagged With: Add-Content, Arithmetic Operators, Comparison Operators, DictionaryFile Module, ForEach-Object, Functions, Import-Module, Install-Module, New-Alias, New-Item, New-ModuleManifest, Out-Null, PowerShell For, PowerShell If, PowerShell Modules, PowerShell Switch, PowerShell Throw, Publish-Module, Read-Host, Remove-Item, Select-Object, Split-Path, Test-Path, Write-Output, Write-Warning

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Footer

Recent Posts

  • ICS Cube Product Review 26/04/2019
  • PowerShell Module SysInfo v1.2.0 15/03/2019
  • PowerShell Module SysInfo v1.1.2 13/11/2018
  • PowerShell Module SysInfo 24/10/2018
  • Get-VoltageProbe 24/10/2018
  • Get-VideoController 24/10/2018
  • Get-USBController 24/10/2018
  • Get-TrackPoint 24/10/2018
  • Get-TrackBall 24/10/2018
  • Get-TouchScreen 24/10/2018
Planet PowerShell

Categories

  • Modules Cmdlets (57)
  • PowerShell Modules (5)
  • PowerShell Scripts (38)
  • PowerShell Tutorials (35)
  • Software Reviews (2)

Archives

  • April 2019 (1)
  • March 2019 (1)
  • November 2018 (1)
  • October 2018 (56)
  • September 2018 (13)
  • August 2018 (9)
  • July 2018 (6)
  • June 2018 (8)
  • May 2018 (7)
  • April 2018 (9)
  • March 2018 (4)
  • February 2018 (6)
  • January 2018 (12)
  • December 2017 (4)
Top 10 PowerShell 2018

Blogroll

  • Planet PowerShell
  • Reddit – PowerShell
  • PowerShell Magazine
  • PowerShell.org
  • PowerShell Team Blog
  • Hey, Scripting Guy! Blog
  • Mike F Robbins
  • PowerShell Explained with Kevin Marquette
  • Mike Kanakos – Network Admin
  • The Lonely Administrator
  • AskME4Tech
PowerShell Blogs Sysadmin Blogs Banners for Top 20 Programming Blogs

© 2023 · Stephanos Constantinou Blog

  • Home
  • Blogs
  • About
  • Contact