Public/New-GitHubCachePath.ps1
|
function New-GitHubCachePath { [CmdletBinding()] [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] [OutputType([string])] param( [Parameter(Mandatory, Position = 0)] [ValidateNotNullOrEmpty()] [string[]] $Path ) $normalizedPaths = foreach ($currentPath in $Path) { if (-not [string]::IsNullOrWhiteSpace($currentPath)) { $currentPath.Trim() } } if (@($normalizedPaths).Count -eq 0) { throw 'At least one cache path must be provided.' } return @($normalizedPaths) -join [System.Environment]::NewLine } |