Otter Documentation

upack - Query Package

  • Last Modified: 2020-06-26

This is generated from the built-in components of Otter 2.2, and may be different than what you have installed (especially if you have extensions); go to [User Icon] > Documentation within your Otter instance to see exactly what operations are available.

Query Package

Tests whether a universal package exists and optionally extracts its metadata.

Operation type:

Executing - this operation will perform a specified action or actions on a remote server.

Script usage:

UPack::Query-Package(
	[PackageFile: <text>],
	[FeedUrl: <text>],
	[Credentials: <text>],
	[UserName: <text>],
	[Password: <SecureString>],
	[Name: <text>],
	[Version: <text>],
	[Exists: <true/false>],
	[Metadata: <%(key1: value1, ...)>]
);

Arguments:

Name Format Script Usage Usage Notes
Package file
text
PackageFile
When specified, FeedUrl, UserName, Password, PackageName, and PackageVersion are ignored.
ProGet server URL
text
FeedUrl
Credentials
text
Credentials
User name
text
UserName
Password
SecureString
Password
Package name
text
Name
Package version
text
Version
Package exists
true/false
Exists
When specified, this string variable will be set to "true" if the package exists or "false" if it does not.
Package metadata
%(key1: value1, ...)
Metadata
When specified, this map variable will be assigned containing all of the package's metadata. If the package does not exist this value is not defined.

Example:

# test whether a package exists in a feed and capture its metadata
Query-Package
(
    Credentials: MyExternalFeed,
    PackageName: Group/Package,
    Exists => $exists,
    Metadata => %packageData
);

if $exists
{
    Log-Debug 'Package $(%packageData.name) exists. Latest version is $(%packageData.version).';
}

Is this documentation incorrect or incomplete? Help us by contributing!

This documentation is licensed under CC-BY-SA-4.0 and stored in GitHub.

Generated from commit 46e90aca on master