Skip to content

Commit

Permalink
v0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
mazzy-ax committed May 6, 2018
1 parent bcb7ba8 commit 5f3b7be
Show file tree
Hide file tree
Showing 16 changed files with 180 additions and 95 deletions.
21 changes: 15 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Changelog

All notable changes to the project <https://github.com/mazzy-ax/Write-ProgressEx> will be documented in this file. See also <https://github.com/mazzy-ax/Write-ProgressEx/releases>.
All notable changes to the [project](https://github.com/mazzy-ax/Write-ProgressEx) will be documented in this file. See also <https://github.com/mazzy-ax/Write-ProgressEx/releases>.

## [v0.19](https://github.com/mazzy-ax/Write-ProgressEx/compare/v0.18...v0.19) - 2018-05-06

* The switch `Reset` added to `Write-ProgressEx` cmdlet.
* Deep refactoring in the cmdlet `Set-ProgressEx`.
* `On completed message` clarified.
* The directive `#require -module Write-ProgressEx` added to example scripts.
* Splatting example added.
* Examples and tests cleanup.
* Readme changed.

## [v0.18](https://github.com/mazzy-ax/Write-ProgressEx/compare/v0.17...v0.18) - 2018-05-06

Expand Down Expand Up @@ -45,7 +55,7 @@ All notable changes to the project <https://github.com/mazzy-ax/Write-ProgressEx
### Added

* Example 'counter' demonstrate how to use [Write-ProgressEx cmdlet as counter](Examples/Write-ProgressEx.counter.ps1).
* Tests with tag build added. It need to run and test exapmles.
* Tests with tag build added. It need to run and test examples.

### Changed

Expand Down Expand Up @@ -81,7 +91,7 @@ All notable changes to the project <https://github.com/mazzy-ax/Write-ProgressEx
* The Current can be more then Total. It's used to make iterations when Total is not known.
* The Stopwatch redesigned: stopwatch start with first iterations. The messages uses the stopwatch to display a total elapsed time
* The module icon
* Exapmles and Readme
* Examples and Readme

### Removed

Expand Down Expand Up @@ -109,14 +119,14 @@ All notable changes to the project <https://github.com/mazzy-ax/Write-ProgressEx

## [v0.8](https://github.com/mazzy-ax/Write-ProgressEx/compare/v0.7...v0.8) - 2017-08-08

* Minor improvements with useage of parameter storage $ProgressEx
* Minor improvements with usage of parameter storage $ProgressEx
* The function Complete-progressAndChildren refactored

## [v0.7](https://github.com/mazzy-ax/Write-ProgressEx/compare/v0.6...v0.7) - 2017-08-06

### Main goal

* Move parmeter storage from a global to a module scope
* Move parameter storage from a global to a module scope
* Provide a developer with functional to get/set actual parameters
* Provide a developer with a splatting
* Clarify and split logic to calculate progress parameters and logic to store its
Expand All @@ -142,4 +152,3 @@ All notable changes to the project <https://github.com/mazzy-ax/Write-ProgressEx
### Removed

* $Global:ProgressExInfo

7 changes: 7 additions & 0 deletions Examples/Write-ProgressEx.autoName.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#Requires -module Write-ProgressEx

# To install the module from https://www.powershellgallery.com/packages/Write-ProgressEx run the powershell command:
# PS> Install-Module Write-ProgressEx
#
# see https://github.com/mazzy-ax/Write-ProgressEx for details

$range = 1..500

$range | write-ProgressEx -Total $range.Count | ForEach-Object {
Expand Down
7 changes: 7 additions & 0 deletions Examples/Write-ProgressEx.counter.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#Requires -module Write-ProgressEx

# To install the module from https://www.powershellgallery.com/packages/Write-ProgressEx run the powershell command:
# PS> Install-Module Write-ProgressEx
#
# see https://github.com/mazzy-ax/Write-ProgressEx for details

$projectRoot = Resolve-Path $PSScriptRoot\..

$projectRoot | Join-Path -ChildPath Write-ProgressEx.*.ps1 | Get-ChildItem | write-ProgressEx -id 0 "files in Exapmle directory" -ShowMessagesOnCompleted -NoProgressBar | ForEach-Object {
Expand Down
7 changes: 7 additions & 0 deletions Examples/Write-ProgressEx.info.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#Requires -module Write-ProgressEx

# To install the module from https://www.powershellgallery.com/packages/Write-ProgressEx run the powershell command:
# PS> Install-Module Write-ProgressEx
#
# see https://github.com/mazzy-ax/Write-ProgressEx for details

$range = 1..1000

write-ProgressEx 'wait, please' -Total $range.Count
Expand Down
8 changes: 7 additions & 1 deletion Examples/Write-ProgressEx.multi.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#Requires -module Write-ProgressEx

# To install the module from https://www.powershellgallery.com/packages/Write-ProgressEx run the powershell command:
# PS> Install-Module Write-ProgressEx
#
# see https://github.com/mazzy-ax/Write-ProgressEx for details

$level1 = 1..6
$level2 = 1..9
$level3 = 1..11
$global = 1..900


write-ProgressEx "Try to change the height of the console window..." -Total $level1.Count
$level1 | write-ProgressEx | ForEach-Object {

Expand Down
11 changes: 9 additions & 2 deletions Examples/Write-ProgressEx.parm.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#Requires -module Write-ProgressEx

# To install the module from https://www.powershellgallery.com/packages/Write-ProgressEx run the powershell command:
# PS> Install-Module Write-ProgressEx
#
# see https://github.com/mazzy-ax/Write-ProgressEx for details

$nodes = 1..20
$names = 1..50

write-ProgressEx "parm nodes" -Total $nodes.Count -ShowMessagesOnCompleted
$nodes | Where-Object {$true} | ForEach-Object {
$nodes | ForEach-Object {
write-ProgressEx "parm names" -Total $names.Count -id 1
$names | Where-Object {$true} | ForEach-Object {
$names | ForEach-Object {
#...
write-ProgressEx -id 1 -increment -Status "inner"
}
Expand Down
11 changes: 9 additions & 2 deletions Examples/Write-ProgressEx.pipe.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#Requires -module Write-ProgressEx

# To install the module from https://www.powershellgallery.com/packages/Write-ProgressEx run the powershell command:
# PS> Install-Module Write-ProgressEx
#
# see https://github.com/mazzy-ax/Write-ProgressEx for details

$nodes = 1..20
$names = 1..50

$nodes | Where-Object {$true} | write-ProgressEx "pipe nodes" -Total $nodes.Count -Status "outer" -ShowMessages | ForEach-Object {
$names | Where-Object {$true} | write-ProgressEx "pipe names" -Total $names.Count -id 1 -Status "inner" | ForEach-Object {
$nodes | write-ProgressEx "pipe nodes" -Total $nodes.Count -Status "outer" -ShowMessages | ForEach-Object {
$names | write-ProgressEx "pipe names" -Total $names.Count -id 1 -Status "inner" | ForEach-Object {
#...
}
}
32 changes: 32 additions & 0 deletions Examples/Write-ProgressEx.splatting.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#Requires -module Write-ProgressEx

# To install the module from https://www.powershellgallery.com/packages/Write-ProgressEx run the powershell command:
# PS> Install-Module Write-ProgressEx
#
# see https://github.com/mazzy-ax/Write-ProgressEx for details

$nodes = 1..20
$names = 1..50

# hashtables for constant parameters
$progressNode = @{
id = 0
total = $nodes.Count
activity = 'splatting nodes'
status = 'outer'
}

$progressNames = @{
id = 1
total = $names.count
activity = 'splatting names'
status = 'inner'
}

# splatting. see https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_splatting

$nodes | write-ProgressEx @progressNode | ForEach-Object {
$names | write-ProgressEx @progressNames | ForEach-Object {
#...
}
}
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# Write-ProgressEx: extended write-progress cmdlet
# Write-ProgressEx &ndash; extended write-progress cmdlet

[project]:https://github.com/mazzy-ax/Write-ProgressEx
[version.svg]:https://img.shields.io/badge/version-0.18-green.svg
[license]:https://github.com/mazzy-ax/Write-ProgressEx/blob/master/LICENSE
[license.svg]:https://img.shields.io/badge/license-MIT-blue.svg
[ps]:https://www.powershellgallery.com/packages/Write-ProgressEx
[ps.svg]:https://img.shields.io/powershellgallery/dt/Write-ProgressEx.svg?colorB=4682B4
[nuget]:https://www.nuget.org/packages/Write-ProgressEx

[version.svg]:https://img.shields.io/badge/version-0.19-green.svg
[license.svg]:https://img.shields.io/badge/license-MIT-blue.svg
[ps.svg]:https://img.shields.io/powershellgallery/dt/Write-ProgressEx.svg?colorB=4682B4
[nuget.svg]:https://img.shields.io/nuget/dt/Write-ProgressEx.svg?label=NuGet&colorB=ef8b00

[![version][version.svg]][project] [![license MIT][license.svg]][license] [![PowerShell Gallery][ps.svg]][ps] [![NuGet][nuget.svg]][nuget]

[Write-ProgressEx][project] extends the functionality of the standard powershell cmdlet. Write-ProgressEx is a powershell native cmdlet that provide a simple way to show ProgressBars, PercentComplete and SecondsRemaining.
[Write-ProgressEx][project] extends the functionality of the standard powershell cmdlet. Write-ProgressEx is a powershell native cmdlet that provides a simple way to show ProgressBars with PercentComplete and SecondsRemaining.

![icon](Media/Write-ProgressEx-icon.png "Write-ProgressEx")
![Write-ProgressEx icon](Media/Write-ProgressEx-icon.png "Write-ProgressEx")

The cmdlet:

Expand All @@ -33,8 +34,8 @@ The cmdlet:
* status changed;
* completed.
* uses script blocks to show messages;
* provide counter functional. See [Write-ProgressEx as a counter](Examples/Write-ProgressEx.counter.ps1);
* use the caller function name or the caller script file name as the Activity.
* provides counter functional. See [Write-ProgressEx as a counter](Examples/Write-ProgressEx.counter.ps1);
* uses the caller function name or the caller script file name as the Activity.

Note 1: the cmdlet is not safe with multi-thread.

Expand Down
8 changes: 4 additions & 4 deletions Tests/Write-ProgressEx.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $moduleName = Split-Path $moduleRoot -Leaf

Import-Module $moduleName -Force

Describe "Write-ProgressEx" -Tag "Run", "UnitTest", "UT" {
Describe "Write-ProgressEx" -Tag Run, UnitTest, UT {
$outerLevel = 1..3
$innerLevel = 1..2

Expand Down Expand Up @@ -84,7 +84,7 @@ Describe "Write-ProgressEx" -Tag "Run", "UnitTest", "UT" {
(Get-ProgressEx -id 1).Total | Should -BeNullOrEmpty
break
}
(Get-ProgressEx -id 0) | Should -BeNullOrEmpty
Get-ProgressEx -id 0 | Should -BeNullOrEmpty
}

It "complete children progress when 'previous' id used" {
Expand Down Expand Up @@ -119,7 +119,7 @@ Describe "Write-ProgressEx" -Tag "Run", "UnitTest", "UT" {
}
}

Describe "Get-ProgressEx" -Tag "Run", "UnitTest", "UT" {
Describe "Get-ProgressEx" -Tag Run, UnitTest, UT {

Context "work" {
It "get" {
Expand Down Expand Up @@ -180,7 +180,7 @@ Describe "Get-ProgressEx" -Tag "Run", "UnitTest", "UT" {
}
}

Describe "Set-ProgressEx" -Tag "Run", "UnitTest", "UT" {
Describe "Set-ProgressEx" -Tag Run, UnitTest, UT {

Context "work" {
It "work" {
Expand Down
2 changes: 1 addition & 1 deletion Tests/examples.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $moduleName = Split-Path $moduleRoot -Leaf

Import-Module $moduleRoot -Force

Describe "Module $moduleName examples Tests" -Tag 'Build' {
Describe "Module $moduleName examples Tests" -Tag Build, Examples {

Get-ChildItem $projectRoot\Examples\*.ps1 -Recurse | ForEach-Object {
It "ok for $_" {
Expand Down
10 changes: 9 additions & 1 deletion Tests/manifests.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ Describe 'Module Manifest Tests' -Tag 'Meta' {
$manifest.Version -as [Version] | Should be ( $ChangelogVersion -as [Version] )
}

It 'description have not back quote' {
$manifest.Description | Should -Not -Match '`'
}

It 'release notes have not back quote' {
$manifest.PrivateData.PSData.ReleaseNotes | Should -Not -Match '`'
}

}

Describe 'Nuget specification Tests' -Tag 'Meta' {
Expand Down Expand Up @@ -93,7 +101,7 @@ Describe 'Nuget specification Tests' -Tag 'Meta' {

}

Describe "$readme Tests" -Tag 'Meta' {
Describe "$readme Tests" -Tag Meta {

It "has a valid shields.io/badge/version in the $readme file" {
Get-Content -Path $projectRoot\$readme |
Expand Down
2 changes: 1 addition & 1 deletion Tests/psScriptAnalyzer.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $projectRoot = Resolve-Path "$PSScriptRoot\.."
$moduleRoot = Split-Path (Resolve-Path "$projectRoot\*\*.psd1")
$moduleName = Split-Path $moduleRoot -Leaf

Describe "PSScriptAnalyzer Rules for $moduleName" -Tag 'Meta' {
Describe "PSScriptAnalyzer Rules for $moduleName" -Tag Meta, BestPractice, BP {
$analysis = Invoke-ScriptAnalyzer -Path $projectRoot -Recurse
$scriptAnalyzerRules = Get-ScriptAnalyzerRule
forEach ($rule in $scriptAnalyzerRules) {
Expand Down
20 changes: 8 additions & 12 deletions Write-ProgressEx.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,23 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Write-ProgressEx</id>
<version>0.18</version>
<version>0.19</version>
<authors>Sergey Mazurkin</authors>
<licenseUrl>https://github.com/mazzy-ax/Write-ProgressEx/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/mazzy-ax/Write-ProgressEx</projectUrl>
<iconUrl>https://github.com/mazzy-ax/Write-ProgressEx/blob/master/Media/Write-ProgressEx-icon.png?raw=true</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Write-ProgressEx extends the functionality of the standard cmdlet. Write-ProgressEx is a powershell native cmdlet that provide a simple way to show ProgressBars, PercentComplete and SecondsRemaining.</description>
<releaseNotes>
## v0.18
## v0.19

* The function Set-ProgressEx fixed.
* The example Write-ProgressEx.autoName.ps1 fixed.
* The cmdlet Set-StrictMode removed from project scripts.
* The directive #require -version 3.0 removed from project scripts.
* The function nz extracted from Write-ProgressExMessage.
* The chocolateyInstall.ps1 removed.
* The directory structure reorganized to remove media, examples and tests from nuget downloads and powershell gallery.
* The project meta info tests added.
* Tests fixed.
* The switch Reset added to Write-ProgressEx cmdlet.
* Deep refactoring in the cmdlet Set-ProgressEx.
* 'On completed message' clarified.
* The directive '#require -module Write-ProgressEx' added to example scripts.
* Splatting example added.
* Examples and tests cleanup.
* Readme changed.
* Typo corrected.
</releaseNotes>
<tags>Progress ProgressBar Write-Progress</tags>
</metadata>
Expand Down
22 changes: 9 additions & 13 deletions Write-ProgressEx/Write-ProgressEx.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
RootModule = 'Write-ProgressEx.psm1'

# Version number of this module.
ModuleVersion = '0.18'
ModuleVersion = '0.19'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -100,19 +100,15 @@ PrivateData = @{

# ReleaseNotes of this module
ReleaseNotes = @'
## v0.18
* The function Set-ProgressEx fixed.
* The example Write-ProgressEx.autoName.ps1 fixed.
* The cmdlet Set-StrictMode removed from project scripts.
* The directive #require -version 3.0 removed from project scripts.
* The function nz extracted from Write-ProgressExMessage.
* The chocolateyInstall.ps1 removed.
* The directory structure reorganized to remove media, examples and tests from nuget downloads and powershell gallery.
* The project meta info tests added.
* Tests fixed.
## v0.19
* The switch Reset added to Write-ProgressEx cmdlet.
* Deep refactoring in the cmdlet Set-ProgressEx.
* 'On completed message' clarified.
* The directive '#require -module Write-ProgressEx' added to example scripts.
* Splatting example added.
* Examples and tests cleanup.
* Readme changed.
* Typo corrected.
'@

# External dependent modules of this module
Expand Down
Loading

0 comments on commit 5f3b7be

Please sign in to comment.