Share via


Invoke-ServiceFabricEncryptText

Encrypts text to include in Service Fabric manifests or configurations.

Syntax

CertStore

Invoke-ServiceFabricEncryptText
    [-Text] <String>
    -CertThumbprint <String>
    [-AlgorithmOid <String>]
    [-CertStore]
    [-StoreName <String>]
    [-StoreLocation <StoreLocation>]
    [-TimeoutSec <Int32>]
    [<CommonParameters>]

CertFile

Invoke-ServiceFabricEncryptText
    [-Text] <String>
    -Path <String>
    [-AlgorithmOid <String>]
    [-CertFile]
    [-TimeoutSec <Int32>]
    [<CommonParameters>]

Description

The Invoke-ServiceFabricEncryptText cmdlet encrypts text to include in the Service Fabric cluster manifest, application manifest, or application configurations.

Note

The certificate used for encrypting text must have Data Encipherment as one of the Key Usage fields.

Before you perform any operation on a Service Fabric cluster, establish a connection to the cluster by using the Connect-ServiceFabricCluster cmdlet.

Examples

Example 1: Encrypt text with a Service Fabric manifest

$thumbprint="bf 7c 7a 9f 02 6c 60 62 c6 df 65 55 98 b7 44 e3 99 46 f7 27"
$encryptedText = Invoke-ServiceFabricEncryptText -Text "hello world" -CertThumbprint $thumbprint -CertStore -StoreLocation LocalMachine -StoreName My

Example 2:

$encryptedText = Invoke-ServiceFabricEncryptText -Text "hello world" -CertFile -Path c:\temp\mycert.cer

Parameters

-AlgorithmOid

Specifies the object identifier of the algorithm for this cmdlet.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CertFile

Indicates that this cmdlet uses the CertFile option.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CertFile
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CertStore

Indicates that this cmdlet uses the CertStore option.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CertStore
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CertThumbprint

Specifies the thumbprint of a certificate.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CertStore
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Path

Specifies a path of a .cert or .pfx file.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CertFile
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StoreLocation

Specifies the location of a certificate store. Valid values are:

  • CurrentUser
  • LocalMachine

Parameter properties

Type:StoreLocation
Default value:None
Accepted values:CurrentUser, LocalMachine
Supports wildcards:False
DontShow:False

Parameter sets

CertStore
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StoreName

Specifies the name of a certificate store.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CertStore
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Text

Specifies the text for the cmdlet.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TimeoutSec

Specifies the time-out period, in seconds, for the operation.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

System.Object