---
title: "Get NuGet Dependencies"
---
Inspects a .NET build project/packages.config to return the required versions of NuGet package dependencies.
DotNet::Get-Dependencies(
[ProjectPath: <text>],
[PackageId: <text>],
[Dependencies: <RuntimeValue>]
);
Name | Format | Script Usage | Usage 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. |
# Store project dependencies in %depends map
DotNet::Get-Dependencies
(
ProjectPath: ~\Src\MyProject,
Dependencies => %depends
);