-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
109 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
external help file: PSDependHelper-help.xml | ||
Module Name: PSDependHelper | ||
online version: | ||
schema: 2.0.0 | ||
--- | ||
|
||
# Find-OutdatedDependency | ||
|
||
## SYNOPSIS | ||
{{ Fill in the Synopsis }} | ||
|
||
## SYNTAX | ||
|
||
``` | ||
Find-OutdatedDependency [-Directory] <DirectoryInfo> [<CommonParameters>] | ||
``` | ||
|
||
## DESCRIPTION | ||
{{ Fill in the Description }} | ||
|
||
## EXAMPLES | ||
|
||
### Example 1 | ||
```powershell | ||
PS C:\> {{ Add example code here }} | ||
``` | ||
|
||
{{ Add example description here }} | ||
|
||
## PARAMETERS | ||
|
||
### -Directory | ||
{{ Fill Directory Description }} | ||
|
||
```yaml | ||
Type: DirectoryInfo | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: 0 | ||
Default value: None | ||
Accept pipeline input: True (ByValue) | ||
Accept wildcard characters: False | ||
``` | ||
### CommonParameters | ||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). | ||
## INPUTS | ||
### System.IO.DirectoryInfo | ||
## OUTPUTS | ||
### Microsoft.PowerShell.Commands.ModuleSpecification | ||
## NOTES | ||
## RELATED LINKS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
function Find-OutdatedDependency { | ||
|
||
[OutputType([Microsoft.PowerShell.Commands.ModuleSpecification])] | ||
[CmdletBinding()] | ||
param ( | ||
# The directory, to scan for dependencies. | ||
[Parameter( Mandatory, ValueFromPipeline )] | ||
[ValidateScript({ $_.Exists })] | ||
[System.IO.DirectoryInfo] $Directory | ||
) | ||
|
||
begin { | ||
$Dependencies = @() | ||
} | ||
|
||
process { | ||
$Dependencies += $Directory | ForEach-Object { | ||
$Dependencies1 = $_ | Get-ChildItem -Recurse -Include *.psd1, *.ps1 | | ||
ForEach-Object { | ||
$Dependencies2 = $_ | Import-Dependency | ||
$Dependencies2 | Add-Member ByFilePath $_.FullName | ||
$Dependencies2 | Write-Output | ||
} | ||
$Dependencies1 | Add-Member ByModuleName $_.Name | ||
$Dependencies1 | Write-Output | ||
} | ||
} | ||
|
||
end { | ||
$DependencyGroups = $Dependencies | Group-Dependency | ||
$DependencyGroups | Where-Object { $_.Version } | ForEach-Object { | ||
$group = $_ | ||
$Dependencies | Where-Object { | ||
$_.Version | ||
} | Where-Object { | ||
$_.Name -eq $group.Name | ||
} | Where-Object { | ||
$_.Version -ne $group.Version | ||
} | ForEach-Object { | ||
$_ | Add-Member TargetVersion $group.Version | ||
$_ | Write-Output | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters