WisherTools.Helpers

0.2.0

The WisherTools.Helpers module is a collection of essential utility functions designed to assist with common tasks in PowerShell scripting. This module provides reusable components for managing directories, working with PowerShell functions dynamically, verifying system availability through network pings, and generating backup file paths. It streamlines various proces
The WisherTools.Helpers module is a collection of essential utility functions designed to assist with common tasks in PowerShell scripting. This module provides reusable components for managing directories, working with PowerShell functions dynamically, verifying system availability through network pings, and generating backup file paths. It streamlines various processes that are frequently used across different scripts and modules, offering a robust set of helper tools to enhance efficiency and maintainability.

**Function Overview**

1. **Get-DirectoryPath**
  Converts a base path to a local or UNC format based on whether the target is local or remote.

2. **Get-FunctionScriptBlock**
  Retrieves the script block of a specified PowerShell function.

3. **Get-BackupFilePath**
  Generates a unique backup file path with a timestamp.

4. **Test-DirectoryExistence**
  Ensures that a directory exists; creates it if necessary.

5. **Test-ComputerPing**
  Pings a computer to check if it is online with a configurable timeout.
Show more

Minimum PowerShell version

5.1

Installation Options

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

Install-Module -Name WisherTools.Helpers

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

Install-PSResource -Name WisherTools.Helpers

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

(c) 2024 LarryWisherMan. All rights reserved.

Package Details

Author(s)

  • LarryWisherMan

Tags

PowerShell Helper Utilities Directory Network

Functions

Get-DirectoryPath Get-FunctionScriptBlock New-UniqueFilePath Test-ComputerPing Test-DirectoryExistence

Dependencies

This module has no dependencies.

Release Notes

## [0.2.0] - 2024-09-10

### Added

- Added detailed comment-based help and Unit Tests to all public functions in the
`WisherTools.Helpers` module. This provides better guidance and documentation
for the following functions:
 - `Get-DirectoryPath`
 - `Get-FunctionScriptBlock`
 - `New-UniqueFilePath`
 - `Test-ComputerPing`
 - `Test-DirectoryExistence`
 
- Added module PSData and build config

- Added warning to `New-UniqueFilePath` when the specified directory does not
exist and automatically creates the directory.

- Environment variables (`FILE_DIRECTORY`, `FILE_PREFIX`, `FILE_EXTENSION`) are
now used as default parameters for `New-UniqueFilePath`.

- Created new function `New-UniqueFilePath`, a more generic version of
`Get-BackupFilePath`, to generate unique file paths with customizable
prefixes, directories, and extensions.

- Icon Url in psd1

### Changed

- Replaced hardcoded defaults in `Get-BackupFilePath` with dynamic environment
variables and made the function more generic.

- Updated `New-UniqueFilePath` to use environment variables for default values
and fallback defaults if not set.

FileList

Version History

Version Downloads Last updated
0.2.0 (current version) 548 9/10/2024
0.2.0-previe... 2 9/10/2024
0.2.0-previe... 2 9/10/2024
0.2.0-previe... 8 9/7/2024
0.1.0 44 9/7/2024
0.1.0-previe... 2 9/7/2024
Show more