Giter Club home page Giter Club logo

catesta's Introduction

Hi there, I'm Jake 👋

I'm a Senior Systems Development Engineer at AWS. I write code and use modern technology practices to create highly robust, secure, and performant enterprise solutions.

Connect with me

techthoughts.info TechThoughts2 | YouTube JakeMorrison | Twitter Jacob Morrison | LinkedIn


Languages and Tools

Visual Studio Code

Windows

PowerShell

Yaml

AWS

AWS Lambda

Azure

Azure Functions

DevOps

Git

GitHub

Python

Telegram

WordPress



📺 Latest YouTube Videos

➡️ Learn PowerShell YouTube Playlist...

📕 Latest Blog Posts

➡️ more blog posts...

catesta's People

Contributors

snozzberries avatar syrull avatar techthoughts2 avatar tseknet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

catesta's Issues

Module name not being replaced in infratest sample file

Expected Behavior

Module name should be replaced during deployment for SampleInfraTest.Tests.ps1

Current Behavior

Module name is not replaced.

Remains as: # $ModuleName = '<%=$PLASTER_PARAM_ModuleName%>

Possible Solution

Steps to Reproduce

  1. Deploy new project
  2. Check SampleInfraTest.Tests.ps1

PowerShellCodeBuildGit.yml missing sub

Expected Behavior

Line 194 specifying codepipeline should have a !Sub Intrinsic function to specify the region

Current Behavior

Currently the !Sub is missing and causes the CFN to fail validation.

Possible Solution

Add !Sub Intrinsic function

Build before testing/analysis

Description

If you test the individually and then build the module you aren't accurately testing the code that you're shipping, simple things like $script: or $global: variables may be set in functions that break interactions in other functions but pass the tests. There are also other more complex interactions that can occur with the dot sourcing process (assuming the individual function tests are importing the psd1 or psm1 rather than just the individual function file) which don't occur when all the functions are in a single file.

Describe the solution you'd like

Have the test and analyze steps depend on the build step. It takes a tiny amount of time to combine the ps1 files into a psm1 so it's well worth doing it first.

Additional context

As a side benefit this will also speed up tests which import the module with -Force since dot sourcing is really slow. It'll not be noticeable for small modules but for bigger ones or ones with lots of tests that many imports will have an impact on test time.

S3 Bucket name not being replaced in AWS installmodules

Expected Behavior

When AWS CI/CD choice is used and S3 bucket is provided install_modules.ps1 should have S3 bucket name replaced.

BucketName    = '<%=$PLASTER_PARAM_S3Bucket%>'

Current Behavior

It only leaves the variable:

BucketName    = $PLASTER_PARAM_S3Bucket

Steps to Reproduce

  1. Build a new PowerShell project
  2. Select AWS CI/CD
  3. Provide S3 bucket name

Add Pester 5 capabilities

Description

Evaluate level of effort to add Pester 5 support to Catesta module scaffolding.

Describe the solution you'd like

Give users the ability to scaffold module projects that will be engaging Pester 5+

Additional context

Likely want to keep Pester 4 support for the time being so give users a choice if possible.

Catesta BuildHeader does not display correct information during build

Manifest info in build header does not display correct information

Expected Behavior

Manifest Info should display useful manifest information.

Current Behavior

Manifest Info: System.Collections.Hashtable

Possible Solution

Adjust manifest information to display manifest version.

Steps to Reproduce

  1. Run an invoke build against a vanilla module
  2. Review BuildHeader output

Detailed Description

When running invoke-build the Set-BuildHeader separates tasks and provides a clean output with useful information.

Currently, one of those is only putting out a hashtable (Manifest Info).

This should be corrected to display relevant information about the manifest during the build.

AWS install_modules does not correctly set $tempPath

Expected Behavior

When as S3 bucket is provided for AWS install_modules the $temppath should be set for them to be downloaded.

Current Behavior

The $tempPath variable is not set. This causes the download to fail.

Possible Solution

$tempPath = [System.IO.Path]::GetTempPath()

Steps to Reproduce

  1. Build a new PowerShell project
  2. Select AWS CI/CD
  3. Provide S3 bucket name
  4. Push through AWS CodeBuild

Update Azure Pipelines PublishCodeCoverageResults to v2

Description

New V2 version of task publishing code coverage results is available to all our customers now. We highly recommend to stop using the V1 version and migrate to V2 version (https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/publish-code-coverage-results-v2). For more details, see - https://devblogs.microsoft.com/devops/new-pccr-task.

Describe the solution you'd like

Currently set to PublishCodeCoverageResults@1. Update to v2.

Build file is not cleaning up Imports file after build completed

Expected Behavior

After module build is completed the BuildTask should cleanup leftover artifacts.

Current Behavior

Once module build is complete the Imports.ps1 is left behind despite having been merged into the psm1.

Possible Solution

Add a step in the cleanup process to remove the Imports.ps1 file.

Steps to Reproduce

  1. Create a new project
  2. Build project
  3. Check artifacts folder - Imports.ps1 remains.

Casing issue related to folder Editor which causes undesired behavior on certain OS's

@dganev-cb filed PR #58 highlight an issue with the Paths regarding the case of the folder Editor

Expected Behavior

Catesta should operate as expected on all supported OS's.

Current Behavior

Incorrect casing seems to be causing an issue on a Linux based OS when running Catesta.

Possible Solution

Correct casing related to Editor.
Potentially explore other casing issues as well.

Steps to Reproduce

See screenshot in #58

Context (Environment)

Unknown. @dganev-cb can you prove your environment details?

  • Operating System and version as reported by $PSVersionTable.OS:
  • PowerShell versions as reported by $PSVersionTable.PSEdition:

Detailed Description

Explore casing issues that may be causing an issue with Catesta on Linux based operating systems. Test on a variety of Linux based hosts and correct the Editor casing as well as explore other potential casing issues.

CreateMarkdownHelp step in build process failing in PowerShell 7.4.0+

Expected Behavior

During build process CreateMarkdownHelp step should be able to successfully create markdown and external help from inline help.

Current Behavior

Checking for missing documentation in md files...
The documentation that got generated resulted in missing sections which should be filled out.
Please review the following sections in your comment based help, fill out missing information and rerun this build:
(Note: This can happen if the .EXTERNALHELP CBH is defined for a function before running this build.)    
Path of files with issues: D:\Code\Git\path\moduleName\src\Artifacts\docs\


Filename                     LineNumber Line
--------                     ---------- ----
Get-Function1.md              189 {{Fill ProgressAction Description}}
Get-Function2.md              143 {{Fill ProgressAction Description}}
Get-Function3.md              146 {{Fill ProgressAction Description}}

ERROR: Missing documentation. Please review and rebuild.
At D:\Code\Git\path\moduleName\src\moduleName.build.ps1:405 char:9
+         throw 'Missing documentation. Please review and rebuild.'
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At D:\Code\Git\path\moduleName\src\moduleName.build.ps1:349 char:1
+ Add-BuildTask CreateMarkdownHelp -After CreateHelpStart {

Generated Markdown file contains the following:

### -ProgressAction
{{Fill ProgressAction Description}}

Possible Solution

This looks to be related to a breaking change introduced in PowerShell 7.4.0.:

Added the ProgressAction parameter to the Common Parameters

Steps to Reproduce

  1. Take a sample module
  2. Initiate build with CreateMarkdownHelp option

Context (Environment)

  • Operating System and version as reported by $PSVersionTable.OS: Microsoft Windows 10.0.22000
  • PowerShell versions as reported by $PSVersionTable.PSEdition: Core
Name                           Value
----                           -----
PSVersion                      7.4.1
PSEdition                      Core
GitCommitId                    7.4.1
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Detailed Description

Unable to run builds that support help creation at this time.

Evaluate latest version of platyPS for help creation

Description

An overhauled version of platyPS is now available. Evaluate this new version and determine if it resolves some of the help creation issues previosly faced allowing for an upgrade off version 0.12.0

Describe the solution you'd like

Evaluate new capabilities of platyPS redesign and see if it meets the needs for Catesta help generation.

Additional context

Catesta has been locked to version 0.12.0 because of a text replacement issue during build:
PowerShell/platyPS#457

Improve ExportedFunctions check

Description

As mentioned in #33 - Catesta does not always correctly identify missing example using count.

This can be improved by switching to a null check on the example content.

Describe the solution you'd like

Adjust all ExportedFunctions.Tests.ps1 references to switch from count to content check

Bitbucket support

Description

Add support for BitBucket to Catesta

Describe the solution you'd like

Catesta can scaffold modules that are stored in BitBucket repos and support BitBucket pipelines

Add module dependency support

Description

As part of getting started with Catesta, I had to dig through the code base to find where to import the module dependencies for my PowerShell module. I found the actions_bootstrap.ps1 file, and determined that I needed to add my module imports there.

For additional context, I was not able to initially start using Catesta until I added my module imports to the actions_bootstrap.ps1 script, as my tests were failing due to missing module dependencies.

I noticed a note in the build.ps1 script about dependency installation not being included, but was not able to find further documentation on that comment.

See this failed action for an example of the error I ran into, and this commit for how I resolved this issue.

Describe the solution you'd like

Ideally, during setup, Catesta would have an additional prompt that asks you which modules you would like to install as dependencies. This should add the required modules to the module manifest and the appropriate workflow script.

Describe any alternatives you've considered

Alternatively, update/add documentation on how to avoid this issue for users getting started with Catesta.

Additional context

Example broken action run: https://github.com/TsekNet/TsekProfile/runs/1078982174?check_suite_focus=true
Fixed issue in my repo: TsekNet/TsekProfile@2257337

psm1 not being merged correctly in some scenarios with 5.1

PowerShell 5.1 is not honoring the Filter for merging files into the psm1 in some scenarios during the build phase. When files that share a ps1 extension like a .ps1xml are being included

Expected Behavior

.ps1xml files should not be merged into the final module during build phase.

Current Behavior

When a ps1xml file is placed in the root of the build currently (common practice) PowerShell 5.1 includes it in the .ps1 filter and adds it to the final psm1 file.

Possible Solution

$powerShellScripts = Get-ChildItem -Path $script:ArtifactsPath -Filter '*.ps1' -Recurse
# to
$powerShellScripts = Get-ChildItem -Path $script:ArtifactsPath -Recurse | Where-Object {$_.Name -match '^*.ps1$'}

Steps to Reproduce

  1. Create a new project
  2. Add a .ps1xml file
  3. Build the project and example the built .psm1 in the artifacts folder

Detailed Description

This does not occur in higher versions of PowerShell

On certain Linux distro an error is occuring stating file not found

Expected Behavior

New project scaffold should work

Current Behavior

/local/home/user/workspaces/moduleName/src/moduleName> New-PowerShellProject -CICDChoice 'ModuleOnly' -DestinationPath .

Scaffolding your PowerShell Module for GitHub Actions...
   Create docs/
   Create media/
   Create src/
   Create src\Archive/
   Create src\Artifacts/
   Create src\Tests/
   Create src\Tests\Infrastructure/
   Create src\Tests\Unit/
   Create src\moduleName/
   Create src\moduleName\Public/
   Create src\moduleName\Private/
   Create src/Tests/Unit/moduleName-Module.Tests.ps1
   Create src/Tests/Unit/ExportedFunctions.Tests.ps1
   Create src/Tests/Unit/moduleName-Function.Tests.ps1
New-PowerShellProject: Cannot find path '/home/user/.local/share/powershell/Modules/Catesta/0.10.2/Resources/Vanilla/../Module/src/Tests/Infrastructure/SampleInfraTest.Tests.ps1' because it does not exist.
Success
-------
  False

Context (Environment)

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     0.10.2                Catesta                             Desk      {New-PowerShellProject, New-VaultProjec…

Support namespaced module

Description

Catesta does not support a namespaced module name (ex. MyModule.Utils)

Describe the solution you'd like

Simply support module names with a dot/period.

Describe any alternatives you've considered

Additional context

At a glance, it seems a simple change to Module.build.ps1 $ModuleName parsing will address this.

From
$ModuleName = (Split-Path -Path $BuildFile -Leaf).Split('.')[0]
and $script:ModuleName = (Split-Path -Path $BuildFile -Leaf).Split('.')[0]

To
$ModuleName = ((Get-Item $BuildFile).BaseName) -replace ".build$"
and $script:ModuleName = ((Get-Item $BuildFile).BaseName) -replace ".build$"

Vanilla module and Vanilla vault do not include support for PlatyPS external help generation

Description

The vanilla module and vanilla vault never prompt the user if they want to replace comment based help with auto-generated external help

Describe the solution you'd like

<parameter name='Help' type='choice' default='0' store='text' prompt='Would you like to use platyPS to generate help documentation files for your project?'>
      <choice label='&amp;Yes' help="platyPS will generate MarkDown help and external xml help" value="Yes"/>
      <choice label='&amp;No' help="No help files will be generated." value="No"/>
</parameter>

CreateMarkdownHelp fails if module is not imported

The CreateMarkdownHelp task fails (technically platyPS fails) when trying to generate Markdown help if the module being tested is not already installed locally.

I'll leave it up to you whether this is a critical issue or not, but this was a blocker for me getting started using Catesta. Not importing the module as to not interfere with local modules may be WAI, but I did not see this in the FAQ/documentation. PowerShell module scopes may help resolve this.

Expected Behavior

platyPS generates the markdown docs without issue. This requires (at least in its current implementation) that the module is first installed.

Current Behavior

The module build fails with the error below:

Task /./CreateHelpStart/CreateMarkdownHelp : Build markdown help files for module and fail if help information is missing
At D:\projects\testmodule\testmodule\src\test.build.ps1:276
Manifest File: D:\projects\testmodule\testmodule\src\test\test.psd1
Manifest Version: 0.1.0
           Generating markdown files...
ERROR: Module test is not imported in the session. Run 'Import-Module test'.
At C:\Program Files\WindowsPowerShell\Modules\platyPS\0.12.0\platyPS.psm1:261 char:25
+ ...             throw "Module $_ is not imported in the session. Run 'Imp ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At D:\projects\testmodule\testmodule\src\test.build.ps1:276 char:1
+ Add-BuildTask CreateMarkdownHelp -After CreateHelpStart {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At D:\projects\testmodule\testmodule\src\test.build.ps1:267 char:1
+ Add-BuildTask CreateHelpStart {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At D:\projects\testmodule\testmodule\src\test.build.ps1:41 char:1
+ Add-BuildTask -Name . -Jobs $str
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build FAILED. 8 tasks, 1 errors, 0 warnings 00:00:03.0509986
Module test is not imported in the session. Run 'Import-Module test'.
At C:\Program Files\WindowsPowerShell\Modules\platyPS\0.12.0\platyPS.psm1:261 char:25
+ ...             throw "Module $_ is not imported in the session. Run 'Imp ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Module test is ...t-Module test'.:String) [], RuntimeException
    + FullyQualifiedErrorId : Module test is not imported in the session. Run 'Import-Module test'.

Possible Solution

Add the following to the CreateHelpStart task, you'll likely want to use -Force here as to reinstall the module that was just built.

Write-Build Gray "           Importing $ModuleName v$ModuleVersion ..."
Import-Module -Name $script:ModuleManifestFile -Global -Force -PassThru -ErrorAction Stop
Write-Build Gray "           ...$ModuleName imported successfully."

You may also want to add removing this module at the beginning of every run's cleanup.

Steps to Reproduce

  1. Install Catesta
  2. Execute Invoke-Build from the src directory
  3. The build should fail with the error described above

Context (Environment)

  • Operating System and version as reported by $PSVersionTable.OS:
  • PowerShell versions as reported by $PSVersionTable.PSEdition:

OS: win10-2004 ($PSVersionTable.OS does not exist on PowerShell 5.1)

 $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.1
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Detailed Description

AWS buildspec_pwsh_windows.yml not referencing PS7

Expected Behavior

Buildspec file should download, install, and run PS7

Current Behavior

Incorrectly references PS6 path:

- powershell -command '.\configure_aws_credential.ps1'
- aws s3 cp s3://bucket/PowerShell-7.0.0-win-x64.msi PowerShell-7.0.0-win-x64.msi --quiet
- powershell -command "Start-Process $env:CODEBUILD_SRC_DIR\PowerShell-7.0.0-win-x64.msi -ArgumentList '/qn /norestart' -Wait" - '& "C:\Program Files\PowerShell\6\pwsh.exe" -command ''.\install_modules.ps1'''

Possible Solution

Change to reference PS7 path

Steps to Reproduce

  1. Build a new PowerShell project
  2. Select AWS CI/CD with windows pwsh
  3. Push though CodeBuild

install_modules script has path bug for AWS CI/CD

Expected Behavior

Specified modules should download to the temp directory of the build container when an S3 bucket is specified as a source.

Current Behavior

When S3 bucket is specified as source build container fails to download modules.

Possible Solution

$tempPath is currently incorrectly commented out in install_modules.ps1

Steps to Reproduce

  1. Create a new AWS CI/CD project
  2. Upload CFN
  3. Build project
  4. View module install failure in project logs

Add template example for GitHub SECURITY.md file

Description

GitHub now supports adding a SECURITY.md file to a repo for giving people instructions for reporting security vulnerabilities in a project.

Catesta could include a template example of this file for scaffolding GitHub based projects.

Describe the solution you'd like

Add a SECURITY.md file for GitHub project templates: Adding a security policy to your repository

Describe any alternatives you've considered

N/A

Additional context

N/A

Additional features & options for build and pipeline processes.

Description

Extending the scaffolding to offer some additional convenience features in the build would be nice.

Any additional features would presumably exist as additional items in the module generation schema and thus would be presented as opt-in choices during module generation.

Describe the solution you'd like

  • Additional opt-in build features: including more options to support commonly implemented tasks, such as automating the substitution of public functions into FunctionsToExport during the build process, would be useful.
  • Build/pipeline versioning: a mechanism to trigger versioning increments during builds and or pipelines would be nice. I appreciate that maybe this is a little too specialized/opinionated to be included in this project, so keen to hear your thoughts here.

Describe any alternatives you've considered

I guess the obvious alternative is to inject your own build and pipeline files after generation, or to fork the project to customize things in the first place. Personally I'd rather minimize making my own private changes when I feel that they are probably changes that many others can benefit from -- I feel it undermines the spirit of sharing and open source a little.

Additional context

Kudos on a cool project! Appreciate the efforts you've put into it.

Leverage Update-Markdownhelp when generating docs

Description

This is more of a nit FR, but it would be performant to leverage the platyPS Update-MarkdownHelp function over the New-MarkdownHelp function when generating documentation.

Update-MarkdownHelp doc: https://github.com/PowerShell/platyPS/blob/master/docs/Update-MarkdownHelp.md
New-MarkdownHelp doc: https://github.com/PowerShell/platyPS/blob/master/docs/New-MarkdownHelp.md

Describe the solution you'd like

If the doc already exists for a given function, leverage Update-MarkdownHelp function over the New-MarkdownHelp function. This can be done with a PowerShell foreach loop and nested conditional.

Describe any alternatives you've considered

New-Markdownhelp technically works, but it seems unnecessary to generate entirely new documentation files every time this module is built, especially if the function(s) have not been updated.

Additional context

See platyPS module documentation here: https://github.com/PowerShell/platyPS

Write docs outside of artifacts directory

Description

While generating docs, it looks like Catesta only writes documentation generated by platyPS to the artifacts folder. I'm not sure if this is WAI, but it would be useful to generate docs in the root directory (I'll leave the actual location up to you). Having docs in the root directory would make them more discoverable when someone is browsing a git repo, as they're immediately visible. Currently, docs are not automatically written to any directory that's uploaded to GitHub.

Describe the solution you'd like

When the CreateMarkdownHelp task executes, docs are written to the root directory (alongside src, media, .vscode, etc.). Whether they also need to live in the artifacts dir, I'll leave up to you.

Describe any alternatives you've considered

A scripted copy of the docs generated and written to the artifacts directory would be possible, to avoid unnecessary calls to platyPS and ensure the docs are always the same between the two directories.

Additional context

I've manually copied the docs for now, but I'd like to hear your thoughts on how to address this.

Improve throw messaging in actions_bootstrap.ps1

Description

As mentioned in #25 the throw message doesn't provided all the needed context of the error. A simple throw does.

Describe the solution you'd like

Change actions_bootstrap.ps1 in all referenced locations from throw $message to throw

Assert-MockCalled being deprecated in Pester 5

Description

Assert-MockCalled is being deprecated in Pester 5:

THIS COMMAND IS OBSOLETE AND WILL BE REMOVED SOMEWHERE DURING v5 LIFETIME, USE Should -Invoke INSTEAD.

Describe the solution you'd like

Remove use of Assert-MockCalled in all Pester 5 use cases throughout Catesta code base

Remove Export-ModuleMember from Catesta.psm1

Expected Behavior

Catesta already exports module members via the module manifest, there is no need to add Export-ModuleMember to the module as well. By default, creating a new module will fail due to the PSScriptAnalyzer rule that does not allow for wildcard exports in the module manifest, so this field must be modified for all modules to build successfully.

Current Behavior

Catesta executes Export-ModuleMember -Function $public.Basename as part of every time the module is imported (link).

Possible Solution

Remove Export-ModuleMember from the module itself, and leave this to the manifest. I will submit a PR for this.

Steps to Reproduce

  1. Build any module

Context (Environment)

  • Operating System and version as reported by $PSVersionTable.OS:
  • PowerShell versions as reported by $PSVersionTable.PSEdition:

Detailed Description

I'll note that this is not a high priority issue, this technically works, just the effort is duplicated. For context, this suggestion was taken from this Reddit post.

Old Pester syntax is used for should in module tests

Expected Behavior

All Pester tests should use the new syntax with dashes

Cannot retrieve the dynamic parameters for the cmdlet. Legacy Should syntax (without dashes) is not supported in Pester 5. Please refer to migration guide at: https://pester.dev/docs/migrations/v3-to-v4

Current Behavior

Dashes are not used in several of the pester tests scaffolds

Possible Solution

All Pester tests, regardless of Pester 4 or 5 should use the new syntax

Scaffold new project - .gitignore file missing?

Dump of actions/choices leading to error:

❯ New-PowerShellProject -CICDChoice 'GitHubActions' -DestinationPath .\AvroTools
  ____  _           _
 |  _ \| | __ _ ___| |_ ___ _ __
 | |_) | |/ _` / __| __/ _ \ '__|
 |  __/| | (_| \__ \ ||  __/ |
 |_|   |_|\__,_|___/\__\___|_|
                                            v1.1.3
==================================================
Enter the name of the module: Avro
Enter a description for the module: Import Avro format files in PowerShell.
Enter the version number of the module (0.0.1): 1.0.0
Enter your full name (Oisin Grehan):
Would you like to generate a Changelog file?
[C] Changelog  [N] None  [?] Help (default is "C"):
Would you like to generate helpful repository files? (issue/pullrequest/feature)
[G] GitHub  [N] None  [?] Help (default is "G"):
Select a License for your module. (Help deciding: https://choosealicense.com/)
[M] MIT  [A] Apache  [G] GNU  [I] ISC  [N] None  [?] Help (default is "M"): a
Would you like to generate a Code of Conduct file?
[C] conduct  [N] None  [?] Help (default is "C"): n
Would you like to generate a Contributing guidelines file?
[C] Contribute  [N] None  [?] Help (default is "C"): n
Would you like to specify a coding style for the project?
[S] Stroustrup  [O] OTBS  [A] Allman  [N] None  [?] Help (default is "S"):
Would you like to use platyPS to generate help documentation files for your project?
[Y] Yes  [N] No  [?] Help (default is "Y"): n
Select desired workflow action options? (If your module is cross-platform you should select multiple)
[W] Windows - PowerShell
[C] Core (Windows)- pwsh
[L] Linux
[M] MacOS
[?] Help
(default is "W")
Choice[0]: C
Choice[1]:

Scaffolding your PowerShell Module for GitHub Actions...

   Create docs\
   Create media\
   Create src\
   Create src\Archive\
   Create src\Artifacts\
   Create src\Tests\
   Create src\Tests\Infrastructure\
   Create src\Tests\Unit\
   Create src\Avro\
   Create src\Avro\Public\
   Create src\Avro\Private\
   Create .vscode\tasks.json
   Create .vscode\extensions.json
   Create .vscode\settings.json
   Create src\Tests\Unit\Avro-Module.Tests.ps1
   Create src\Tests\Unit\ExportedFunctions.Tests.ps1
   Create src\Tests\Unit\Avro-Function.Tests.ps1
   Create src\Tests\Infrastructure\SampleInfraTest.Tests.ps1
   Create src\Avro\Public\Get-HelloWorld.ps1
   Create src\Avro\Private\Get-PrivateHelloWorld.ps1
   Create src\Avro.build.ps1
   Create src\Avro.Settings.ps1
   Create src\PSScriptAnalyzerSettings.psd1
   Create actions_bootstrap.ps1
   Create .gitignore
New-PowerShellProject: Cannot find path 'C:\Users\OisinGrehan\Documents\PowerShell\Modules\Catesta\0.10.0\Resources\GitHubActions\..\GitHubFiles\.gitignore' because it does not exist.

VSCode question prompt not present in all templates

Description

Presently, only the Vanilla module template prompts the user for a VSCode files choice:

<parameter name='VSCode' type='choice' default='0' store='text' prompt='Would you like to add helpful VSCode files for your project?'>
    <choice label='&amp;Yes' help="VSCode files will be added to make editing in VSCode easier." value="Yes"/>
    <choice label='&amp;No' help="VSCode files will not be added." value="No"/>
</parameter>

The rest of the templates just add the files natively.

Describe the solution you'd like

Given the following:

  • The VSCode files are quite useful
  • The VSCode files can simply be deleted if not using VSCode
  • Most users are using VSCode
  • The majority of templates have included them by default since day 1 release of Catesta

I'm opting to just remove the singular prompt on the vanilla module template.
The default behavior moving forward will be that the VSCode files will be included during module creation.

Describe any alternatives you've considered

The alternative would be to prompt the user to decide for VSCode files each time.

Build task fails if docs folder does not exist already

Expected Behavior

When the Build task is run, it should not fail if the docs folder has not been created.

Current Behavior

Build task fails if the docs folder has not been created by the CreateHelp tasks workflow

Possible Solution

Add if and Test-Path logic to check if the docs folder exists, and only perform a Move-Item if it does.

Steps to Reproduce

  1. New Catesta module project
  2. Run the Clean and Build tasks without first running help generation

Context (Environment)

Name                           Value
----                           -----
PSVersion                      7.2.9
PSEdition                      Core
GitCommitId                    7.2.9
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

AWS install_modules does not load $moduleInstallPath

Expected Behavior

When as S3 bucket is provided for AWS install_modules the $moduleInstallPath should be set for them to be installed to the correct location within the CodeBuild container.

Current Behavior

The $moduleInstallPath is not set.

Possible Solution

if ($PSVersionTable.Platform -eq 'Win32NT') {
    $moduleInstallPath = [System.IO.Path]::Combine($env:ProgramFiles, 'WindowsPowerShell', 'Modules')
    if ($PSEdition -eq 'Core') {
        $moduleInstallPath = [System.IO.Path]::Combine($env:ProgramFiles, 'PowerShell', 'Modules')
    }
    else {
        $moduleInstallPath = [System.IO.Path]::Combine($env:ProgramFiles, 'WindowsPowerShell', 'Modules')
    }
}
elseif ($PSVersionTable.Platform -eq 'Unix') {
    $moduleInstallPath = [System.IO.Path]::Combine('/', 'usr', 'local', 'share', 'powershell', 'Modules')
}
elseif ($PSEdition -eq 'Desktop') {
    $moduleInstallPath = [System.IO.Path]::Combine($env:ProgramFiles, 'WindowsPowerShell', 'Modules')
}
else {
    throw 'Unrecognized OS platform'
}

Steps to Reproduce

  1. Build a new PowerShell project
  2. Select AWS CI/CD
  3. Provide S3 bucket name
  4. Push through AWS CodeBuild

Improve output of missing help

Description

As mentioned in #25 - When Catesta detects missing comment-based help, it outputs the Matches property.

This can be improved by adding the LineNumber and Line propert to all build template references.

Describe the solution you'd like

Adjust output of all *.build.ps1 references to include this change.

Move infra tests to post build

Description

Infra tests should run post build.

Describe the solution you'd like

Adjust InvokeBuild template to run infra tests after build is completed and reference the built module.

Additional context

Discussed in #3

AWS CodeBuild S3 bucket name not being replaced properly

Expected Behavior

When creating a new AWS based project and an S3 bucket is specified for module download - the bucket name should be replaced in install_modules.ps1

Current Behavior

Deployment of file still results in just the variable name:

BucketName    = $PLASTER_PARAM_S3Bucket

Possible Solution

Correct the variable reference

Steps to Reproduce

  1. Deploy new AWS based project
  2. Specify a S3 bucket name to download modules

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.