diff --git a/powershell-gallery/powershellget-3.x/Microsoft.PowerShell.PSResourceGet/Compress-PSResource.md b/powershell-gallery/powershellget-3.x/Microsoft.PowerShell.PSResourceGet/Compress-PSResource.md new file mode 100644 index 0000000..f880a9b --- /dev/null +++ b/powershell-gallery/powershellget-3.x/Microsoft.PowerShell.PSResourceGet/Compress-PSResource.md @@ -0,0 +1,166 @@ +--- +external help file: Microsoft.PowerShell.PSResourceGet.dll-Help.xml +Module Name: Microsoft.PowerShell.PSResourceGet +ms.custom: 1.1.0-preview.2 +ms.date: 09/13/2024 +online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.psresourceget/compress-psresource?view=powershellget-3.x&WT.mc_id=ps-gethelp +schema: 2.0.0 +--- + +# Compress-PSResource + +## SYNOPSIS + +Compresses a specified folder containing module or script resources into a `.nupkg` file. + +## SYNTAX + +``` +Compress-PSResource [-Path] [-DestinationPath] [-PassThru] [-WhatIf] [-Confirm] + [] +``` + +## 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-preview.2 of **Microsoft.PowerShell.PSResourceGet**. + +## EXAMPLES + +### Example 1 + +This example compresses the module **TestModule** and saves te nupkg to the DestinationPath. + +```powershell +Compress-PSResource -Path C:\TestModule -DestinationPath C:\NupkgDestination +``` + +## PARAMETERS + +### -DestinationPath + +Path to save the compressed resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru + +Pass the full path of the nupkg through the pipeline. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Path + +Path to the resource to be compressed. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkipModuleManifestValidate + +Skips validating the module manifest before publishing. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm + +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf + +Shows what would happen if the cmdlet runs. The cmdlet isn't run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.String + +By default, this command doesn't write any output to the pipeline. When you use the **PassThru** +parameter, it returns full path of the `.nupkg` that was created. + +## NOTES + +The module defines `cmres` as an alias for `Compress-PSResource`. + +This cmdlet allows for publishing nuspec dependencies into ACR. + +## RELATED LINKS + +[Publish-PSResource](Publish-PSResource.md) diff --git a/powershell-gallery/powershellget-3.x/Microsoft.PowerShell.PSResourceGet/Publish-PSResource.md b/powershell-gallery/powershellget-3.x/Microsoft.PowerShell.PSResourceGet/Publish-PSResource.md index 48a8735..6ddcb87 100644 --- a/powershell-gallery/powershellget-3.x/Microsoft.PowerShell.PSResourceGet/Publish-PSResource.md +++ b/powershell-gallery/powershellget-3.x/Microsoft.PowerShell.PSResourceGet/Publish-PSResource.md @@ -1,8 +1,8 @@ --- external help file: Microsoft.PowerShell.PSResourceGet.dll-Help.xml Module Name: Microsoft.PowerShell.PSResourceGet -ms.custom: 1.0.5 -ms.date: 05/17/2024 +ms.custom: 1.1.0-preview.2 +ms.date: 09/13/2024 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.psresourceget/publish-psresource?view=powershellget-3.x&WT.mc_id=ps-gethelp schema: 2.0.0 --- @@ -15,19 +15,29 @@ Publishes a specified module from the local computer to PSResource repository. ## SYNTAX +### PathParameterSet + ``` Publish-PSResource [-ApiKey ] [-Repository ] [-Path] [-DestinationPath ] [-Credential ] [-SkipDependenciesCheck] - [-SkipModuleManifestValidate] [-Proxy ] [-ProxyCredential ] [-WhatIf] [-Confirm] - [] + [-SkipModuleManifestValidate] [-Proxy ] [-ProxyCredential ] [-WhatIf] + [-Confirm] [] +``` + +### NupkgPathParameterSet + +``` +Publish-PSResource [-ApiKey ] [-Repository ] [-DestinationPath ] + [-Credential ] [-SkipDependenciesCheck] [-SkipModuleManifestValidate] [-Proxy ] + [-ProxyCredential ] -NupkgPath [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION This cmdlet combines the functions of the `Publish-Module` and `Publish-Script` cmdlets from **PowerShellGet** v2. `Publish-PSResource` publishes a resource from the local computer to an online -Nuget-based repository. You can specify the resource by the resource's name or by the path -containing the module or script resource. +NuGet-based repository. You can specify the resource by a path containing the module or script +resource files or by pointing a prepackaged `.nupkg` file. ## EXAMPLES @@ -48,6 +58,14 @@ that's generated by the PowerShell Gallery for a user account. Publish-PSResource -Path c:\TestModule -Repository PSGallery -APIKey '1234567' ``` +### Example 3 + +This example publishes the module Nupkg **TestModule.nupkg** to a repositroy named TestRepository. + +```powershell +Publish-PSResource -NupkgPath c:\TestModule.nupkg -Repository TestRepository +``` + ## PARAMETERS ### -ApiKey @@ -100,10 +118,31 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -NupkgPath + +Path to the `.nupkg` file to be published. The `.nupkg` file could have been created by a previous +run of `Publish-PSResource` with the **DestinationPath** parameter. Or, you can create the `.nupkg` +file using the `Compress-PSResource` command. + +This parameter was added in v1.1.0-preview.2 of **Microsoft.PowerShell.PSResourceGet**. + +```yaml +Type: System.String +Parameter Sets: NupkgPathParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Path The path to the module or script file or the path to a folder containing the module or script file -to be published. +to be published. The cmdlet packages all files in the folder into a `.nupkg` file before publishing +to the repository. ```yaml Type: System.String @@ -252,3 +291,5 @@ Fileshare-based repository have no metadata about the resources. Therefore, ther for dependencies. ## RELATED LINKS + +[Compress-PSResource](Compress-PSResource.md)