Private/Register-OriAzBopInternalPackageSource.ps1
<#
.DESCRIPTION Since is not possible to Mock Get-Package due dynamic block should be the function sparated for unit test resons Note: See more on https://github.com/pester/Pester/issues/604 .SYNOPSIS Since is not possible to Mock Get-Package due dynamic block should be the function sparated for unit test resons Note: See more on https://github.com/pester/Pester/issues/604 .PARAMETER RegisterPackageSourceParam Parameters for one Register-PackageSource .EXAMPLE Use exactly the same like for Register-PSRepository #> function Register-OriAzBopInternalPackageSource { [CmdletBinding()] param ( [parameter(Mandatory=$true, HelpMessage='Parameters for Register-PackageSource')] [Hashtable] $RegisterPackageSourceParam ) #in case of any error we want to stop execution, in stderr having the error. Use try-catch to handle errors if needed. $ErrorActionPreference = "Stop"; Write-Verbose "-- Register-OriAzBopInternalPackageSource --" Write-Verbose "RegisterPackageSourceParam: $(ConvertTo-Json $RegisterPackageSourceParam) " Write-Verbose "-- End of Register-OriAzBopInternalPackageSource --" return(Register-PackageSource @RegisterPackageSourceParam) } |