--- title: "Get NuGet Dependencies" ---
This is generated from the built in components of BuildMaster 2024.0, and may be different than what you have installed (especially if you have extensions); go to [Gear Icon] -> Administration -> Operations within your BuildMaster instance to see exactly what operations are available.

Inspects a .NET build project/packages.config to return the required versions of NuGet package dependencies.

Script usage:

DotNet::Get-Dependencies(
	[ProjectPath: <text>],
	[PackageId: <text>],
	[Dependencies: <RuntimeValue>]
);

Arguments:

NameFormatScript UsageUsage Notes
Project path
text
ProjectPath
Value note: "$WorkingDirectory".
Package ID
text
PackageId
Value note: "return all packages as a map".
Dependencies
RuntimeValue
Dependencies
If PackageId is specified, the name of a text variable to receive the package version. If PackageId is not specified, the name of a map variable to received all dependency information.

Example:

# Store project dependencies in %depends map
DotNet::Get-Dependencies
(
    ProjectPath: ~\Src\MyProject,
    Dependencies => %depends
);