Commit e98fea25 authored by Olivier De Marchi's avatar Olivier De Marchi
Browse files

test keyfile.key exist

parent 83d59fcd
......@@ -2,11 +2,13 @@
$KeyFile = Read-Host -Prompt "Key File (please put .key extension)"
$Password = Read-Host -AsSecureString -Prompt "Password to secure"
$Key = New-Object Byte[] 32 # create key AES 256-bit key (32 bytes)
[Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($Key)
$Key | Out-File $KeyFile
if ($KeyFile) {
$Key = New-Object Byte[] 32 # create key AES 256-bit key (32 bytes)
[Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($Key)
$Key | Out-File $KeyFile
$EncryptedPass = ConvertFrom-SecureString -SecureString $Password -Key $Key
$EncryptedPass = ConvertFrom-SecureString -SecureString $Password -Key $Key
}
Write-Output ""
Write-Output "# Lines to add in your configuration file Custom-VarOverload.psm1"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment