Viscalyx.Common

0.7.0

Common commands that adds or improves functionality in various scenarios.

Minimum PowerShell version

5.1

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name Viscalyx.Common

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name Viscalyx.Common

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

Copyright the Viscalyx.Common contributors. All rights reserved.

Package Details

Author(s)

  • Viscalyx

Tags

Common Utility Pester PSReadLine Sampler

Functions

Assert-GitLocalChange Assert-GitRemote Assert-IPv4Address Clear-AnsiSequence ConvertTo-AnsiSequence ConvertTo-AnsiString ConvertTo-DifferenceString ConvertTo-RelativePath Disable-CursorShortcutCode Get-ClassAst Get-ClassResourceAst Get-GitBranchCommit Get-GitLocalBranchName Get-GitRemote Get-GitRemoteBranch Get-GitTag Get-LinkLayerAddress Get-ModuleByVersion Get-ModuleFileSha Get-ModuleVersion Get-NumericalSequence Get-PSReadLineHistory Get-TextOffset Install-ModulePatch Invoke-Git Invoke-PesterJob New-GitTag New-SamplerGitHubReleaseTag Out-Difference Pop-VMLatestSnapshot Push-GitTag Receive-GitBranch Remove-GitTag Remove-History Remove-PSHistory Remove-PSReadLineHistory Rename-GitLocalBranch Rename-GitRemote Request-GitTag Resolve-DnsName Resume-GitRebase Send-WakeOnLan Split-StringAtIndex Start-GitRebase Stop-GitRebase Switch-GitLocalBranch Test-FileHash Test-GitLocalChanges Test-GitRemote Test-GitRemoteBranch Test-IPv4Address Update-GitLocalBranch Update-RemoteTrackingBranch

Dependencies

This module has no dependencies.

Release Notes

## [0.7.0] - 2025-09-30

### Added

- Viscalyx.Common
 - Added unit tests to run in Windows PowerShell.
- Public commands:
 - `Assert-GitLocalChange`
 - `Assert-GitRemote`
 - `Disable-CursorShortcutCode`
 - `Get-GitBranchCommit`
 - `Get-GitLocalBranchName`
 - `Get-GitRemote`
 - `Get-GitRemoteBranch`
 - `Get-GitTag`
 - `Invoke-Git`
 - `New-GitTag`
 - `Push-GitTag`
 - `Receive-GitBranch` ([#5](https://github.com/viscalyx/Viscalyx.Common/issues/5))
 - `Remove-GitTag` ([#16](https://github.com/viscalyx/Viscalyx.Common/issues/16))
 - `Rename-GitLocalBranch` ([#10](https://github.com/viscalyx/Viscalyx.Common/issues/10))
 - `Rename-GitRemote` ([#11](https://github.com/viscalyx/Viscalyx.Common/issues/11))
 - `Request-GitTag`
 - `Resume-GitRebase` ([#14](https://github.com/viscalyx/Viscalyx.Common/issues/14))
 - `Start-GitRebase` ([#13](https://github.com/viscalyx/Viscalyx.Common/issues/13))
 - `Stop-GitRebase` ([#15](https://github.com/viscalyx/Viscalyx.Common/issues/15))
 - `Switch-GitLocalBranch`
 - `Test-GitLocalChanges`
 - `Test-GitRemote`
 - `Test-GitRemoteBranch`
 - `Update-GitLocalBranch`
 - `Update-RemoteTrackingBranch`
- Documentation:
 - `Testing-PowerShell-Modules.md` - Comprehensive beginner's guide for
   testing PowerShell modules with `Invoke-PesterJob`, covering session
   isolation, code coverage, source line mapping, and best practices for
   different resource types including MOF-based and class-based DSC resources.

### Changed

- `Invoke-PesterJob` - Updated documentation example to use `-TestNameFilter`
 parameter instead of the `-TestName` alias and removed reference to alias
 usage for consistency and clarity.
- `New-SamplerGitHubReleaseTag` - Major architectural rewrite with the following
 key improvements:
- `Receive-GitBranch` - Enhanced to allow pulling from a remote branch without
 requiring the `-Checkout` switch. The `BranchName` parameter is now available
 in both parameter sets, enabling scenarios like
 `Receive-GitBranch -RemoteName 'upstream' -BranchName 'feature-branch'` to
 pull from a remote branch directly into the current branch
 ([#50](https://github.com/viscalyx/Viscalyx.Common/issues/50)).
 - Complete implementation refactor replacing ~200 lines of raw Git commands
   with dedicated PowerShell helper functions for improved reliability.
 - Enhanced error handling using proper try-catch blocks instead of manual
   `$LASTEXITCODE` checking, with automatic cleanup on failures.
 - Improved WhatIf support with intelligent handling that skips complex logic
   during WhatIf operations.
 - Renamed `SwitchBackToPreviousBranch` parameter to `ReturnToCurrentBranch`
   for better clarity.
 - Updated documentation sections.
- `ConvertTo-RelativePath` - Simplified function logic to consistently normalize
 directory separators using `[System.IO.Path]::DirectorySeparatorChar` and
 removed complex cross-platform path handling.
- `Receive-GitBranch` - Refactored to use multiple ShouldProcess blocks instead
 of a single combined block ([#50](https://github.com/viscalyx/Viscalyx.Common/issues/50)).
 - Each operation (checkout, fetch, rebase, pull) now has its own ShouldProcess
   block for better WhatIf support and granular confirmation prompts.
 - Removed Write-Verbose calls from inside ShouldProcess blocks to comply with
   coding guidelines.
 - Write-Verbose messages are now placed outside ShouldProcess blocks to provide
   detailed progress feedback during execution.

### Fixed

- `Push-GitTag` now properly handles the no-op case when trying to push all
 tags but no local tags exist, treating it as a successful operation instead
 of throwing an error.

FileList

Version History

Version Downloads Last updated
0.7.0 (current version) 3 9/30/2025
0.7.0-previe... 3 9/30/2025
0.7.0-previe... 3 9/30/2025
0.7.0-previe... 3 9/30/2025
0.6.1-previe... 3 9/26/2025
0.6.0 34 9/25/2025
0.6.0-previe... 3 9/25/2025
0.6.0-previe... 4 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 861 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
Show more