|
|
|
@ -27,6 +27,18 @@ $result = @{changed = $false
|
|
|
|
|
nuget_changed = $false
|
|
|
|
|
repository_changed = $false}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Enable TLS1.1/TLS1.2 if they're available but disabled (eg. .NET 4.5)
|
|
|
|
|
$security_protocols = [System.Net.ServicePointManager]::SecurityProtocol -bor [System.Net.SecurityProtocolType]::SystemDefault
|
|
|
|
|
if ([System.Net.SecurityProtocolType].GetMember("Tls11").Count -gt 0) {
|
|
|
|
|
$security_protocols = $security_protocols -bor [System.Net.SecurityProtocolType]::Tls11
|
|
|
|
|
}
|
|
|
|
|
if ([System.Net.SecurityProtocolType].GetMember("Tls12").Count -gt 0) {
|
|
|
|
|
$security_protocols = $security_protocols -bor [System.Net.SecurityProtocolType]::Tls12
|
|
|
|
|
}
|
|
|
|
|
[System.Net.ServicePointManager]::SecurityProtocol = $security_protocols
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Function Install-NugetProvider {
|
|
|
|
|
Param(
|
|
|
|
|
[Bool]$CheckMode
|
|
|
|
@ -162,7 +174,7 @@ Function Add-DefinedParameter {
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ForEach ($ParameterName in $ParametersNames) {
|
|
|
|
|
$ParameterVariable = Get-Variable -Name $ParameterName -ErrorAction Ignore
|
|
|
|
|
$ParameterVariable = Get-Variable -Name $ParameterName -ErrorAction SilentlyContinue
|
|
|
|
|
if ( $ParameterVariable.Value -and $Hashtable.Keys -notcontains $ParameterName ){
|
|
|
|
|
$Hashtable.Add($ParameterName,$ParameterVariable.Value)
|
|
|
|
|
}
|
|
|
|
@ -381,7 +393,7 @@ if ( ($state -eq "latest") -and
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( $repo -and (-not $url) ) {
|
|
|
|
|
$RepositoryExists = Get-PSRepository -Name $repo -ErrorAction Ignore
|
|
|
|
|
$RepositoryExists = Get-PSRepository -Name $repo -ErrorAction SilentlyContinue
|
|
|
|
|
if ( $null -eq $RepositoryExists) {
|
|
|
|
|
$ErrorMessage = "The repository $repo doesn't exist."
|
|
|
|
|
Fail-Json $result $ErrorMessage
|
|
|
|
|