< Back

Protect-Message

Sat Jan 11, 2020 1:42 pm

NAME Protect-Message



SYNOPSIS

Encrypts a message with a given password and stores it in a file along with a certificate and information on who

encrypted the message where





SYNTAX

Protect-Message [[-Message] <Object>] [[-Password] <SecureString>] [[-File] <FileInfo>] [<CommonParameters>]





DESCRIPTION

Encrypts a message with a given password and stores it in a file along with a certificate and information on who

encrypted the message where





PARAMETERS

-File <FileInfo>

Filepath to the file you want to create



Required? false

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Message <Object>

The message you want to encrypt



Required? false

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Password <SecureString>

The password you want to encrypt the message with



Required? false

Position? 1

Default value None

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

None







OUTPUTS

System.Object







NOTES









-------------------------- Example 1 --------------------------



PS C:\\> $secure = Read-Host -AsSecureString

PS C:\\> Protect-Message -Message "This message is secret" -File c:\\temp\\Encrypted.txt -Password $secure



Creates the file c:\\temp\\Encrypted.txt



RELATED LINKS