Copy-ServiceFabricServicePackageToNode

Copies a service package to a target node.

Syntax

Copy-ServiceFabricServicePackageToNode
    [-ServiceManifestName] <String>
    [-ApplicationTypeName] <String>
    [-ApplicationTypeVersion] <String>
    [-NodeName] <String>
    [-PackageSharingPolicies <PackageSharingPolicy[]>]
    [-TimeoutSec <Int32>]
    [<CommonParameters>]

Description

The Copy-ServiceFabricServicePackageToNode cmdlet copies a service package to the Image cache and shared folders on a target node. You can run this cmdlet to pre-populate nodes with required code, config, and data packages. Later service creation operations can finish more quickly.

To manage Service Fabric clusters, start Windows PowerShell by using the Run as administrator option. 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: Generate a package share policy

PS C:\> $sharingPolicy = new-ServiceFabricPackageSharingPolicy -PackageName CalcService5 -SharingScopeAll

This command generates a package share policy by using New-ServiceFabricPackageSharingPolicy cmdlet and assigns it to the variable named $sharingPolicy.

Example 2: Copy a service package

PS C:\> Copy-ServiceFabricServicePackageToNode -ServiceManifestName CalcService5 -ApplicationTypeName CalcServiceApp -ApplicationTypeVersion 5.0 -NodeName Node4 -PackageSharingPolicies $sharingPolicy -TimeoutSec 600 -Verbose

The command copies the service package belonging to application type "CalcServiceApp," application version "5.0," and service manifest "CalcService5" to Node4 with previously generated share policy object $sharePolicy.

Parameters

-ApplicationTypeName

Specifies the name for a Service Fabric application type. The cmdlet copies packages for the application type that this parameter specifies.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ApplicationTypeVersion

Specifies the version of a Service Fabric application type. The cmdlet copies packages for the application type version that this parameter specifies.

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NodeName

Specifies the name of a Service Fabric node. The cmdlet copies the service package to the node that you specify.

Type:String
Position:4
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PackageSharingPolicies

Specifies an array of package sharing policies that describe which packages to copy to the shared packages folder on the target node. To obtain a PackageSharingPolicy object, use the New-ServiceFabricPackageSharingPolicy cmdlet.

Type:PackageSharingPolicy[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ServiceManifestName

Specifies the name of a Service Fabric service package.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-TimeoutSec

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

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

System.Object