Add secret provider functionality and enhance configuration data resolution
This commit is contained in:
19
Private/ConvertTo-ConfigurationDataCredential.ps1
Normal file
19
Private/ConvertTo-ConfigurationDataCredential.ps1
Normal file
@@ -0,0 +1,19 @@
|
||||
function ConvertTo-ConfigurationDataCredential {
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]
|
||||
$UserName,
|
||||
|
||||
[Parameter(Mandatory=$true)]
|
||||
$Password
|
||||
)
|
||||
|
||||
if($Password -is [System.Security.SecureString]){
|
||||
$SecurePassword = $Password
|
||||
}else{
|
||||
$SecurePassword = ConvertTo-SecureString -String ([string]$Password) -AsPlainText -Force
|
||||
}
|
||||
|
||||
return [System.Management.Automation.PSCredential]::new($UserName, $SecurePassword)
|
||||
}
|
||||
Reference in New Issue
Block a user