< Back

Set-KeyFile

Mon Jan 13, 2020 12:26 am

NAME Set-KeyFile



SYNOPSIS

Persists a given key to file





SYNTAX

Set-KeyFile [-Key] <String> [-KeyFile] <String> [<CommonParameters>]





DESCRIPTION

Compares the current key and overwrites if different based on file hash (MD5). Key is DER or PEM format obtained

from Get-Key.





PARAMETERS

-Key <String>



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-KeyFile <String>



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

$True if cert was written to file. $False if key was not written to file.





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Set-KeyFile -Key $derKey -KeyFile some.mysite.com.key.der



Stores the DER formatted key in specified file.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Set-KeyFile -Key $pemKey -KeyFile some.mysite.com.key.pem



Stores the PEM formatted key in specified file.











RELATED LINKS