Skip to content

Commit 3babab5

Browse files
authored
Merge pull request #3 from it-praktyk/v0.9.9
v.0.9.9
2 parents 9a52c38 + 0b7ad96 commit 3babab5

13 files changed

+104
-100
lines changed

Help/New-OutputFile.md

-4
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,6 @@ CURRENT VERSION
280280
HISTORY OF VERSIONS
281281
https://github.com/it-praktyk/New-OutputObject/VERSIONS.md
282282
283-
REMARKS
284-
- The warning generated by PSScriptAnalyzer "Function 'New-OutputFile' has verb that could change system state.
285-
Therefore, the function has to support 'ShouldProcess'." is acceptable.
286-
287283
LICENSE
288284
Copyright (c) 2016 Wojciech Sciesinski
289285
This function is licensed under The MIT License (MIT)

Help/New-OutputFolder.md

-4
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,6 @@ CURRENT VERSION
262262
HISTORY OF VERSIONS
263263
https://github.com/it-praktyk/New-OutputObject/VERSIONS.md
264264
265-
REMARKS
266-
- The warning generated by PSScriptAnalyzer "Function 'New-OutputFolder' has verb that could change system state.
267-
Therefore, the function has to support 'ShouldProcess'." is acceptable.
268-
269265
LICENSE
270266
Copyright (c) 2016 Wojciech Sciesinski
271267
This function is licensed under The MIT License (MIT)

Help/New-OutputObject.md

-4
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,6 @@ CURRENT VERSION
304304
HISTORY OF VERSIONS
305305
https://github.com/it-praktyk/New-OutputObject/VERSIONS.md
306306
307-
REMARKS
308-
- The warning generated by PSScriptAnalyzer "Function 'New-OutputFile' has verb that could change system state.
309-
Therefore, the function has to support 'ShouldProcess'." is acceptable.
310-
311307
LICENSE
312308
Copyright (c) 2016 Wojciech Sciesinski
313309
This function is licensed under The MIT License (MIT)

New-OutputObject.psd1

0 Bytes
Binary file not shown.

New-OutputObject.psm1

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
2222
#>
2323

24+
Set-StrictMode -Version Latest
2425

2526
#Get public and private function definition files
2627
$Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue )

Private/Test-CharsInPath.ps1

+7-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
# http://powershell.com/cs/blogs/tips/archive/2016/04/20/finding-invalid-file-and-path-characters.aspx
6666
6767
CURRENT VERSION
68-
- 0.5.3 - 2016-11-07
68+
- 0.5.4 - 2016-11-07
6969
7070
HISTORY OF VERSIONS
7171
https://github.com/it-praktyk/New-OutputObject/VERSIONS.md
@@ -132,11 +132,15 @@
132132

133133
ElseIf ($PathType -eq 'String') {
134134

135+
[String]$DirectoryPath = ""
136+
135137
#Convert String to Array of chars
136138
$PathArray = $Path.ToCharArray()
137139

138140
$PathLength = $PathArray.Length
139141

142+
#It should be removed in a future and for loop changed to $i--
143+
#Reverse PathArray to speedup of finding the folder indicator chars '\' or '/'
140144
[array]::Reverse($PathArray)
141145

142146
For ($i = 0; $i -lt $PathLength; $i++) {
@@ -172,7 +176,7 @@
172176

173177
}
174178

175-
[String]$MessageText = "The path provided as a string was devided to: directory part: {0} ; file name part: {1} ." -f $DirectoryPath, $FileName
179+
[String]$MessageText = "The path provided as a string was divided to: directory part: {0} ; file name part: {1} ." -f $DirectoryPath, $FileName
176180

177181
Write-Verbose -Message $MessageText
178182

@@ -236,7 +240,7 @@
236240
Return 1
237241

238242
}
239-
#>
243+
240244
elseif ($IncorectCharFundInPath) {
241245

242246
Return 2

Public/New-OutputFile.ps1

+2-5
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,11 @@ Function New-OutputFile {
131131
KEYWORDS: PowerShell, File, FileSystem
132132
133133
CURRENT VERSION
134-
- 0.9.8 - 2017-05-06
134+
- 0.9.9 - 2017-05-16
135135
136136
HISTORY OF VERSIONS
137137
https://github.com/it-praktyk/New-OutputObject/VERSIONS.md
138138
139-
REMARKS
140-
- The warning generated by PSScriptAnalyzer "Function 'New-OutputFile' has verb that could change system state.
141-
Therefore, the function has to support 'ShouldProcess'." is acceptable.
142-
143139
LICENSE
144140
Copyright (c) 2016 Wojciech Sciesinski
145141
This function is licensed under The MIT License (MIT)
@@ -148,6 +144,7 @@ Function New-OutputFile {
148144
#>
149145

150146
[cmdletbinding()]
147+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')]
151148
[OutputType([System.Object[]])]
152149
param (
153150
[parameter(Mandatory = $false)]

Public/New-OutputFolder.ps1

+2-6
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,11 @@ Function New-OutputFolder {
126126
KEYWORDS: PowerShell, Folder, FileSystem
127127
128128
CURRENT VERSION
129-
- 0.9.8 - 2017-05-06
129+
- 0.9.9 - 2017-05-16
130130
131131
HISTORY OF VERSIONS
132132
https://github.com/it-praktyk/New-OutputObject/VERSIONS.md
133133
134-
REMARKS
135-
- The warning generated by PSScriptAnalyzer "Function 'New-OutputFolder' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'." is acceptable.
136-
137134
LICENSE
138135
Copyright (c) 2016 Wojciech Sciesinski
139136
This function is licensed under The MIT License (MIT)
@@ -142,6 +139,7 @@ Function New-OutputFolder {
142139
#>
143140

144141
[cmdletbinding()]
142+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')]
145143
[OutputType([System.Object[]])]
146144
param (
147145
[parameter(Mandatory = $false)]
@@ -184,8 +182,6 @@ Function New-OutputFolder {
184182

185183
DateTimePartFormat = $DateTimePartFormat
186184

187-
OutputFileNameExtension = $OutputFolderNameExtension
188-
189185
NamePartsSeparator = $NamePartsSeparator
190186

191187
BreakIfError = $BreakIfError

Public/New-OutputObject.ps1

+2-5
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,11 @@ Function New-OutputObject {
144144
KEYWORDS: PowerShell, File, Folder, FileSystem
145145
146146
CURRENT VERSION
147-
- 0.9.8 - 2017-05-06
147+
- 0.9.9 - 2017-05-16
148148
149149
HISTORY OF VERSIONS
150150
https://github.com/it-praktyk/New-OutputObject/VERSIONS.md
151151
152-
REMARKS
153-
- The warning generated by PSScriptAnalyzer "Function 'New-OutputFile' has verb that could change system state.
154-
Therefore, the function has to support 'ShouldProcess'." is acceptable.
155-
156152
LICENSE
157153
Copyright (c) 2016 Wojciech Sciesinski
158154
This function is licensed under The MIT License (MIT)
@@ -161,6 +157,7 @@ Function New-OutputObject {
161157
#>
162158

163159
[cmdletbinding()]
160+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')]
164161
[OutputType([System.Object[]])]
165162
param (
166163
[parameter(Mandatory = $true)]

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Functions from the New-OutputObject don't
3838

3939
Your comments - preferable via GitHub issues - and pull requests are welcomed.
4040

41-
The current module version: 0.9.8 - 2017-05-06.
41+
The current module version: 0.9.9 - 2017-05-16.
4242
The history of versions you can find [here](VERSIONS.md).
4343

4444
The module you can download directly from GitHub or from the [PowerShellGallery](https://www.powershellgallery.com/packages/New-OutputObject/).

TODO.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Alligned to the version 0.9.8 - 2017-05-06
2727

2828
## Test-CharsInPath
2929

30+
- replace a for loop what split path to directory/file to decreasing counter
3031
- add support for an input from pipeline
3132
- add support to return array of incorrect chars and them positions in string
3233
- add support to verifying if non-english chars are used - displaying error/warning, returning other exit code

Tests/New-OutputObject-Module-Specific.Tests.ps1

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
https://www.linkedin.com/in/sciesinskiwojciech
1515
1616
CURRENT VERSION
17-
- 0.9.7 - 2017.05.02
17+
- 0.9.8 - 2017.05.02
1818
1919
HISTORY OF VERSIONS
2020
https://github.com/it-praktyk/New-OutputObject/VERSIONS.md
@@ -24,7 +24,6 @@
2424

2525
$ModuleName = "New-OutputObject"
2626

27-
#Provided path asume that your module manifest (a file with the psd1 extension) exists in the parent directory for directory where test script is stored
2827
$RelativePathToModuleRoot = "{0}\.." -f $PSScriptRoot
2928
$RelativePathToModuleManifest = "{0}\{1}.psd1" -f $RelativePathToModuleRoot, $ModuleName
3029

@@ -119,7 +118,7 @@ $Scripts = Get-ChildItem "$here\..\" -Filter "*.ps1" -Recurse | Where-Object {$_
119118

120119
$Modules = Get-ChildItem "$here\..\" -Filter "*.psm1" -Recurse
121120

122-
$Excluderules = @("PSShouldProcess","PSUseShouldProcessForStateChangingFunctions")
121+
$Excluderules = @()
123122

124123
$Rules = Get-ScriptAnalyzerRule | Where-Object -FilterScript { $_.RuleName -notin $Excluderules }
125124

0 commit comments

Comments
 (0)