Redaguoti

Bendrinti naudojant


Compress-PSResource

Compresses a specified folder containing module or script resources into a .nupkg file.

Syntax

Compress-PSResource
        [-Path] <String>
        [-DestinationPath] <String>
        [-PassThru]
        [-SkipModuleManifestValidate]
        [-WhatIf]
        [-Confirm]
        [<CommonParameters>]

Description

This cmdlet compresses a specified folder containing module or script resources into a .nupkg file. isolates the pack feature in the Publish-PSResource cmdlet. This allows you to sign the .nupkg file before publishing it to a repository. You can publish the final .nupkg file using the NupkgPath parameter of Publish-PSResource.

This command was added in v1.1.0-preview2 of Microsoft.PowerShell.PSResourceGet.

Examples

Example 1

This example compresses the module TestModule and saves te nupkg to the DestinationPath.

Compress-PSResource -Path C:\TestModule -DestinationPath C:\NupkgDestination

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DestinationPath

Path to save the compressed resource.

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

-PassThru

Pass the full path of the nupkg through the pipeline.

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

-Path

Path to the resource to be compressed.

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

-SkipModuleManifestValidate

Skips validating the module manifest before creating the .nupkg file.

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet isn't run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

FileSystemInfo

By default, this command doesn't write any output to the pipeline. When you use the PassThru parameter, it returns a FileSystemInfo object for the new .nupkg file.

Notes

The module defines cmres as an alias for Compress-PSResource.

This cmdlet allows for publishing nuspec dependencies into ACR.