Invoke-ServiceFabricDecryptText
解密 Invoke-ServiceFabricEncryptText Cmdlet 所加密的文字。
Syntax
Invoke-ServiceFabricDecryptText
[-CipherText] <String>
[-StoreLocation <StoreLocation>]
[-TimeoutSec <Int32>]
[<CommonParameters>]
Description
Invoke-ServiceFabricDecryptText Cmdlet 會使用Invoke-ServiceFabricEncryptText Cmdlet 解密在 Service Fabric 中驗證的文字。
在 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 的加密文字。
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-StoreLocation
指定憑證存放區的位置。 有效值為:
- CurrentUser
- LocalMachine
Type: | StoreLocation |
Accepted values: | CurrentUser, LocalMachine |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TimeoutSec
指定作業的逾時期間,以秒為單位。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
輸入
System.String
輸出
System.Object