Skip to content

Commit

Permalink
Add tags to psd1 for PowerShell Gallery
Browse files Browse the repository at this point in the history
Also let VSCode reformat the main psm1 file.
  • Loading branch information
drmohundro committed Jan 26, 2018
1 parent 876e069 commit b0a2bd5
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 37 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This project adheres to [Semantic Versioning](http://semver.org).

## [1.7.2] - 2018-01-25
### Changed

- Changed tags for better support in the [PowerShellGallery](https://www.powershellgallery.com).

## [1.7.1] - 2015-07-14
### Added

Expand Down
Binary file modified Find-String.psd1
Binary file not shown.
73 changes: 36 additions & 37 deletions Find-String.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@ if (Get-Module -Name Find-String) { return }
#requires -version 2

function Find-String {
[CmdletBinding(DefaultParameterSetName="Filter")]
param (
[Parameter(Position = 0, Mandatory=$true)]
[regex] $pattern,

[Parameter(Position = 1, ParameterSetName="Filter")]
[string] $filter = "*.*",

[Parameter(Position = 1, ParameterSetName="Include")]
[string[]] $include = @(),

[string[]] $excludeFiles = @(),
[string[]] $excludeDirectories = @(),
[string[]] $path = @(),
[switch] $recurse = $true,
[switch] $caseSensitive = $false,
[int[]] $context = 0,
[switch] $passThru = $false,
[switch] $pipeOutput = $false,
[switch] $listMatchesOnly = $false
)
[CmdletBinding(DefaultParameterSetName = "Filter")]
param (
[Parameter(Position = 0, Mandatory = $true)]
[regex] $pattern,

[Parameter(Position = 1, ParameterSetName = "Filter")]
[string] $filter = "*.*",

[Parameter(Position = 1, ParameterSetName = "Include")]
[string[]] $include = @(),

[string[]] $excludeFiles = @(),
[string[]] $excludeDirectories = @(),
[string[]] $path = @(),
[switch] $recurse = $true,
[switch] $caseSensitive = $false,
[int[]] $context = 0,
[switch] $passThru = $false,
[switch] $pipeOutput = $false,
[switch] $listMatchesOnly = $false
)

if ((-not $caseSensitive) -and (-not $pattern.Options -match "IgnoreCase")) {
$pattern = New-Object -TypeName regex -Property $pattern.ToString(),@($pattern.Options,"IgnoreCase")
$pattern = New-Object -TypeName regex -Property $pattern.ToString(), @($pattern.Options, "IgnoreCase")
}

function directoriesToExclude {
Expand Down Expand Up @@ -65,7 +65,7 @@ param (

function shouldFilterDirectory {
param (
[Parameter(Mandatory=$true)]
[Parameter(Mandatory = $true)]
$item
)

Expand All @@ -82,7 +82,7 @@ param (

function filterExcludes {
param (
[Parameter(Mandatory=$true)]
[Parameter(Mandatory = $true)]
$item
)

Expand All @@ -92,8 +92,7 @@ param (
return $true
}

switch ($PsCmdlet.ParameterSetName)
{
switch ($PsCmdlet.ParameterSetName) {
'Filter' {
if ($passThru) {
Get-ChildItem -recurse:$recurse -filter:$filter -path $path -exclude (& filesToExclude) |
Expand Down Expand Up @@ -134,7 +133,7 @@ param (
}
}

<#
<#
.Synopsis
Searches text files by pattern and displays the results.
.Description
Expand Down Expand Up @@ -180,17 +179,17 @@ param (
}

function Out-ColorMatchInfo {
param (
[Parameter(Mandatory=$true, ValueFromPipeline=$true)]
[Microsoft.PowerShell.Commands.MatchInfo]
$match,
param (
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[Microsoft.PowerShell.Commands.MatchInfo]
$match,

[switch]
$onlyShowMatches = $false,
[switch]
$onlyShowMatches = $false,

[switch]
$pipeOutput = $false
)
[switch]
$pipeOutput = $false
)

begin {
$script:priorPath = ''
Expand Down Expand Up @@ -300,7 +299,7 @@ param (
}
end {}

<#
<#
.Synopsis
Highlights MatchInfo objects similar to the output from ack.
.Description
Expand Down

0 comments on commit b0a2bd5

Please sign in to comment.