Copy-​Service​Fabric​Service​Package​To​Node

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.

Required 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:2
Default value:None
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:3
Default value:None
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:5
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ServiceManifestName

Specifies the name of a Service Fabric service package.

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

Optional Parameters

-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
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
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

You cannot pipe input to this cmdlet.

Outputs

System.Object

This cmdlet returns a message that includes the status of the operation.