Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## [Unreleased]

## [0.4.0-alpha] - 2026-05-26
## [0.4.0] - 2026-05-26

### Added

Expand Down Expand Up @@ -83,7 +83,7 @@
### Fixed

- `Get-Dependency` operator-precedence bug when `DependencyType` is
set inside `PSDependOptions`: parenthesization was incorrect, so the

Check warning on line 86 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / Continuous Integration / Run Linters

Unknown word (parenthesization)
global default failed to apply to dependencies without an explicit
type (#131, #173).
- `Find-PSDependLocally` now consults *all* installed versions of a
Expand All @@ -94,7 +94,7 @@
passing it to `Import-Module`, preventing failures when prerelease
segments or `vX.Y.Z` tags appear in the resolved version (#140).
- `Chocolatey` install path now passes `--yes` to `choco install`
(previously the script contained the typo `--yess`), so installs

Check warning on line 97 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / Continuous Integration / Run Linters

Unknown word (yess) Suggestions: (yes, yeas, yens, yeps, yest)
no longer hang waiting on confirmation, and the surrounding code
was tidied for readability (#174).
- `Git` handler now uses the full `Dependency.Target` path when the
Expand Down
2 changes: 1 addition & 1 deletion PSDepend/PSDepend.psm1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Get public and private function definition files.
#Get public and private function definition files.
$Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue )
$Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue )
$ModuleRoot = $PSScriptRoot
Expand Down
4 changes: 2 additions & 2 deletions PSDepend/PSDependScripts/Chocolatey.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
Installs a Chocolatey package a repository.

Expand Down Expand Up @@ -306,4 +306,4 @@ if ($PSDependAction -contains 'Install') {
}
elseif ($PSDependAction -contains 'Test' -and $PSDependAction.count -eq 1) {
return $false
}
}
8 changes: 4 additions & 4 deletions PSDepend/PSDependScripts/Command.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
Invoke a PowerShell command

Expand All @@ -13,12 +13,12 @@
Source: The code to run
Parameters:
FailOnError: If specified, throw a terminating error if the command errors out.

.PARAMETER PSDependAction
Only option is to install the module. Defaults to Install

Install: Install the dependency

.PARAMETER Dependency
Dependency to process

Expand All @@ -30,13 +30,13 @@
}
}

# Run some aribtrary PowerShell code that assigns a variable and uses it in a string

Check warning on line 33 in PSDepend/PSDependScripts/Command.ps1

View workflow job for this annotation

GitHub Actions / Continuous Integration / Run Linters

Unknown word (aribtrary) Suggestions: (arbitrary, arbitral, arbitrage, arbitrate, arbitrarily)
# Output: Running a command on WJ-LAB
#>
[cmdletbinding()]

Check warning on line 36 in PSDepend/PSDependScripts/Command.ps1

View workflow job for this annotation

GitHub Actions / Continuous Integration / Run Linters

Unknown word (cmdletbinding)
param (
[PSTypeName('PSDepend.Dependency')]
[psobject[]]$Dependency,

Check warning on line 39 in PSDepend/PSDependScripts/Command.ps1

View workflow job for this annotation

GitHub Actions / Continuous Integration / Run Linters

Unknown word (psobject) Suggestions: (isobject, isObject, project, object, subject)

[switch]$FailOnError,

Expand All @@ -63,4 +63,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion PSDepend/PSDependScripts/DotnetSdk.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
Installs the .NET Core SDK.

Expand Down Expand Up @@ -44,13 +44,13 @@
}

# Simple syntax
# The .NET SDK will be installed with the latest verion from the LTS channel, globally.

Check warning on line 47 in PSDepend/PSDependScripts/DotnetSdk.ps1

View workflow job for this annotation

GitHub Actions / Continuous Integration / Run Linters

Unknown word (verion) Suggestions: (vernon, virion, verizon, version, Vernon)

#>
[CmdletBinding()]
param(
[PSTypeName('PSDepend.Dependency')]
[psobject[]]

Check warning on line 53 in PSDepend/PSDependScripts/DotnetSdk.ps1

View workflow job for this annotation

GitHub Actions / Continuous Integration / Run Linters

Unknown word (psobject) Suggestions: (isobject, isObject, project, object, subject)
$Dependency,

[ValidateSet('Test', 'Install', 'Import')]
Expand All @@ -60,7 +60,7 @@

# Users can specify 'Global which will use the default global path of
# "$env:LocalAppData\Microsoft\dotnet" on Windows or "$env:HOME/.dotnet" elsewhere
# Since Global is the default behavior, we ingore the fact that the Target was set.

Check warning on line 63 in PSDepend/PSDependScripts/DotnetSdk.ps1

View workflow job for this annotation

GitHub Actions / Continuous Integration / Run Linters

Unknown word (ingore) Suggestions: (ignore, indore, Indore, ignored, ignorer)
$InstallDir = if ($Dependency.Target -and $Dependency.Target -ne 'Global') { $Dependency.Target }
$Version = $Dependency.Version
$Channel = if ($Dependency.DependencyName) { $Dependency.DependencyName } else { "release" }
Expand Down
6 changes: 3 additions & 3 deletions PSDepend/PSDependScripts/FileDownload.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
Download a file

Expand All @@ -19,7 +19,7 @@
Install: Install the dependency

.EXAMPLE
sqllite_dll = @{

Check warning on line 22 in PSDepend/PSDependScripts/FileDownload.ps1

View workflow job for this annotation

GitHub Actions / Continuous Integration / Run Linters

Unknown word (sqllite) Suggestions: (sqlite, SQLite, sallie, stylite, sulfite)
DependencyType = 'FileDownload'
Source = 'https://github.com/RamblingCookieMonster/PSSQLite/blob/main/PSSQLite/x64/System.Data.SQLite.dll?raw=true'
Target = 'C:\temp'
Expand All @@ -35,7 +35,7 @@

# Downloads System.Data.SQLite.dll to C:\temp\sqlite.dll
#>
[cmdletbinding()]

Check warning on line 38 in PSDepend/PSDependScripts/FileDownload.ps1

View workflow job for this annotation

GitHub Actions / Continuous Integration / Run Linters

Unknown word (cmdletbinding)
param(
[PSTypeName('PSDepend.Dependency')]
[psobject[]]
Expand Down Expand Up @@ -111,7 +111,7 @@
$FileName = Parse-URLForFile -URL $URL
}
$Path = Join-Path $Target $FileName

if (Test-Path $Path -PathType Leaf) {
Write-Verbose "Skipping existing file [$Path]"
if ($PSDependAction -contains 'Test') {
Expand All @@ -137,7 +137,7 @@
Get-WebFile -URL $URL -Path $Path
}

if ($Dependency.AddToPath) {
if ($Dependency.AddToPath) {
Write-Verbose "Setting PATH to`n$($PathToAdd, $env:PATH -join ';' | Out-String)"
Add-ToItemCollection -Reference Env:\Path -Item $PathToAdd
}
6 changes: 3 additions & 3 deletions PSDepend/PSDependScripts/FileSystem.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
EXPERIMENTAL: Use Robocopy or Copy-Item for folder and file dependencies, respectively.

Expand Down Expand Up @@ -86,7 +86,7 @@ foreach ($Source in @($Sources)) {
continue
}
$IsContainer = ( Get-Item $Source ).PSIsContainer

# Resolve PSDrives.
$Target = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Target)
$Source = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Source)
Expand Down Expand Up @@ -172,4 +172,4 @@ if ($PSDependAction -like 'Import') {
}
}
Import-PSDependModule $ImportPath
}
}
8 changes: 4 additions & 4 deletions PSDepend/PSDependScripts/Git.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
Clone a git repository

Expand Down Expand Up @@ -68,7 +68,7 @@ param(
[string[]]$PSDependAction = @('Install'),

[string]$ImportPath,

[bool]$ExtractProject = $False
)

Expand Down Expand Up @@ -170,7 +170,7 @@ elseif ($GottaInstall -and $ExtractProject) {

$null = New-Item -ItemType Directory -Path $OutPath -Force
Push-Location $OutPath

Write-Verbose -Message "Cloning dependency [$GitName] with git from [$($Target)]"
Invoke-ExternalCommand git 'clone', $Name

Expand Down Expand Up @@ -198,7 +198,7 @@ elseif ($GottaInstall -and $ExtractProject) {
if ($Dependency.AddToPath) {
Write-Verbose "Setting PSModulePath to`n$($Target, $env:PSModulePath -join ';' | Out-String)"
Add-ToItemCollection -Reference Env:\PSModulePath -Item (Get-Item $Target).FullName

Write-Verbose "Setting PATH to`n$($RepoPath, $env:PATH -join ';' | Out-String)"
Add-ToItemCollection -Reference Env:\PATH -Item (Get-Item $Target).FullName
}
Expand Down
4 changes: 2 additions & 2 deletions PSDepend/PSDependScripts/GitHub.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
Installs a module from a GitHub repository.

Expand Down Expand Up @@ -313,7 +313,7 @@ if ($ShouldInstall) {
$Page = 0

try {
:nullcheck while ($GitHubVersion -Eq $null) {
:nullcheck while ($null -eq $GitHubVersion) {
$Page++
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
$GitHubTags = Invoke-RestMethod -Uri "https://api.github.com/repos/$DependencyID/tags?per_page=100&page=$Page"
Expand Down
4 changes: 2 additions & 2 deletions PSDepend/PSDependScripts/Noop.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
Display variables that a dependency script would receive.

Expand Down Expand Up @@ -31,4 +31,4 @@ Write-Verbose "Starting noop run with $($Dependency.count) sources"
DependencyParameters = $Dependency.Parameters
GetVariable = (Get-Variable)
ENV = Get-ChildItem ENV:
}
}
10 changes: 5 additions & 5 deletions PSDepend/PSDependScripts/Npm.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
Install a node package from NPM.

Expand All @@ -18,7 +18,7 @@

.PARAMETER Dependency
Dependency to process

.PARAMETER Global
If specified, the node package will be installed globally.

Expand Down Expand Up @@ -96,10 +96,10 @@ If ($PSDependAction -contains 'Test') {
Pop-Location
}
$InstalledModule = $InstalledNodeModules.$Name
If ($InstalledModule -eq $null) {
If ($null -eq $InstalledModule) {
return $false
}
ElseIf ($Version -ne $null -and $InstalledModule.Version -ne $Version) {
ElseIf ($null -ne $Version -and $InstalledModule.Version -ne $Version) {
return $false
}
Else {
Expand All @@ -121,4 +121,4 @@ If ($PSDependAction -contains 'Install') {
Pop-Location
}
}
#endregion Install Action
#endregion Install Action
2 changes: 1 addition & 1 deletion PSDepend/PSDependScripts/Nuget.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
Installs a package from a Nuget repository like Nuget.org using nuget.exe

Expand Down
10 changes: 5 additions & 5 deletions PSDepend/PSDependScripts/PSGalleryModule.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
Installs a module from a PowerShell repository like the PowerShell Gallery.

Expand All @@ -9,8 +9,8 @@
Name: The name for this module
Version: Used to identify existing installs meeting this criteria, and as RequiredVersion for installation. Defaults to 'latest'
Target: Used as 'Scope' for Install-Module. If this is a path, we use Save-Module with this path. On reruns, PSDepend checks existing modules first and skips reinstalling when the requested version is already present. Defaults to 'AllUsers'
AddToPath: If target is used as a path, prepend that path to ENV:PSModulePath
Credential: The username and password used to authenticate against the private repository
AddToPath: If target is used as a path, prepend that path to ENV:PSModulePath
Credential: The username and password used to authenticate against the private repository

If you don't have the Nuget package provider, we install it for you

Expand All @@ -25,7 +25,7 @@

.PARAMETER AcceptLicense
Accepts the license agreement during installation.

.PARAMETER AllowPrerelease
If specified, allow for prerelease.

Expand Down Expand Up @@ -80,7 +80,7 @@
# No version is specified - we assume latest in this case.

# * Perhaps you use this https://github.com/PowerShell/PSPrivateGallery, or Artifactory, ProGet, etc.

.EXAMPLE
@{
'vmware.powercli' = @{
Expand Down
4 changes: 2 additions & 2 deletions PSDepend/PSDependScripts/PSGalleryNuget.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
Installs a module from a PowerShell repository like the PowerShell Gallery using nuget.exe

Expand Down Expand Up @@ -191,4 +191,4 @@ if ($PSDependAction -contains 'Install') {
$importVs = if ($Version -and $Version -notlike 'latest') {
$Version
}
Import-PSDependModule -Name $ModulePath -Action $PSDependAction -Version $importVs
Import-PSDependModule -Name $ModulePath -Action $PSDependAction -Version $importVs
6 changes: 3 additions & 3 deletions PSDepend/PSDependScripts/PSResourceGet.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
Installs a PowerShell resource from a PowerShell repository using PSResourceGet.

Expand Down Expand Up @@ -222,10 +222,10 @@ elseif ($command -eq 'install') {

# Filter params to only those accepted by the target command
$targetCmd = if ($command -eq 'save') {
'Save-PSResource'
'Save-PSResource'
}
else {
'Install-PSResource'
'Install-PSResource'
}
$availableParameters = (Get-Command $targetCmd).Parameters
$tempParams = $params.Clone()
Expand Down
2 changes: 1 addition & 1 deletion PSDepend/PSDependScripts/Package.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
EXPERIMENTAL: Installs a package using the PackageManagement module

Expand Down
4 changes: 2 additions & 2 deletions PSDepend/PSDependScripts/Task.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
Support dependencies by handling simple tasks.

Expand Down Expand Up @@ -69,4 +69,4 @@ foreach ($Depend in $Dependency) {
Write-Warning "Could not find task file [$Task] from dependency [$($Depend.DependencyName)]"
}
}
}
}
2 changes: 1 addition & 1 deletion PSDepend/PSDependScripts/WindowsRSAT.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
'Install a WindowsRSAT PowerShell module using Add-WindowsCapability or Install-WindowsFeature, depending on OS'

Expand Down
24 changes: 12 additions & 12 deletions PSDepend/Private/Add-ObjectDetail.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Add-ObjectDetail {
function Add-ObjectDetail {
<#
.SYNOPSIS
Decorate an object with
Expand All @@ -10,19 +10,19 @@ function Add-ObjectDetail {
Helper function to decorate an object with
- A TypeName
- New properties
- Default parameters
- Default parameters

.PARAMETER InputObject
Object to decorate. Accepts pipeline input.

.PARAMETER TypeName
Typename to insert.

This will show up when you use Get-Member against the resulting object.

.PARAMETER PropertyToAdd
Add these noteproperties.

Format is a hashtable with Key (Property Name) = Value (Property Value).

Example to add a One and Date property:
Expand Down Expand Up @@ -85,7 +85,7 @@ function Add-ObjectDetail {
.NOTES
This breaks the 'do one thing' rule from certain perspectives...
The goal is to decorate an object all in one shot

This abstraction simplifies decorating an object, with a slight trade-off in performance. For example:

10,000 objects, add a property and typename:
Expand All @@ -94,11 +94,11 @@ function Add-ObjectDetail {

Initial code borrowed from Shay Levy:
http://blogs.microsoft.co.il/scriptfanatic/2012/04/13/custom-objects-default-display-in-powershell-30/

.FUNCTIONALITY
PowerShell Language
#>
[CmdletBinding()]
[CmdletBinding()]
param(
[Parameter( Mandatory = $true,
Position = 0,
Expand All @@ -111,7 +111,7 @@ function Add-ObjectDetail {
[string]$TypeName,

[Parameter( Mandatory = $false,
Position = 2)]
Position = 2)]
[System.Collections.Hashtable]$PropertyToAdd,

[Parameter( Mandatory = $false,
Expand All @@ -122,7 +122,7 @@ function Add-ObjectDetail {

[boolean]$Passthru = $True
)

Begin {
if ($PSBoundParameters.ContainsKey('DefaultProperties')) {
# define a subset of properties
Expand All @@ -136,7 +136,7 @@ function Add-ObjectDetail {
'PropertyToAdd' {
foreach ($Key in $PropertyToAdd.Keys) {
#Add some noteproperties. Slightly faster than Add-Member.
$Object.PSObject.Properties.Add( ( New-Object System.Management.Automation.PSNoteProperty($Key, $PropertyToAdd[$Key]) ) )
$Object.PSObject.Properties.Add( ( New-Object System.Management.Automation.PSNoteProperty($Key, $PropertyToAdd[$Key]) ) )
}
}
'TypeName' {
Expand All @@ -153,4 +153,4 @@ function Add-ObjectDetail {
}
}
}
}
}
2 changes: 1 addition & 1 deletion PSDepend/Private/Add-ToItemCollection.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Add-ToItemCollection {
function Add-ToItemCollection {
param(
$Delimiter = [IO.Path]::PathSeparator,
$Reference, # e.g. ENV:Path
Expand Down
Loading
Loading