From 3e03e1e3ad8cfa1d3232cc7bc6d69c7a0093e92c Mon Sep 17 00:00:00 2001 From: Ben Claussen Date: Fri, 10 Sep 2021 12:43:34 -0400 Subject: [PATCH] Add Clear-NetboxCredential - Grants ability to clear the stored credentials in `$Netboxconfig` variable --- Functions/Setup/Clear-NetboxCredential.ps1 | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Functions/Setup/Clear-NetboxCredential.ps1 diff --git a/Functions/Setup/Clear-NetboxCredential.ps1 b/Functions/Setup/Clear-NetboxCredential.ps1 new file mode 100644 index 0000000..62109ab --- /dev/null +++ b/Functions/Setup/Clear-NetboxCredential.ps1 @@ -0,0 +1,11 @@ +function Clear-NetboxCredential { + [CmdletBinding(ConfirmImpact = 'Medium', SupportsShouldProcess = $true)] + param + ( + [switch]$Force + ) + + if ($Force -or ($PSCmdlet.ShouldProcess('Netbox Credentials', 'Clear'))) { + $script:NetboxConfig.Credential = $null + } +} \ No newline at end of file