diff --git a/docs/Get-RepoPath.md b/docs/Get-RepoPath.md new file mode 100644 index 0000000..9cde904 --- /dev/null +++ b/docs/Get-RepoPath.md @@ -0,0 +1,58 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Get-RepoPath + +## SYNOPSIS +Updates the module manifest file fields to prepare the new build. + +## SYNTAX + +``` +Get-RepoPath [[-SubPath] ] [] +``` + +## DESCRIPTION +Replaces the version fields in the manifest file. +Uses Drone env vars populated by pushed tags. + +## EXAMPLES + +### EXAMPLE 1 +``` +Import-Module -Name DroneHelper; Get-RepoPath +``` + +## PARAMETERS + +### -SubPath +An optional string array of sub directories relative to the root. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +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 + +### [None] No pipeline input. +## OUTPUTS + +### [DroneHelper.Repo.Path] Returns a folder structured like object with relevant full paths.s +## NOTES + +## RELATED LINKS diff --git a/docs/Install-ModuleDependency.md b/docs/Install-ModuleDependency.md new file mode 100644 index 0000000..d1efb70 --- /dev/null +++ b/docs/Install-ModuleDependency.md @@ -0,0 +1,42 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Install-ModuleDependency + +## SYNOPSIS +Install required modules of the module manifest file. + +## SYNTAX + +``` +Install-ModuleDependency [] +``` + +## DESCRIPTION +Use this cmdlet to install required modules of the module manifest file. + +## EXAMPLES + +### EXAMPLE 1 +``` +Install-ModuleDependency +``` + +## PARAMETERS + +### 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 + +### [None] +## OUTPUTS + +### [None] +## NOTES + +## RELATED LINKS diff --git a/docs/Invoke-BuildState.md b/docs/Invoke-BuildState.md new file mode 100644 index 0000000..4ec196b --- /dev/null +++ b/docs/Invoke-BuildState.md @@ -0,0 +1,42 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Invoke-BuildState + +## SYNOPSIS +Sets final Drone pipeline build state. + +## SYNTAX + +``` +Invoke-BuildState [] +``` + +## DESCRIPTION +Marks the pipeline ass succeeded of fail based on the custom state file. + +## EXAMPLES + +### EXAMPLE 1 +``` +Invoke-BuildState +``` + +## PARAMETERS + +### 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 + +### [None] No pipeline input. +## OUTPUTS + +### [None] No pipeline output. +## NOTES + +## RELATED LINKS diff --git a/docs/Invoke-FileLinter.md b/docs/Invoke-FileLinter.md new file mode 100644 index 0000000..8804ffd --- /dev/null +++ b/docs/Invoke-FileLinter.md @@ -0,0 +1,58 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Invoke-FileLinter + +## SYNOPSIS +Runs the file linter for all src files found in current repository. + +## SYNTAX + +``` +Invoke-FileLinter [-PassThru] [] +``` + +## DESCRIPTION +Invoke-FileLinter runs the basic file tests and generates a report file for furher usage in the +drone pipeline. + +## EXAMPLES + +### EXAMPLE 1 +``` +Invoke-FileLinter +``` + +## PARAMETERS + +### -PassThru +{{ Fill PassThru Description }} + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +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 + +### [None] +## OUTPUTS + +### [DroneHelper.FileLinter.Report] +## NOTES + +## RELATED LINKS diff --git a/docs/Invoke-InstallDependency.md b/docs/Invoke-InstallDependency.md new file mode 100644 index 0000000..28d479f --- /dev/null +++ b/docs/Invoke-InstallDependency.md @@ -0,0 +1,42 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Invoke-InstallDependency + +## SYNOPSIS +Install required modules for executing the DroneHelper pipeline helpers. + +## SYNTAX + +``` +Invoke-InstallDependency [] +``` + +## DESCRIPTION +This can be used in drone.io docker pipeline if the modules are not integrated in the build image. + +## EXAMPLES + +### EXAMPLE 1 +``` +Import-Module -Name DroneHelper; Invoke-Install-Dependency +``` + +## PARAMETERS + +### 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 + +### [None] No Input required. +## OUTPUTS + +### [None] No Output +## NOTES + +## RELATED LINKS diff --git a/docs/Invoke-Linter.md b/docs/Invoke-Linter.md new file mode 100644 index 0000000..f6c6d99 --- /dev/null +++ b/docs/Invoke-Linter.md @@ -0,0 +1,42 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Invoke-Linter + +## SYNOPSIS +Runs all PSScriptAnalyzer Rules within this repo. + +## SYNTAX + +``` +Invoke-Linter [] +``` + +## DESCRIPTION +This Cmdlet is used in Drone pipeline to run the PSScriptAnalyzer rules.. + +## EXAMPLES + +### EXAMPLE 1 +``` +Invoke-Linter +``` + +## PARAMETERS + +### 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 + +### [None] No pipeline input. +## OUTPUTS + +### [None] No pipeline output. +## NOTES + +## RELATED LINKS diff --git a/docs/Invoke-Publish.md b/docs/Invoke-Publish.md new file mode 100644 index 0000000..aaaf392 --- /dev/null +++ b/docs/Invoke-Publish.md @@ -0,0 +1,42 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Invoke-Publish + +## SYNOPSIS +Publishes powershell module to internal Nexus repository. + +## SYNTAX + +``` +Invoke-Publish [] +``` + +## DESCRIPTION +This Cmdlet is used to publish the module via Drone pipeline. + +## EXAMPLES + +### EXAMPLE 1 +``` +Invoke-Publish +``` + +## PARAMETERS + +### 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 + +### [None] No pipeline input. +## OUTPUTS + +### [None] No pipeline output. +## NOTES + +## RELATED LINKS diff --git a/docs/Invoke-UnitTest.md b/docs/Invoke-UnitTest.md new file mode 100644 index 0000000..8881599 --- /dev/null +++ b/docs/Invoke-UnitTest.md @@ -0,0 +1,124 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Invoke-UnitTest + +## SYNOPSIS +Runs all Pester tests within this repo. + +## SYNTAX + +``` +Invoke-UnitTest [[-CoverageFormat] ] [[-Verbosity] ] [-PassThru] [[-Tag] ] + [[-ExcludeTag] ] [] +``` + +## DESCRIPTION +This Cmdlet is used in Drone pipeline to perform the Pester based unit tests. + +## EXAMPLES + +### EXAMPLE 1 +``` +Invoke-UnitTest +``` + +## PARAMETERS + +### -CoverageFormat +Pester provides the formats JaCoCo ans CoverageGutters. +Default is JaCoCo. +These are the known use cases: +- JaCoCo -\> Used as standard coverage report used by sonar +- CoverageGutters -\> Custom Format to show coverage in VSCode. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: JaCoCo +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExcludeTag +Pester build in exclude filter for tests as string array. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Tells Invoke-UnitTest to write back the Pester results into your variable / output. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Pester build in tag filter as string array. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Verbosity +This parameter sets the Pester detail level. +Default is 'Normal.' Available values are: +'None', 'Normal', 'Detailed', 'Diagnostic' + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: Normal +Accept pipeline input: False +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 + +### [None] No pipeline input. +## OUTPUTS + +### [None] No pipeline output. +## NOTES + +## RELATED LINKS diff --git a/docs/Merge-ModuleRoot.md b/docs/Merge-ModuleRoot.md new file mode 100644 index 0000000..90c0d18 --- /dev/null +++ b/docs/Merge-ModuleRoot.md @@ -0,0 +1,42 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Merge-ModuleRoot + +## SYNOPSIS +Merges single ps1 files into one module script file. + +## SYNTAX + +``` +Merge-ModuleRoot [] +``` + +## DESCRIPTION +This Cmdlet is used in build pipeline to reduce the file load and import performance to the target module. + +## EXAMPLES + +### EXAMPLE 1 +``` +Import-Module -Name DroneHelper; Merge-ModuleRoot +``` + +## PARAMETERS + +### 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 + +### [None] No pipeline input. +## OUTPUTS + +### [None] No pipeline output. +## NOTES + +## RELATED LINKS diff --git a/docs/New-BuildPackage.md b/docs/New-BuildPackage.md new file mode 100644 index 0000000..777dca7 --- /dev/null +++ b/docs/New-BuildPackage.md @@ -0,0 +1,57 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# New-BuildPackage + +## SYNOPSIS +Creates a new module package as compressed archive. + +## SYNTAX + +``` +New-BuildPackage [[-AdditionalPath] ] [] +``` + +## DESCRIPTION +This function is used in build pipeline to create an uploadable module version for the Gitea release page. + +## EXAMPLES + +### EXAMPLE 1 +``` +Import-Module -Name DroneHelper; New-BuildPackage +``` + +## PARAMETERS + +### -AdditionalPath +You can provide additional paths to add files or folders in published module. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +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 + +### [None] No pipeline input. +## OUTPUTS + +### [None] No pipeline output. +## NOTES + +## RELATED LINKS diff --git a/docs/New-Docs.md b/docs/New-Docs.md new file mode 100644 index 0000000..f6ad4db --- /dev/null +++ b/docs/New-Docs.md @@ -0,0 +1,44 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# New-Docs + +## SYNOPSIS +Creates a ne set of markdown based help in the docs folder. + +## SYNTAX + +``` +New-Docs [] +``` + +## DESCRIPTION +This Cmdlet should be used once locally, or after adding new functions. +The function \`Update-Docs\` +can be used via pipeline to keep the docs up to date. + +## EXAMPLES + +### EXAMPLE 1 +``` +New-Docs +``` + +## PARAMETERS + +### 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 + +### [None] No pipeline input. +## OUTPUTS + +### [None] No pipeline output. +## NOTES + +## RELATED LINKS diff --git a/docs/Readme.md b/docs/Readme.md new file mode 100644 index 0000000..8646a0a --- /dev/null +++ b/docs/Readme.md @@ -0,0 +1,86 @@ +--- +Module Name: DroneHelper +Module Guid: 4293292f-eac8-42ed-8e9d-437d4f405d2c +Download Help Link: {{ Update Download Link }} +Help Version: {{ Please enter version of help manually (X.X.X.X) format }} +Locale: en-US +--- + +# DroneHelper Module +## Description +See global [Readme file](../README.md) for usage instructions. + +## DroneHelper Cmdlets +### [Get-RepoPath](Get-RepoPath.md) +Updates the module manifest file fields to prepare the new build. + +### [Install-ModuleDependency](Install-ModuleDependency.md) +Install required modules of the module manifest file. + +### [Invoke-BuildState](Invoke-BuildState.md) +Sets final Drone pipeline build state. + +### [Invoke-FileLinter](Invoke-FileLinter.md) +Runs the file linter for all src files found in current repository. + +### [Invoke-InstallDependency](Invoke-InstallDependency.md) +Install required modules for executing the DroneHelper pipeline helpers. + +### [Invoke-Linter](Invoke-Linter.md) +Runs all PSScriptAnalyzer Rules within this repo. + +### [Invoke-Publish](Invoke-Publish.md) +Publishes powershell module to internal Nexus repository. + +### [Invoke-UnitTest](Invoke-UnitTest.md) +Runs all Pester tests within this repo. + +### [Merge-ModuleRoot](Merge-ModuleRoot.md) +Merges single ps1 files into one module script file. + +### [New-BuildPackage](New-BuildPackage.md) +Creates a new module package as compressed archive. + +### [New-Docs](New-Docs.md) +Creates a ne set of markdown based help in the docs folder. + +### [Send-PRComment](Send-PRComment.md) +Sends build report as Gitea PR comment. + +### [Set-EOL](Set-EOL.md) +Helper function to set the EOL sequence to LF or CRLF. + +### [Test-FileBOM](Test-FileBOM.md) +Tests given file if native utf8 w/o BOM is used. +Returns false if BOM is present. + +### [Test-FileEncoding](Test-FileEncoding.md) +Returns true if the given file is written in a valid encoding + +### [Test-FileEOF](Test-FileEOF.md) +Returns false if EOF isn't an empty line. + +### [Test-FileEOL](Test-FileEOL.md) +Returns false if EOL isn't CRLF + +### [Test-FileTab](Test-FileTab.md) +Returns false if tab char is used in file. + +### [Test-FileTailingWhitespace](Test-FileTailingWhitespace.md) +Returns false if there are any tailing whitespace in lines. + +### [Update-Changelog](Update-Changelog.md) +Updates the changelog file with recent commits + +### [Update-Docs](Update-Docs.md) +Publishes powershell module to internal Nexus repository. + +### [Update-ModuleMeta](Update-ModuleMeta.md) +Updates the module manifest file fields to prepare the new build. + +### [Write-FailureStateFile](Write-FailureStateFile.md) +Writes the current pipeline step into failure log. + +### [Write-ResultFile](Write-ResultFile.md) +Writes the current pipeline step into failure log. + diff --git a/docs/Send-PRComment.md b/docs/Send-PRComment.md new file mode 100644 index 0000000..08d4992 --- /dev/null +++ b/docs/Send-PRComment.md @@ -0,0 +1,79 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Send-PRComment + +## SYNOPSIS +Sends build report as Gitea PR comment. + +## SYNTAX + +``` +Send-PRComment [[-Mode] ] [[-GiteaUser] ] [] +``` + +## DESCRIPTION +Send-PRComment is used to report the build details from drone.io pipeline. + +## EXAMPLES + +### EXAMPLE 1 +``` +Send-PRComment +Depends on Drone.IO injected environment vars. Doesn't work locally on dev systems. +``` + +## PARAMETERS + +### -GiteaUser +Gitea user for drone bot + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: Drone-bot +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Mode +Sets the report mode. +Default is 'Renew'. +This mode deletes the old pr comments and creates a new onw. +Also available: + - 'Add' -\> simply adds new pr comments. + - 'Edit' -\> Edits the last known pr comment. +Doesn't clean old ones. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: Renew +Accept pipeline input: False +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 + +### [None]. +## OUTPUTS + +### [None] +## NOTES + +## RELATED LINKS diff --git a/docs/Set-EOL.md b/docs/Set-EOL.md new file mode 100644 index 0000000..62f2805 --- /dev/null +++ b/docs/Set-EOL.md @@ -0,0 +1,73 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Set-EOL + +## SYNOPSIS +Helper function to set the EOL sequence to LF or CRLF. + +## SYNTAX + +``` +Set-EOL [[-Style] ] [-Path] [] +``` + +## DESCRIPTION +Helper for changing the EOL independent to the current OS defaults. + +## EXAMPLES + +### EXAMPLE 1 +``` +Import-Module -Name DroneHelper; Set-EOL -Path './Readme.md' +``` + +## PARAMETERS + +### -Path +Mandatory path for target file. + +```yaml +Type: FileInfo +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Style +Optional style parameter for \`unix\` or \`win.\`. +Default is \`unix\`. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: Unix +Accept pipeline input: False +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 + +### [None] No pipeline input. +## OUTPUTS + +### [DroneHelper.Repo.Path] Returns a folder structured like object with relevant full paths.s +## NOTES + +## RELATED LINKS diff --git a/docs/Test-FileBOM.md b/docs/Test-FileBOM.md new file mode 100644 index 0000000..515410b --- /dev/null +++ b/docs/Test-FileBOM.md @@ -0,0 +1,58 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Test-FileBOM + +## SYNOPSIS +Tests given file if native utf8 w/o BOM is used. +Returns false if BOM is present. + +## SYNTAX + +``` +Test-FileBOM [-Path] [] +``` + +## DESCRIPTION +This function is used to test for a valid encoding without BOM. + +## EXAMPLES + +### EXAMPLE 1 +``` +Test-FileBOM -Path './Testfile.txt' +``` + +## PARAMETERS + +### -Path +Full or relative path to existing file. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +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 + +### [None] +## OUTPUTS + +### [bool] +## NOTES + +## RELATED LINKS diff --git a/docs/Test-FileEOF.md b/docs/Test-FileEOF.md new file mode 100644 index 0000000..6fd2a15 --- /dev/null +++ b/docs/Test-FileEOF.md @@ -0,0 +1,57 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Test-FileEOF + +## SYNOPSIS +Returns false if EOF isn't an empty line. + +## SYNTAX + +``` +Test-FileEOF [-Path] [] +``` + +## DESCRIPTION +Test the given file against the EOF standard (final empty/blank line + CRLF) and returns true or false. + +## EXAMPLES + +### EXAMPLE 1 +``` +Test-FileEOF -Path './testfile.txt' +``` + +## PARAMETERS + +### -Path +Relative or full path to an existing file. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +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 + +### [none] +## OUTPUTS + +### [bool] +## NOTES + +## RELATED LINKS diff --git a/docs/Test-FileEOL.md b/docs/Test-FileEOL.md new file mode 100644 index 0000000..a07a8b6 --- /dev/null +++ b/docs/Test-FileEOL.md @@ -0,0 +1,58 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Test-FileEOL + +## SYNOPSIS +Returns false if EOL isn't CRLF + +## SYNTAX + +``` +Test-FileEOL [-Path] [] +``` + +## DESCRIPTION +Tests given file against valid EOL. +Returns true if CRLF is used. + +## EXAMPLES + +### EXAMPLE 1 +``` +Test-FileEOL -Path './TestFile.txt' +``` + +## PARAMETERS + +### -Path +Relative or full path to an existing file. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +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 + +### [None] +## OUTPUTS + +### [bool] +## NOTES + +## RELATED LINKS diff --git a/docs/Test-FileEncoding.md b/docs/Test-FileEncoding.md new file mode 100644 index 0000000..6c98617 --- /dev/null +++ b/docs/Test-FileEncoding.md @@ -0,0 +1,73 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Test-FileEncoding + +## SYNOPSIS +Returns true if the given file is written in a valid encoding + +## SYNTAX + +``` +Test-FileEncoding [-Path] [[-Encoding] ] [] +``` + +## DESCRIPTION +Test the given file against the encoding regex and returns true or false + +## EXAMPLES + +### EXAMPLE 1 +``` +Test-FileEncoding -Path './testfile.txt' +``` + +## PARAMETERS + +### -Encoding +Optional custom encoding regex string. +Default is (utf8|ascii|xml). + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: (utf8|utf-8|ascii|xml) +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Path +Relative or full path to an existing file. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +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 + +### [none] +## OUTPUTS + +### [bool] +## NOTES + +## RELATED LINKS diff --git a/docs/Test-FileTab.md b/docs/Test-FileTab.md new file mode 100644 index 0000000..687c74e --- /dev/null +++ b/docs/Test-FileTab.md @@ -0,0 +1,58 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Test-FileTab + +## SYNOPSIS +Returns false if tab char is used in file. + +## SYNTAX + +``` +Test-FileTab [-Path] [] +``` + +## DESCRIPTION +Test the given file if tabs are used. +Returns false if any tabs were found. + +## EXAMPLES + +### EXAMPLE 1 +``` +Test-FileTab -Path './testfile.txt' +``` + +## PARAMETERS + +### -Path +elative or full path to an existing file. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +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 + +### [none] +## OUTPUTS + +### [bool] +## NOTES + +## RELATED LINKS diff --git a/docs/Test-FileTailingWhitespace.md b/docs/Test-FileTailingWhitespace.md new file mode 100644 index 0000000..37cad20 --- /dev/null +++ b/docs/Test-FileTailingWhitespace.md @@ -0,0 +1,58 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Test-FileTailingWhitespace + +## SYNOPSIS +Returns false if there are any tailing whitespace in lines. + +## SYNTAX + +``` +Test-FileTailingWhitespace [-Path] [] +``` + +## DESCRIPTION +Tests the given file for tailing whitespace. +Returns true if not found. + +## EXAMPLES + +### EXAMPLE 1 +``` +Test-FileTailingWhitespace.ps1 -Path './testfile.txt' +``` + +## PARAMETERS + +### -Path +Relative or full path to an existing file. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +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 + +### [none] +## OUTPUTS + +### [bool] +## NOTES + +## RELATED LINKS diff --git a/docs/Update-Changelog.md b/docs/Update-Changelog.md new file mode 100644 index 0000000..fd3dcbc --- /dev/null +++ b/docs/Update-Changelog.md @@ -0,0 +1,75 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Update-Changelog + +## SYNOPSIS +Updates the changelog file with recent commits + +## SYNTAX + +``` +Update-Changelog [-NewVersion] [-SkipCleanup] [] +``` + +## DESCRIPTION +This helper function is used to insert recent changes for an upcoming release. + +## EXAMPLES + +### EXAMPLE 1 +``` +Import-Module -Name DroneHelper; Update-Changelog -NewVersion '0.0.1-dev5' +``` + +## PARAMETERS + +### -NewVersion +Provide a valid semver based version tag for the upcoming release like: + +- \`v0.0.1-dev1\` +- \`v1.0.0\` + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkipCleanup +You can skip the tag update and additional test. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +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 + +### [None] No pipeline input. +## OUTPUTS + +### [None] no pipeline putput. +## NOTES + +## RELATED LINKS diff --git a/docs/Update-Docs.md b/docs/Update-Docs.md new file mode 100644 index 0000000..29b603d --- /dev/null +++ b/docs/Update-Docs.md @@ -0,0 +1,42 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Update-Docs + +## SYNOPSIS +Publishes powershell module to internal Nexus repository. + +## SYNTAX + +``` +Update-Docs [] +``` + +## DESCRIPTION +This Cmdlet is used to publish the module via Drone pipeline. + +## EXAMPLES + +### EXAMPLE 1 +``` +Update-Docs +``` + +## PARAMETERS + +### 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 + +### [None] No pipeline input. +## OUTPUTS + +### [None] No pipeline output. +## NOTES + +## RELATED LINKS diff --git a/docs/Update-ModuleMeta.md b/docs/Update-ModuleMeta.md new file mode 100644 index 0000000..1f330b2 --- /dev/null +++ b/docs/Update-ModuleMeta.md @@ -0,0 +1,43 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Update-ModuleMeta + +## SYNOPSIS +Updates the module manifest file fields to prepare the new build. + +## SYNTAX + +``` +Update-ModuleMeta [] +``` + +## DESCRIPTION +Replaces the version fields in the manifest file. +Uses Drone env vars populated by pushed tags. + +## EXAMPLES + +### EXAMPLE 1 +``` +Import-Module -Name DroneHelper; Update-ModuleMeta +``` + +## PARAMETERS + +### 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 + +### [None] No pipeline input. +## OUTPUTS + +### [None] No pipeline output. +## NOTES + +## RELATED LINKS diff --git a/docs/Write-FailureStateFile.md b/docs/Write-FailureStateFile.md new file mode 100644 index 0000000..5b1c503 --- /dev/null +++ b/docs/Write-FailureStateFile.md @@ -0,0 +1,57 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Write-FailureStateFile + +## SYNOPSIS +Writes the current pipeline step into failure log. + +## SYNTAX + +``` +Write-FailureStateFile [-StepName] [] +``` + +## DESCRIPTION +This Cmdlet is used to mark single steps as failed without stopping the complete pipeline. + +## EXAMPLES + +### EXAMPLE 1 +``` +Write-FailureStateFile +``` + +## PARAMETERS + +### -StepName +The current DroneHelper step name which should be added into to the log. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +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 + +### [None] No pipeline input. +## OUTPUTS + +### [None] No pipeline output. +## NOTES + +## RELATED LINKS diff --git a/docs/Write-ResultFile.md b/docs/Write-ResultFile.md new file mode 100644 index 0000000..24c3793 --- /dev/null +++ b/docs/Write-ResultFile.md @@ -0,0 +1,87 @@ +--- +external help file: ModuleRoot-help.xml +Module Name: DroneHelper +online version: +schema: 2.0.0 +--- + +# Write-ResultFile + +## SYNOPSIS +Writes the current pipeline step into failure log. + +## SYNTAX + +``` +Write-ResultFile [-InputObject] [-Path] [-Type] [] +``` + +## DESCRIPTION +This Cmdlet is used to mark single steps as failed without stopping the complete pipeline. + +## EXAMPLES + +### EXAMPLE 1 +``` +Write-FailureStateFile +``` + +## PARAMETERS + +### -InputObject +{{ Fill InputObject Description }} + +```yaml +Type: PSObject +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Path +{{ Fill Path Description }} + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Type +{{ Fill Type Description }} + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +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 + +### [None] No pipeline input. +## OUTPUTS + +### [None] No pipeline output. +## NOTES + +## RELATED LINKS