Invoke-ServiceFabricDecryptText
解密由 Invoke-ServiceFabricEncryptText Cmdlet 加密的文字。
語法
Invoke-ServiceFabricDecryptText
[-CipherText] <String>
[-StoreLocation <StoreLocation>]
[-TimeoutSec <Int32>]
[<CommonParameters>]
Description
Invoke-ServiceFabricDecryptText Cmdlet 會使用 Service Fabric 中的 Invoke-ServiceFabricEncryptText Cmdlet 來解密已加密的文字。
在 Service Fabric 叢集上執行任何作業之前,請使用 Connect-ServiceFabricCluster Cmdlet 來建立叢集的連線。
注意
為瞭解密文字,此 Cmdlet 的呼叫端應該能夠存取用來加密文字之憑證的私鑰。
範例
範例 1:解密文字
PS C:\windows\system32> $EncryptedText = Invoke-ServiceFabricEncryptText -Text "hello world" -CertThumbprint $Thumbprint
-CertStore -StoreLocation LocalMachine -StoreName My
PS C:\windows\system32> Invoke-ServiceFabricDecryptText -CipherText $EncryptedText -StoreLocation "LocalMachine"
hello world
第一個命令會使用 Invoke-ServiceFabricEncryptText Cmdlet 來加密文字,並將結果儲存在名為 $EncryptedText 的變數中。
第二個命令會將儲存在 $EncryptedText 變數中的文字解密,並將它儲存至名為 LocalMachine 的存放區位置。
參數
-CipherText
指定 Cmdlet 的加密文字。
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-StoreLocation
指定證書儲存的位置。 有效值為:
- CurrentUser
- LocalMachine
類型: | StoreLocation |
接受的值: | CurrentUser, LocalMachine |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-TimeoutSec
指定作業的逾時期間,以秒為單位。
類型: | Int32 |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
輸入
System.String
輸出
System.Object