Viscalyx.Common
0.6.0-preview0004
Common commands that adds or improves functionality in various scenarios.
Minimum PowerShell version
5.1
Installation Options
Owners
Copyright
Copyright the Viscalyx.Common contributors. All rights reserved.
Package Details
Author(s)
- Viscalyx
Tags
Common Utility Pester PSReadLine Sampler
Functions
Assert-IPv4Address Clear-AnsiSequence ConvertTo-AnsiSequence ConvertTo-AnsiString ConvertTo-DifferenceString ConvertTo-RelativePath Get-ClassAst Get-ClassResourceAst Get-LinkLayerAddress Get-ModuleByVersion Get-ModuleFileSha Get-ModuleVersion Get-NumericalSequence Get-PSReadLineHistory Get-TextOffset Install-ModulePatch Invoke-PesterJob New-SamplerGitHubReleaseTag Out-Difference Pop-VMLatestSnapshot Remove-History Remove-PSHistory Remove-PSReadLineHistory Resolve-DnsName Send-WakeOnLan Split-StringAtIndex Test-FileHash Test-IPv4Address
Dependencies
This module has no dependencies.
Release Notes
## [0.6.0-preview0004] - 2025-09-17
### Added
- `Assert-IPv4Address` that validates if a string is a valid IPv4 address,
including format checking and value range validation (0-255 for each octet).
Also validates that octets do not have leading zeros.
- `Clear-AnsiSequence` that clears all ANSI escape sequences from a string,
returning only the visible text content. Useful for calculating the actual
visible length of strings that contain ANSI formatting codes or extracting
plain text from formatted console output.
- `ConvertTo-AnsiString` that converts strings containing ANSI
sequences to properly escaped and terminated ANSI sequences. It adds the
necessary escape character and ensures all sequences end with 'm'. Handles
both escaped and unescaped sequences, as well as sequences that may be
missing the 'm' terminator.
- `Get-ClassAst` that parses PowerShell script files and extracts class
definitions using Abstract Syntax Tree (AST) parsing. Can return all classes
in a file or filter for a specific class by name.
- `Get-ClassResourceAst` that parses PowerShell script files and extracts DSC
class resource definitions using Abstract Syntax Tree (AST) parsing. Filters
for classes that have the [DscResource()] attribute. Can return all DSC class
resources in a file or filter for a specific class by name.
### Fixed
- `Out-Difference` now correctly aligns labels with column
structure when using custom labels ([issue #7](https://github.com/viscalyx/Viscalyx.Common/issues/7))
- `Test-IPv4Address` that tests if a string is a valid IPv4 address and returns
a boolean result. Performs the same validation as `Assert-IPv4Address` but
returns `$true` for valid addresses and `$false` for invalid ones instead
of throwing exceptions. Now supports pipeline input for processing multiple
IP addresses.
### Changed
- `New-SamplerGitHubReleaseTag` - The git push operation is now properly wrapped
in a ShouldProcess check, allowing WhatIf to report what would be pushed
without actually executing the push command.
- `Get-LinkLayerAddress` (alias `Get-MacAddress`) that retrieves the MAC
address for an IP address on the local subnet/VLAN. Works cross-platform
across Windows, Linux, and macOS.
- `Resolve-DnsName` that resolves a DNS host name to a single IPv4 address
using the cross-platform .NET System.Net.Dns class, providing compatibility
when the built-in Resolve-DnsName cmdlet is not available.
- `Send-WakeOnLan` (alias `Send-WOL`) that sends a Wake-on-LAN magic packet
to wake up a remote computer. Supports various MAC address formats and
custom broadcast addresses and ports.
- Aligned ShouldProcess localized string key naming with DSC community convention
by renaming `*_ShouldProcessVerboseDescription` and `*_ShouldProcessVerboseWarning`
keys to `*_ShouldProcessDescription` and `*_ShouldProcessConfirmation` respectively.
This affects string keys in `New-SamplerGitHubReleaseTag`, `Install-ModulePatch`,
and `Send-WakeOnLan` commands.
- `Remove-PSHistory` and `Remove-PSReadLineHistory` now use localized strings
for all user-facing messages following DSC community guidelines.
- Removed unused localized strings for `Get-ClassResourceAst` command that were
inherited from `Get-ClassAst` but not actually used in the implementation.
- Added proper string IDs to all localized strings following the pattern
`(XXXNNNNN)` where XXX is a 3-4 letter abbreviation and NNNNN is a 4-digit
number. This provides consistent identification and tracking of all
localized messages across the module.
FileList
- Viscalyx.Common.nuspec
- Viscalyx.Common.psd1
- Modules\DscResource.Common\0.24.0\DscResource.Common.psm1
- Modules\DscResource.Common\0.24.0\DscResource.Common.psd1
- Viscalyx.Common.psm1
- Modules\DscResource.Common\0.24.0\en-US\about_DscResource.Common.help.txt
- en-US\Viscalyx.Common.strings.psd1
- Modules\DscResource.Common\0.24.0\en-US\DscResource.Common.strings.psd1
- en-US\Viscalyx.Common-help.xml
- Modules\DscResource.Common\0.24.0\en-US\DscResource.Common-help.xml
- en-US\about_Viscalyx.Common.help.txt
Version History
Version | Downloads | Last updated |
---|---|---|
0.6.0-previe... (current version) | 3 | 9/17/2025 |
0.6.0-previe... | 3 | 9/16/2025 |
0.6.0-previe... | 3 | 9/16/2025 |
0.6.0-previe... | 3 | 9/15/2025 |
0.5.0 | 46 | 9/14/2025 |
0.5.0-previe... | 4 | 9/14/2025 |
0.4.2-previe... | 4 | 9/13/2025 |
0.4.2-previe... | 11 | 2/28/2025 |
0.4.1 | 476 | 2/27/2025 |
0.4.1-previe... | 4 | 2/27/2025 |
0.4.1-previe... | 4 | 2/27/2025 |
0.4.1-previe... | 4 | 2/26/2025 |
0.4.0 | 55 | 2/26/2025 |
0.4.0-previe... | 4 | 2/26/2025 |
0.3.1-previe... | 6 | 2/4/2025 |
0.3.1-previe... | 4 | 2/4/2025 |
0.3.1-previe... | 4 | 2/3/2025 |
0.3.0 | 1,537 | 9/2/2024 |
0.3.0-previe... | 3 | 9/2/2024 |
0.2.0 | 12 | 8/25/2024 |
0.2.0-previe... | 3 | 8/25/2024 |
0.2.0-previe... | 42 | 8/13/2024 |
0.1.0-previe... | 4 | 8/4/2024 |