Common scenarios and recipes for working with PSDepend.
Use the special PSDependOptions node to set defaults that apply to all dependencies in the file:
@{
PSDependOptions = @{
Target = 'C:\MyProject'
DependencyType = 'PSGalleryNuget'
}
'PSDeploy' = 'latest'
'BuildHelpers' = 'latest'
'Pester' = 'latest'
'InvokeBuild' = 'latest'
}All dependencies without an explicit override will be downloaded to C:\MyProject using PSGalleryNuget.
The following properties can be set in PSDependOptions:
ParametersSourceTargetAddToPathTagsDependsOnPreScriptsPostScripts
Individual dependencies can override any value set in PSDependOptions:
@{
PSDependOptions = @{
Target = 'C:\MyProject'
DependencyType = 'PSGalleryNuget'
}
'PSDeploy' = 'latest'
'BuildHelpers' = 'latest'
'Pester' = @{
Target = 'C:\sc'
}
'InvokeBuild' = 'latest'
}All modules install to C:\MyProject except Pester, which installs to C:\sc.
@{
PSDependOptions = @{
Target = 'C:\MyTarget'
}
PSDeploy = 'latest'
'PowerShellOrg/PSDepend' = 'master'
}@{
PSDependOptions = @{
Target = 'C:\MyTarget'
}
PSDeploy = 'latest'
PSSlack = 'latest'
PSJira = @{
Target = 'C:\OtherTarget'
}
'PowerShellOrg/PSDepend' = 'master'
}