File tree 1 file changed +16
-2
lines changed
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
function Add-ITGlueAPIKey {
2
+ [cmdletbinding ()]
3
+ Param (
4
+ [Parameter (Mandatory = $false )]
5
+ [AllowEmptyString ()]
6
+ [Alias (' ApiKey' )]
7
+ [string ]$Api_Key
8
+ )
9
+ if ($Api_Key ) {
10
+ $x_api_key = ConvertTo-SecureString $Api_Key - AsPlainText - Force
11
+
12
+ Set-Variable - Name " ITGlue_API_Key" - Value $x_api_key - Option ReadOnly - Scope global - Force
13
+ }
14
+ if (! $Api_Key ) {
2
15
Write-Host " Please enter your API key:"
3
16
$x_api_key = Read-Host - AsSecureString
4
17
5
18
Set-Variable - Name " ITGlue_API_Key" - Value $x_api_key - Option ReadOnly - Scope global - Force
19
+ }
6
20
}
7
21
8
-
9
22
function Remove-ITGlueAPIKey {
10
23
Remove-Variable - Name " ITGlue_API_Key" - Force
11
24
}
12
25
13
26
function Get-ITGlueAPIKey {
14
27
$ITGlue_API_Key
28
+
15
29
Write-Host " Use Get-ITGlueAPIKey -Force to retrieve the unencrypted copy." - ForegroundColor " Red"
16
30
}
17
31
18
- New-Alias - Name Set-ITGlueAPIKey - Value Add-ITGlueAPIKey
32
+ New-Alias - Name Set-ITGlueAPIKey - Value Add-ITGlueAPIKey
You can’t perform that action at this time.
0 commit comments