diff --git a/Functions/Setup/Get-NetboxCredential.ps1 b/Functions/Setup/Get-NetboxCredential.ps1 index 25f0eb9..a1235fb 100644 --- a/Functions/Setup/Get-NetboxCredential.ps1 +++ b/Functions/Setup/Get-NetboxCredential.ps1 @@ -2,10 +2,10 @@ [CmdletBinding()] [OutputType([pscredential])] param () - + if (-not $script:NetboxConfig.Credential) { throw "Netbox Credentials not set! You may set with Set-NetboxCredential" } - + $script:NetboxConfig.Credential } \ No newline at end of file diff --git a/Functions/Setup/Get-NetboxHostname.ps1 b/Functions/Setup/Get-NetboxHostname.ps1 index 0629541..63a8c3f 100644 --- a/Functions/Setup/Get-NetboxHostname.ps1 +++ b/Functions/Setup/Get-NetboxHostname.ps1 @@ -1,11 +1,11 @@ function Get-NetboxHostname { [CmdletBinding()] param () - + Write-Verbose "Getting Netbox hostname" if ($null -eq $script:NetboxConfig.Hostname) { throw "Netbox Hostname is not set! You may set it with Set-NetboxHostname -Hostname 'hostname.domain.tld'" } - + $script:NetboxConfig.Hostname } \ No newline at end of file diff --git a/Functions/Setup/Set-NetboxCredential.ps1 b/Functions/Setup/Set-NetboxCredential.ps1 index 448f272..dcbb24a 100644 --- a/Functions/Setup/Set-NetboxCredential.ps1 +++ b/Functions/Setup/Set-NetboxCredential.ps1 @@ -1,32 +1,32 @@ function Set-NetboxCredential { [CmdletBinding(DefaultParameterSetName = 'CredsObject', - ConfirmImpact = 'Low', - SupportsShouldProcess = $true)] + ConfirmImpact = 'Low', + SupportsShouldProcess = $true)] [OutputType([pscredential])] param ( [Parameter(ParameterSetName = 'CredsObject', - Mandatory = $true)] + Mandatory = $true)] [pscredential]$Credential, - + [Parameter(ParameterSetName = 'UserPass', - Mandatory = $true)] + Mandatory = $true)] [securestring]$Token ) - + if ($PSCmdlet.ShouldProcess('Netbox Credentials', 'Set')) { switch ($PsCmdlet.ParameterSetName) { 'CredsObject' { $script:NetboxConfig.Credential = $Credential break } - + 'UserPass' { $script:NetboxConfig.Credential = [System.Management.Automation.PSCredential]::new('notapplicable', $Token) break } } - + $script:NetboxConfig.Credential } } \ No newline at end of file diff --git a/Functions/Setup/Set-NetboxHostName.ps1 b/Functions/Setup/Set-NetboxHostName.ps1 index 92b9dbe..a70c055 100644 --- a/Functions/Setup/Set-NetboxHostName.ps1 +++ b/Functions/Setup/Set-NetboxHostName.ps1 @@ -1,13 +1,13 @@ function Set-NetboxHostName { [CmdletBinding(ConfirmImpact = 'Low', - SupportsShouldProcess = $true)] + SupportsShouldProcess = $true)] [OutputType([string])] param ( [Parameter(Mandatory = $true)] [string]$Hostname ) - + if ($PSCmdlet.ShouldProcess('Netbox Hostname', 'Set')) { $script:NetboxConfig.Hostname = $Hostname.Trim() $script:NetboxConfig.Hostname