| 
 | 1 | +---  | 
 | 2 | +external help file: Microsoft.PowerShell.PSResourceGet.dll-Help.xml  | 
 | 3 | +Module Name: Microsoft.PowerShell.PSResourceGet  | 
 | 4 | +ms.custom: 1.1.0-preview.2  | 
 | 5 | +ms.date: 09/13/2024  | 
 | 6 | +online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.psresourceget/compress-psresource?view=powershellget-3.x&WT.mc_id=ps-gethelp  | 
 | 7 | +schema: 2.0.0  | 
 | 8 | +---  | 
 | 9 | + | 
 | 10 | +# Compress-PSResource  | 
 | 11 | + | 
 | 12 | +## SYNOPSIS  | 
 | 13 | + | 
 | 14 | +Compresses a specified folder containing module or script resources into a `.nupkg` file.  | 
 | 15 | + | 
 | 16 | +## SYNTAX  | 
 | 17 | + | 
 | 18 | +```  | 
 | 19 | +Compress-PSResource [-Path] <String> [-DestinationPath] <String> [-PassThru] [-WhatIf] [-Confirm]  | 
 | 20 | + [<CommonsParameters>]  | 
 | 21 | +```  | 
 | 22 | + | 
 | 23 | +## DESCRIPTION  | 
 | 24 | + | 
 | 25 | +This cmdlet compresses a specified folder containing module or script resources into a `.nupkg`  | 
 | 26 | +file. isolates the pack feature in the `Publish-PSResource` cmdlet. This allows you to sign the  | 
 | 27 | +`.nupkg` file before publishing it to a repository. You can publish the final `.nupkg` file using  | 
 | 28 | +the **NupkgPath** parameter of `Publish-PSResource`.  | 
 | 29 | + | 
 | 30 | +This command was added in v1.1.0-preview.2 of **Microsoft.PowerShell.PSResourceGet**.  | 
 | 31 | + | 
 | 32 | +## EXAMPLES  | 
 | 33 | + | 
 | 34 | +### Example 1  | 
 | 35 | + | 
 | 36 | +This example compresses the module **TestModule** and saves te nupkg to the DestinationPath.  | 
 | 37 | + | 
 | 38 | +```powershell  | 
 | 39 | +Compress-PSResource -Path C:\TestModule -DestinationPath C:\NupkgDestination  | 
 | 40 | +```  | 
 | 41 | + | 
 | 42 | +## PARAMETERS  | 
 | 43 | + | 
 | 44 | +### -DestinationPath  | 
 | 45 | + | 
 | 46 | +Path to save the compressed resource.  | 
 | 47 | + | 
 | 48 | +```yaml  | 
 | 49 | +Type: System.String  | 
 | 50 | +Parameter Sets: (All)  | 
 | 51 | +Aliases:  | 
 | 52 | + | 
 | 53 | +Required: True  | 
 | 54 | +Position: 1  | 
 | 55 | +Default value: None  | 
 | 56 | +Accept pipeline input: False  | 
 | 57 | +Accept wildcard characters: False  | 
 | 58 | +```  | 
 | 59 | +
  | 
 | 60 | +### -PassThru  | 
 | 61 | +
  | 
 | 62 | +Pass the full path of the nupkg through the pipeline.  | 
 | 63 | +
  | 
 | 64 | +```yaml  | 
 | 65 | +Type: System.Management.Automation.SwitchParameter  | 
 | 66 | +Parameter Sets: (All)  | 
 | 67 | +Aliases:  | 
 | 68 | + | 
 | 69 | +Required: False  | 
 | 70 | +Position: Named  | 
 | 71 | +Default value: None  | 
 | 72 | +Accept pipeline input: False  | 
 | 73 | +Accept wildcard characters: False  | 
 | 74 | +```  | 
 | 75 | +
  | 
 | 76 | +### -Path  | 
 | 77 | +
  | 
 | 78 | +Path to the resource to be compressed.  | 
 | 79 | +
  | 
 | 80 | +```yaml  | 
 | 81 | +Type: System.String  | 
 | 82 | +Parameter Sets: (All)  | 
 | 83 | +Aliases:  | 
 | 84 | + | 
 | 85 | +Required: True  | 
 | 86 | +Position: 0  | 
 | 87 | +Default value: None  | 
 | 88 | +Accept pipeline input: False  | 
 | 89 | +Accept wildcard characters: False  | 
 | 90 | +```  | 
 | 91 | +
  | 
 | 92 | +### -SkipModuleManifestValidate  | 
 | 93 | +
  | 
 | 94 | +Skips validating the module manifest before publishing.  | 
 | 95 | +
  | 
 | 96 | +```yaml  | 
 | 97 | +Type: System.Management.Automation.SwitchParameter  | 
 | 98 | +Parameter Sets: (All)  | 
 | 99 | +Aliases:  | 
 | 100 | + | 
 | 101 | +Required: False  | 
 | 102 | +Position: Named  | 
 | 103 | +Default value: None  | 
 | 104 | +Accept pipeline input: False  | 
 | 105 | +Accept wildcard characters: False  | 
 | 106 | +```  | 
 | 107 | +
  | 
 | 108 | +### -Confirm  | 
 | 109 | +
  | 
 | 110 | +Prompts you for confirmation before running the cmdlet.  | 
 | 111 | +
  | 
 | 112 | +```yaml  | 
 | 113 | +Type: System.Management.Automation.SwitchParameter  | 
 | 114 | +Parameter Sets: (All)  | 
 | 115 | +Aliases: cf  | 
 | 116 | + | 
 | 117 | +Required: False  | 
 | 118 | +Position: Named  | 
 | 119 | +Default value: None  | 
 | 120 | +Accept pipeline input: False  | 
 | 121 | +Accept wildcard characters: False  | 
 | 122 | +```  | 
 | 123 | +
  | 
 | 124 | +### -WhatIf  | 
 | 125 | +
  | 
 | 126 | +Shows what would happen if the cmdlet runs. The cmdlet isn't run.  | 
 | 127 | +
  | 
 | 128 | +```yaml  | 
 | 129 | +Type: System.Management.Automation.SwitchParameter  | 
 | 130 | +Parameter Sets: (All)  | 
 | 131 | +Aliases: wi  | 
 | 132 | + | 
 | 133 | +Required: False  | 
 | 134 | +Position: Named  | 
 | 135 | +Default value: None  | 
 | 136 | +Accept pipeline input: False  | 
 | 137 | +Accept wildcard characters: False  | 
 | 138 | +```  | 
 | 139 | +
  | 
 | 140 | +### CommonParameters  | 
 | 141 | +
  | 
 | 142 | +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,  | 
 | 143 | +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,  | 
 | 144 | +-WarningAction, and -WarningVariable. For more information, see  | 
 | 145 | +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).  | 
 | 146 | +
  | 
 | 147 | +## INPUTS  | 
 | 148 | +
  | 
 | 149 | +### None  | 
 | 150 | +
  | 
 | 151 | +## OUTPUTS  | 
 | 152 | +
  | 
 | 153 | +### System.String  | 
 | 154 | +
  | 
 | 155 | +By default, this command doesn't write any output to the pipeline. When you use the **PassThru**  | 
 | 156 | +parameter, it returns full path of the `.nupkg` that was created.  | 
 | 157 | + | 
 | 158 | +## NOTES  | 
 | 159 | + | 
 | 160 | +The module defines `cmres` as an alias for `Compress-PSResource`.  | 
 | 161 | + | 
 | 162 | +This cmdlet allows for publishing nuspec dependencies into ACR.  | 
 | 163 | + | 
 | 164 | +## RELATED LINKS  | 
 | 165 | + | 
 | 166 | +[Publish-PSResource](Publish-PSResource.md)  | 
0 commit comments