2021-03-31 10:06:41 -04:00
|
|
|
|
function Set-NetboxHostScheme {
|
|
|
|
|
|
[CmdletBinding(ConfirmImpact = 'Low',
|
|
|
|
|
|
SupportsShouldProcess = $true)]
|
|
|
|
|
|
[OutputType([string])]
|
|
|
|
|
|
param
|
|
|
|
|
|
(
|
|
|
|
|
|
[Parameter(Mandatory = $false)]
|
|
|
|
|
|
[ValidateSet('https', 'http', IgnoreCase = $true)]
|
|
|
|
|
|
[string]$Scheme = 'https'
|
|
|
|
|
|
)
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-31 10:06:41 -04:00
|
|
|
|
if ($PSCmdlet.ShouldProcess('Netbox Host Scheme', 'Set')) {
|
|
|
|
|
|
if ($Scheme -eq 'http') {
|
|
|
|
|
|
Write-Warning "Connecting via non-secure HTTP is not-recommended"
|
|
|
|
|
|
}
|
2021-07-23 22:06:42 +02:00
|
|
|
|
|
2021-03-31 10:06:41 -04:00
|
|
|
|
$script:NetboxConfig.HostScheme = $Scheme
|
|
|
|
|
|
$script:NetboxConfig.HostScheme
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|