Skip to content

Instantly share code, notes, and snippets.

View juneb's full-sized avatar

June Blender juneb

View GitHub Profile
@juneb
juneb / Test-PSFileHash.ps1
Last active December 20, 2016 18:09
Verifies that the file hash of a PowerShell open-source installer matches expected value.
<#
.SYNOPSIS
Verifies that the file hash of a PowerShell open-source installer matches expected value.
.DESCRIPTION
Compares the file hash of a PowerShell open-source installation file to the expected file hash value. Supports
all installation file types, including msi, zip, rpm, deb, pkg, and tar.gz, beginning with installers for PowerShell
release 6.0.0.9.
To get a list of installer file names, but not test the file hash, use the ListOnly parameter.
<#
.SYNOPSIS
Gets the installed .NET versions.
.DESCRIPTION
Gets the versions of all installed Microsoft .NET Framework builds
installed on the local computer.
.EXAMPLE
.\Get-DotNetVersion
@juneb
juneb / Get-LatestModule.ps1
Created July 1, 2016 01:37
Gets the newest version of each module on the system.
<#
.SYNOPSIS
Gets the newest version of each module on the system.
.DESCRIPTION
Gets the newest version of each module on the system. Designed for PowerShell 5.0 where you can have multiple versions of the same module in different directories or in the same directory (in different version subdirectories). Returns only one version of each module.
.EXAMPLE
$LatestModules = .\Get-LatestModule.ps1
@juneb
juneb / Get-ParameterDescription.ps1
Created June 16, 2016 16:19
Gets the descriptions of a parameter from different commands in one or more modules.
<#
.SYNOPSIS
Gets the descriptions of a parameter from different
cmdlets in one or more modules.
.DESCRIPTION
The Get-ParameterDescriptionfromXMLFile script returns the
description of a parameter from cmdlets in one/more modules.
If the cmdlet has the parameter, but the description is blank,
the script returns the blank description.
@juneb
juneb / Get-ParameterType.ps1
Created June 16, 2016 15:45
Gets command parameters that have the specified parameter type
<#
.SYNOPSIS
Gets parameters with the specified parameter type
.DESCRIPTION
The Get-ParameterType.ps1 gets parameters with the specified parameter type. It returns the command name, parameter name, and parameter type in a PSCustomObject.
This script fixes the deficiency in 'Get-Command -ParameterType', which returns CommandInfo objects, but doesn't list the names of parameters that have the specified parameter type.
However, because it uses 'Get-Command -ParameterType,' it shares is primary limitation: it gets only parameters in the current session, not in all installed modules.
@juneb
juneb / InvokePesterPathHashtable.Tests.ps1
Last active June 16, 2016 15:46
Tests the Path hashtable feature of Pester 3.4.0. This script was used as a bug repro.
<#
.SYNOPSIS
Tests the Path hashtable feature of Pester 3.4.0.
.DESCRIPTION
Demonstrates that Invoke-Pester with a Path hashtable:
Invoke-Pester -Script @{Path=<path>}
does not get default values set for script parameters.
In this case, with a $ModuleName parameter, the error is generated for line:
@juneb
juneb / New-CustomMenu.ps1
Last active August 21, 2024 01:48
Creates and opens a custom menu INF for PrimalScript and PowerShell Studio.
<#
.SYNOPSIS
Creates and opens a custom menu INF for PrimalScript and PowerShell Studio.
.DESCRIPTION
This script creates a CustomMenu.inf file, the file that PrimalScript and
PowerShell Studio use as the source for custom tools.
When you use the Program parameter, the script creates a CustomMenu.inf in
the default location, $env:SystemDrive\SAPIEN\<Program>\<latest>.
@juneb
juneb / Start-SAPIENForum.ps1
Last active December 19, 2016 20:58
Opens the SAPIEN forum that you specify in your default internet browser window.
<#
.SYNOPSIS
Gets or opens a SAPIEN forum page.
.DESCRIPTION
The Start-SAPIENForum.ps1 script opens the SAPIEN forum that you specify in
your default internet browser window. It can also search the forums (all of
them) for the search term that you specify.
To open a particular forum, use the Name parameter. If the value of the Name