< Back

Unprotect-Message

Sat Jan 11, 2020 1:43 pm

NAME Unprotect-Message



SYNOPSIS

Unprotects a message protected with Protect-Message and deliveres the message to the pipeline





SYNTAX

Unprotect-Message [[-MessageFile] <FileInfo>] [[-Password] <SecureString>] [-ThisMessageWillSelfDestruct]

[<CommonParameters>]





DESCRIPTION

Unprotects a message protected with Protect-Message and deliveres the message to the pipeline





PARAMETERS

-MessageFile <FileInfo>

Path to the file to unprotect



Required? false

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Password <SecureString>

The password the message is encrypted with



Required? false

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ThisMessageWillSelfDestruct [<SwitchParameter>]

Use this switch if you want to delete the file after reading it



Required? false

Position? named

Default value False

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:\\> Unprotect-Message -MessageFile c:\\temp\\Encrypted.txt -Password $secure -Verbose



Will display the message:



VERBOSE: Message was generated on AX-PC by AxelB????gAndersen at 5/2/2019 6:55:02 AM This message is secret



RELATED LINKS