GenXdev.Helpers
A Windows PowerShell module with helpers mostly used by other GenXdev modules
Copyright (c) 2025 René Vaessen / GenXdev
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Install-Module "GenXdev.Helpers"
Import-Module "GenXdev.Helpers"
Update-Module
Command | Aliases | Description |
---|---|---|
alignScript | Returns a string (with altered indentation) of a provided scriptblock string | |
ConvertTo-HashTable | Converts a PSCustomObject to a HashTable recursively. | |
ConvertTo-JsonEx | tojsonex | Converts an object to a JSON string with extended options. |
EnsureGenXdev | ||
EnsureNuGetAssembly | Downloads and loads .NET assemblies from NuGet packages based on package key or ID. | |
Get-DefaultWebLanguage | Gets the default web language key based on the system's current language settings. | |
Get-GenXDevCmdlet | gcmds | Retrieves and lists all GenXdev cmdlets and their details. |
Get-ImageGeolocation | Extracts geolocation data from an image file. | |
Get-ImageMetadata | Extracts comprehensive metadata from an image file. | |
Get-WebLanguageDictionary | Returns a reversed dictionary for all languages supported by Google Search | |
Import-GenXdevModules | reloadgenxdev | Imports all GenXdev PowerShell modules into the global scope. |
Initialize-SearchPaths | Initializes and configures system search paths for package management. | |
Invoke-OnEachGenXdevModule | foreach-genxdev-module-do | Executes a script block on each GenXdev module in the workspace. |
Out-Serial | Sends a string to a serial port | |
Remove-JSONComments | Removes comments from JSON content. | |
resetdefaultmonitor | Restores default secondary monitor configuration. | |
SecondScreen | Sets default second-monitor configuration. | |
Show-GenXDevCmdlet | cmds | Displays GenXdev PowerShell modules with their cmdlets and aliases. |
Show-Verb | showverbs | Shows a short alphabetical list of all PowerShell verbs. |
SideBySide | Sets default side-by-side configuration. | |
Test-UnattendedMode | Detects if PowerShell is running in unattended/automated mode |
Command | Aliases | Description |
---|---|---|
Get-FreeFallHeight | Calculates the height fallen during free fall for a given time duration. | |
Get-FreeFallTime | Calculates the time it takes for an object to fall a specified distance. |
alignScript
Returns a string (with altered indentation) of a provided scriptblock string
alignScript [[-script] <String>] [[-spaces] <Int32>] [<CommonParameters>]
Changes the indentation of a scriptblock string while respecting the original code-block identations
-script <String>
The scriptblock string
Required? false
Position? 1
Default value
Accept pipeline input? false
Aliases
Accept wildcard characters? false
-spaces <Int32>
The minimum number of spaces for each line
Required? false
Position? 2
Default value 0
Accept pipeline input? false
Aliases
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
ConvertTo-HashTable
ConvertTo-HashTable [-InputObject] <Object[]>
[<CommonParameters>]
-InputObject <Object[]>
The PSCustomObject to convert into a HashTable
Required? true
Position? 0
Accept pipeline input? true (ByValue)
Parameter set name Default
Aliases None
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
ConvertTo-JsonEx --> tojsonex
ConvertTo-JsonEx [-Object] <Object> [-Compress]
[<CommonParameters>]
-Compress
Compress the JSON output by removing whitespace
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-Object <Object>
The object to convert to JSON
Required? true
Position? 0
Accept pipeline input? true (ByValue)
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
EnsureGenXdev
EnsureGenXdev [-Force] [-DownloadLMStudioModels] [-DownloadAllNugetPackages] [-ForceConsent] [-ConsentToThirdPartySoftwareInstallation] [<CommonParameters>]
-ConsentToThirdPartySoftwareInstallation
Automatically consent to third-party software installation and set persistent flag for all packages.
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-DownloadAllNugetPackages
Downloads and loads all NuGet packages defined in the packages.json manifest file
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-DownloadLMStudioModels
Downloads and initializes LMStudio models for various AI query types
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-Force
Forces the execution of ensure operations even if they appear to be already completed
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-ForceConsent
Force a consent prompt even if preference is set for third-party software installation.
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
EnsureNuGetAssembly
EnsureNuGetAssembly [-PackageKey] <string> [-ManifestPath <string>] [-Version <string>] [-TypeName <string>] [-ForceLatest] [-Destination <string>] [-Description <string>] [-Publisher <string>] [-ForceConsent] [-ConsentToThirdPartySoftwareInstallation] [<CommonParameters>]
-ConsentToThirdPartySoftwareInstallation
Automatically consent to third-party software installation and set persistent flag.
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-Description <string>
Optional description of the software and its purpose for consent.
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-Destination <string>
Custom install destination; defaults to local persistent or global cache.
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-ForceConsent
Force a prompt even if preference is set for consent.
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-ForceLatest
Fallback to latest if exact version fails.
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-ManifestPath <string>
Path to packages.json; defaults to module root if omitted.
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-PackageKey <string>
Package key from packages.json or direct NuGet PackageId.
Required? true
Position? 0
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-Publisher <string>
Optional publisher or vendor of the software for consent.
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-TypeName <string>
TypeName to verify loading.
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-Version <string>
Specific version; if omitted, use highest from JSON or latest.
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Get-DefaultWebLanguage
Get-DefaultWebLanguage [<CommonParameters>]
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Get-GenXDevCmdlet --> gcmds
Get-GenXDevCmdlet [[-CmdletName] <string>]
[[-DefinitionMatches] <string>] [[-ModuleName]
<string[]>] [-NoLocal] [-OnlyPublished] [-FromScripts]
[-IncludeScripts] [-OnlyReturnModuleNames] [-ExactMatch]
[<CommonParameters>]
-CmdletName <string>
Search pattern to filter cmdlets
Required? false
Position? 0
Accept pipeline input? true (ByPropertyName)
Parameter set name (All)
Aliases Filter, CmdLet, Cmd, FunctionName, Name
Dynamic? false
Accept wildcard characters? true
-DefinitionMatches <string>
Regular expression to match cmdlet definitions
Required? false
Position? 1
Accept pipeline input? true (ByValue, ByPropertyName)
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-ExactMatch
Perform exact matching instead of wildcard matching
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-FromScripts
Search in script files instead of modules
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-IncludeScripts
Includes the scripts directory in addition to regular modules
Required? false
Position? Named
Accept pipeline input? false
Parameter set name ModuleName
Aliases None
Dynamic? false
Accept wildcard characters? false
-ModuleName <string[]>
GenXdev module names to search
Required? false
Position? 2
Accept pipeline input? true (ByValue, ByPropertyName)
Parameter set name (All)
Aliases Module, BaseModuleName, SubModuleName
Dynamic? false
Accept wildcard characters? true
-NoLocal
Skip searching in local module paths
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-OnlyPublished
Only search in published module paths
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-OnlyReturnModuleNames
Only return unique module names
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Get-ImageGeolocation
Get-ImageGeolocation [-ImagePath] <string>
[<CommonParameters>]
-ImagePath <string>
Path to the image file to analyze
Required? true
Position? 0
Accept pipeline input? true (ByValue, ByPropertyName)
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Get-ImageMetadata
Get-ImageMetadata [-ImagePath] <string> [-ForceConsent]
[-ConsentToThirdPartySoftwareInstallation]
[<CommonParameters>]
-ConsentToThirdPartySoftwareInstallation
Automatically consent to third-party software installation and set persistent flag for ImageSharp packages.
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-ForceConsent
Force a consent prompt even if preference is set for ImageSharp package installation.
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-ImagePath <string>
Path to the image file to analyze
Required? true
Position? 0
Accept pipeline input? true (ByValue, ByPropertyName)
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Get-WebLanguageDictionary
Returns a reversed dictionary for all languages supported by Google Search
Get-WebLanguageDictionary [<CommonParameters>]
Returns a reversed dictionary for all languages supported by Google Search
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Import-GenXdevModules --> reloadgenxdev
Import-GenXdevModules [-DebugFailedModuleDefinitions]
[<CommonParameters>]
-DebugFailedModuleDefinitions
Enable debug output for failed module definitions
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Initialize-SearchPaths
Initialize-SearchPaths [[-WorkspaceFolder] <string>]
[<CommonParameters>]
-WorkspaceFolder <string>
Required? false
Position? 0
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Invoke-OnEachGenXdevModule --> foreach-genxdev-module-do
Invoke-OnEachGenXdevModule [-Script] <scriptblock>
[[-ModuleName] <string[]>] [-NoLocal] [-OnlyPublished]
[-FromScripts] [-IncludeScripts]
[-IncludeGenXdevMainModule] [<CommonParameters>]
-FromScripts
Process scripts directory instead of module directories
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-IncludeGenXdevMainModule
Includes the main GenXdev module in addition to sub-modules
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-IncludeScripts
Includes the scripts directory in addition to regular modules
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-ModuleName <string[]>
Filter to apply to module names
Required? false
Position? 1
Accept pipeline input? false
Parameter set name (All)
Aliases Module, BaseModuleName, SubModuleName
Dynamic? false
Accept wildcard characters? true
-NoLocal
Excludes local development modules from processing
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-OnlyPublished
Includes only published modules that have LICENSE and README.md files
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-Script <scriptblock>
The script block to execute for each GenXdev module
Required? true
Position? 0
Accept pipeline input? false
Parameter set name (All)
Aliases ScriptBlock
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Out-Serial
Sends a string to a serial port
Out-Serial [[-Portname] <String>] [[-BaudRate] <Int32>]
[[-MaxBytesToRead] <UInt32>] [[-ReadTimeout] <UInt32>]
[[-WriteTimeout] <UInt32>] [[-Parity] <String>]
[[-DataBits] <Int32>] [[-StopBits] <String>] [-Text]
<Object> [-AddCRLinefeeds] [<CommonParameters>]
Allows you to send a string to a serial communication port
-Portname <String>
The port to use (for example, COM1).
Required? false
Position? 1
Default value COM5
Accept pipeline input? false
Aliases
Accept wildcard characters? false
-BaudRate <Int32>
The baud rate.
Required? false
Position? 2
Default value 9600
Accept pipeline input? false
Aliases
Accept wildcard characters? false
-MaxBytesToRead <UInt32>
Limits the nr of bytes to read.
Required? false
Position? 3
Default value 0
Accept pipeline input? false
Aliases
Accept wildcard characters? false
-ReadTimeout <UInt32>
Enables reading with a specified timeout in milliseconds.
Required? false
Position? 4
Default value 0
Accept pipeline input? false
Aliases
Accept wildcard characters? false
-WriteTimeout <UInt32>
Enables writing with a specified timeout in milliseconds.
Required? false
Position? 5
Default value 0
Accept pipeline input? false
Aliases
Accept wildcard characters? false
-Parity <String>
One of the System.IO.Ports.SerialPort.Parity values.
Required? false
Position? 6
Default value None
Accept pipeline input? false
Aliases
Accept wildcard characters? false
-DataBits <Int32>
The data bits value.
Required? false
Position? 7
Default value 8
Accept pipeline input? false
Aliases
Accept wildcard characters? false
-StopBits <String>
One of the System.IO.Ports.SerialPort.StopBits values.
Required? false
Position? 8
Default value One
Accept pipeline input? false
Aliases
Accept wildcard characters? false
-Text <Object>
Text to sent to serial port.
Required? true
Position? 9
Default value
Accept pipeline input? true (ByValue)
Aliases
Accept wildcard characters? false
-AddCRLinefeeds [<SwitchParameter>]
Add linefeeds to input text parts.
Required? false
Position? named
Default value False
Accept pipeline input? false
Aliases
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Remove-JSONComments
Remove-JSONComments [-Json] <string[]> [<CommonParameters>]
-Json <string[]>
JSON content to process as string array
Required? true
Position? 0
Accept pipeline input? true (ByValue)
Parameter set name Default
Aliases None
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
resetdefaultmonitor
resetdefaultmonitor [<CommonParameters>]
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
secondscreen
secondscreen [<CommonParameters>]
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Show-GenXdevCmdlet --> cmds
Show-GenXdevCmdlet [[-CmdletName] <string>]
[[-DefinitionMatches] <string>] [[-ModuleName]
<string[]>] [-NoLocal] [-OnlyPublished] [-FromScripts]
[-IncludeScripts] [-OnlyReturnModuleNames] [-ExactMatch]
[-Online] [-OnlyAliases] [-ShowTable] [-PassThru]
[<CommonParameters>]
-CmdletName <string>
Search pattern to filter cmdlets
Required? false
Position? 0
Accept pipeline input? true (ByPropertyName)
Parameter set name (All)
Aliases Filter, CmdLet, Cmd, FunctionName, Name
Dynamic? false
Accept wildcard characters? true
-DefinitionMatches <string>
Regular expression to match cmdlet definitions
Required? false
Position? 1
Accept pipeline input? true (ByValue, ByPropertyName)
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-ExactMatch
Perform exact matching instead of wildcard matching
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-FromScripts
Search in script files instead of modules
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-IncludeScripts
Includes the scripts directory in addition to regular modules
Required? false
Position? Named
Accept pipeline input? false
Parameter set name ModuleName
Aliases None
Dynamic? false
Accept wildcard characters? false
-ModuleName <string[]>
GenXdev module names to search
Required? false
Position? 2
Accept pipeline input? true (ByValue, ByPropertyName)
Parameter set name (All)
Aliases Module, BaseModuleName, SubModuleName
Dynamic? false
Accept wildcard characters? true
-NoLocal
Skip searching in local module paths
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-Online
Open GitHub documentation instead of console output
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-OnlyAliases
When specified displays only aliases of cmdlets
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases aliases, nonboring, notlame, handyonces
Dynamic? false
Accept wildcard characters? false
-OnlyPublished
Only search in published module paths
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-OnlyReturnModuleNames
Only return unique module names
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-PassThru
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-ShowTable
Display results in table format
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases table, grid
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Show-Verb --> showverbs
Show-Verb [[-Verb] <string[]>] [<CommonParameters>]
-Verb <string[]>
One or more verb patterns to filter (supports wildcards)
Required? false
Position? 0
Accept pipeline input? true (ByValue, ByPropertyName)
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? true
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
sidebyside
sidebyside [<CommonParameters>]
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Test-UnattendedMode
Detects if PowerShell is running in unattended/automated mode
Test-UnattendedMode [[-CallersInvocation] <InvocationInfo>]
[-Detailed] [<CommonParameters>]
Analyzes various indicators to determine if PowerShell is running in an
unattended or automated context, including pipeline analysis, environment
variables, console redirection, and invocation context.
When CallersInvocation is provided, it analyzes the pipeline position and
count to determine if the function is being called as part of an automated
pipeline or script execution.
-CallersInvocation <InvocationInfo>
The caller's invocation information for pipeline and automation detection.
Pass $MyInvocation from the calling function to analyze pipeline context.
Required? false
Position? 1
Default value
Accept pipeline input? false
Aliases
Accept wildcard characters? false
-Detailed [<SwitchParameter>]
Required? false
Position? named
Default value False
Accept pipeline input? false
Aliases
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
The function combines multiple detection methods:
- Environment variables (CI/CD systems)
- Console redirection
- Interactive session detection
- PowerShell host type
- Pipeline analysis (when CallersInvocation provided)
- Console availability
-------------------------- EXAMPLE 1 --------------------------
PS C:\> Test-UnattendedMode
Returns a boolean indicating if running in unattended mode using standard detection.
-------------------------- EXAMPLE 2 --------------------------
PS C:\> Test-UnattendedMode -CallersInvocation $MyInvocation
Analyzes the caller's invocation context and returns a boolean result.
-------------------------- EXAMPLE 3 --------------------------
PS C:\> Test-UnattendedMode -CallersInvocation $MyInvocation -Detailed
Returns detailed analysis object with all indicators and pipeline information.
-------------------------- EXAMPLE 4 --------------------------
PS C:\> function My-Function {
$isUnattended = Test-UnattendedMode -CallersInvocation $MyInvocation
if ($isUnattended) {
Write-Verbose "Running in unattended mode, skipping interactive prompts"
}
}
Get-FreeFallHeight
Get-FreeFallHeight [-DurationInSeconds] <double>
[[-TerminalVelocityInMs] <double>] [<CommonParameters>]
-DurationInSeconds <double>
The time duration of the fall in seconds
Required? true
Position? 0
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-TerminalVelocityInMs <double>
The terminal velocity in meters per second (default: 53 m/s for human)
Required? false
Position? 1
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
Get-FreeFallTime
Get-FreeFallTime [-HeightInMeters] <double>
[[-TerminalVelocityInMs] <double>] [<CommonParameters>]
-HeightInMeters <double>
The initial height of the falling object in meters
Required? true
Position? 0
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-TerminalVelocityInMs <double>
The terminal velocity of the falling object in m/s
Required? false
Position? 1
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).