Skip to content

Task Reference

github-actions[bot] edited this page Jul 19, 2026 · 2 revisions

Task Reference

The exported alias Task.Publish_PowerShellUniversal loads one InvokeBuild task file containing the tasks documented on this page.

Contents

publish_packed_module_to_universal_server

Uploads the module NuGet package directly to the PowerShell Universal module deployment endpoint.

Prerequisites

  • The module has been built and packed.
  • <OutputDirectory>/<ProjectName>.<ModuleVersion>.nupkg exists.
  • UniversalServerUrl and UniversalServerAppToken are available.

Typical workflow

BuildWorkflow:
  deploy:
    - pack
    - publish_packed_module_to_universal_server

The deployment is synchronous and targets the output PowerShell resource repository on the server.

publish_module_from_psresource_repos_to_universal_server

Installs the built module from a PowerShell resource repository configured on the PowerShell Universal server.

Behavior

  1. Resolve the configured repository URL.
  2. Create a local repository directory when the URL is a relative or absolute filesystem path.
  3. Query the server for the configured repository name.
  4. Create or reconcile the repository.
  5. Trigger a synchronous module installation.
  6. Remove the repository when auto-remove is enabled.

Typical workflow

BuildWorkflow:
  deploy:
    - pack
    - publish_module_from_psresource_repos_to_universal_server

package_universal_automation_repository

Creates an offline PowerShell Universal automation repository zip containing the built module and all recursively resolved RequiredModules.

Prerequisites

  • The module build has completed.
  • The built module manifest is available.
  • Every required module can be resolved from PSModulePath.

Outputs

  • Staging directory: <OutputDirectory>/<UniversalRepositoryStagingDirectoryName>
  • Zip package: <OutputDirectory>/<ProjectName>.<ModuleVersion>.zip, unless UniversalRepositoryZipName overrides it.

Typical workflow

BuildWorkflow:
  pack:
    - build
    - package_module_nupkg
    - package_universal_automation_repository

The package includes a top-level repository.psd1 and versioned module folders under Modules.

publish_universal_automation_repository_to_server

Uploads the offline automation repository zip to the PowerShell Universal deployment endpoint.

Prerequisites

  • package_universal_automation_repository has created the zip package.
  • UniversalServerUrl and UniversalServerAppToken are available.

Typical workflow

BuildWorkflow:
  deploy_repository:
    - pack
    - publish_universal_automation_repository_to_server

The task sends UniversalRepositoryAsModule and UniversalUnpinned as deployment query parameters. For the complete repository layout generated by this module, use UniversalRepositoryAsModule: false.

Common parameters

The task file exposes these values through Sampler properties and environment variables:

Parameter Purpose
OutputDirectory Base build output directory.
UniversalServerUrl PowerShell Universal server URL.
UniversalServerAppToken Deployment application token.
UniversalPSResourceRepositoryName Resource repository name.
UniversalPSResourceRepositoryUrl Resource repository URL or path.
UniversalPSResourceRepositoryAutoRemove Controls repository cleanup.
UniversalRepositoryStagingDirectoryName Offline repository staging directory name.
UniversalRepositoryZipName Offline repository zip file name.
UniversalRepositoryAsModule Deployment endpoint asModule value.
UniversalUnpinned Deployment endpoint unpinned value.

See Configuration for defaults and precedence.

Clone this wiki locally