From 9be891d064ba4f51d91f0c742af36af1b02b987b Mon Sep 17 00:00:00 2001 From: Frederik Hjorslev Poulsen Date: Sat, 4 Apr 2020 21:09:10 +0200 Subject: [PATCH 1/7] :sparkles: Add Catesta Catesta is a PowerShell module project generator. It uses templates to rapidly scaffold test and build integration for a variety of CI/CD platforms. --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 0340256..0661bc6 100644 --- a/readme.md +++ b/readme.md @@ -131,6 +131,7 @@ It includes a command-line shell and an associated scripting language. * [Plaster](https://github.com/PowerShell/Plaster) - Plaster is a template-based file and project generator written in PowerShell. * [PSModuleDevelopment](https://github.com/PowershellFrameworkCollective/PSModuleDevelopment) - Get started using module templates in 2 minutes with this module's low entry barrier and casual convenience. +* [Catesta](https://github.com/techthoughts2/Catesta) - Catesta is a PowerShell module project generator. It uses templates to rapidly scaffold test and build integration for a variety of CI/CD platforms. ## Frameworks From e868f167344d8000f247a102775b0e90febf6623 Mon Sep 17 00:00:00 2001 From: Frederik Hjorslev Poulsen Date: Sat, 4 Apr 2020 21:37:35 +0200 Subject: [PATCH 2/7] :pencil: (Cleanup): Spelling and consistency Fixed some typos and changed so e.g. PS is consistently spelled PowerShell. Furthermore, I have added spellright.dict that can be used in VS Code together with Spell Right extension. --- .vscode/spellright.dict | 32 ++++++++++++++++++++++++++++++ readme.md | 44 ++++++++++++++++++++--------------------- 2 files changed, 54 insertions(+), 22 deletions(-) create mode 100644 .vscode/spellright.dict diff --git a/.vscode/spellright.dict b/.vscode/spellright.dict new file mode 100644 index 0000000..831e44b --- /dev/null +++ b/.vscode/spellright.dict @@ -0,0 +1,32 @@ +Gists +AppVeyor +PSAppVeyor +Boe +Prox +Snover +Gotchas +psake +commandline +Commandline +readline +Zlocation +thefuck +pslinq +poco +peco +PSUtil +Autojump +PScribo +Catesta +Walz +Rottenberg +PowerSploit +enums +Nishang +Pode +Flancy +Weltner +dbatools +DbgShell +Misc +psInlineProgress diff --git a/readme.md b/readme.md index 0661bc6..ddd0fd9 100644 --- a/readme.md +++ b/readme.md @@ -35,22 +35,22 @@ It includes a command-line shell and an associated scripting language. ## API Wrapper * [HipChatAdmin](https://github.com/cofonseca/HipChatAdmin) - A module for simple integration with Atlassian HipChat via the HipChat API. -* [PSGitHub](https://github.com/pcgeek86/PSGitHub) - This PowerShell module contains commands to manage GitHub through its REST API. -* [Posh-Github](https://github.com/Iristyle/Posh-GitHub) - Powershell cmdlets that expose the GitHub API. -* [Posh-Gist](https://github.com/dfinke/Posh-Gist) - PowerShell cmdlets for interacting with GitHub Gist. -* [PSGist](https://github.com/dotps1/PSGist) - A PowerShell module to work with GitHub Gists. -* [PSAppVeyor](https://github.com/dotps1/PSAppVeyor) - A PowerShell Module to interact with the AppVeyor REST Api. -* [PSSlack](https://github.com/RamblingCookieMonster/PSSlack) - PowerShell module for simple Slack integration. +* [PSGitHub](https://github.com/pcgeek86/PSGitHub) - Module contains commands to manage GitHub through its REST API. +* [Posh-GitHub](https://github.com/Iristyle/Posh-GitHub) - Cmdlets that expose the GitHub API. +* [Posh-Gist](https://github.com/dfinke/Posh-Gist) - Cmdlets for interacting with GitHub Gist. +* [PSGist](https://github.com/dotps1/PSGist) - A module to work with GitHub Gists. +* [PSAppVeyor](https://github.com/dotps1/PSAppVeyor) - A module to interact with the AppVeyor REST API. +* [PSSlack](https://github.com/RamblingCookieMonster/PSSlack) - Module for simple Slack integration. * [ConfluencePS](https://atlassianps.org/module/ConfluencePS/) - A module for interacting with Atlassian's Confluence in powershell (by using the API). * [JiraPS](https://atlassianps.org/module/JiraPS/) - A module for interacting with Atlassian's Jira in powershell (by using the API). -* [PSTelegramAPI](https://github.com/mkellerman/PSTelegramAPI) - PowerShell Module for Telegram APIs -* [PSTeams](https://github.com/EvotecIT/PSTeams) - PowerShell module for sending formatted messages to a Microsoft Teams Channel. +* [PSTelegramAPI](https://github.com/mkellerman/PSTelegramAPI) - Module for Telegram APIs +* [PSTeams](https://github.com/EvotecIT/PSTeams) - A module for sending formatted messages to a Microsoft Teams Channel. ## Blogs * [Windows PowerShell Blog](https://blogs.msdn.microsoft.com/powershell/) - Official PowerShell Team Blog. * [Hey, Scripting Guy! Blog](http://blogs.technet.com/b/heyscriptingguy/) - Popular Microsoft blog. -* [Learn Powershell | Achieve More](http://learn-powershell.net/) - Personal blog of Boe Prox who moderated for the Scripting Guy. +* [Learn PowerShell | Achieve More](http://learn-powershell.net/) - Personal blog of Boe Prox who moderated for the Scripting Guy. * [PowerShellMagazine](http://www.powershellmagazine.com/) - Awesome magazine. * [PowerShellExplained](https://powershellexplained.com) - Personal blog of Kevin Marquette * [Doug Finke](https://dfinke.github.io/#blog) - Author of [PowerShell for Developers](http://shop.oreilly.com/product/0636920024491.do). @@ -72,7 +72,7 @@ It includes a command-line shell and an associated scripting language. * [The Big Book of PowerShell Error Handling - Dave Wyatt](https://leanpub.com/s/znHIFrvBAYRST5nFBiQU5g.pdf) - Great reference for error handling techniques. * [Secrets of PowerShell Remoting](https://leanpub.com/s/DQLESXQ69TlVFQ9ogjrFLw.pdf) - On all things remoting. Workflow, fan-out, etc. * [PowerShell Notes for Professionals](https://goalkicker.com/PowerShellBook/PowerShellNotesForProfessionals.pdf) - Compilation of notes and snippets. -* [Powershell for SysAdmins: Workflow Automation Made Easy](https://nostarch.com/powershellsysadmins) - Learn how to manage and automate your desktop and server environments. +* [PowerShell for SysAdmins: Workflow Automation Made Easy](https://nostarch.com/powershellsysadmins) - Learn how to manage and automate your desktop and server environments. ## Build Tools @@ -85,7 +85,7 @@ It includes a command-line shell and an associated scripting language. ## Code and Package Repositories * [GitHub](https://github.com/search?l=powershell&q=stars%3A%3E1&s=stars&type=Repositories) - Looking for an Open Source PowerShell project? It's probably here. -* [PowerShell Gallery](https://www.powershellgallery.com/) - Offical PowerShell package repository, used by PowerShellGet. +* [PowerShell Gallery](https://www.powershellgallery.com/) - Official PowerShell package repository, used by PowerShellGet. * [TechNet Gallery](https://gallery.technet.microsoft.com/) - Wide variety of PowerShell code from snippets to modules. ## Commandline Productivity @@ -93,14 +93,14 @@ It includes a command-line shell and an associated scripting language. * [posh-git](https://github.com/dahlbyk/posh-git) - Set of PowerShell scripts which provide Git/PowerShell integration. * [PSReadLine](https://github.com/lzybkr/PSReadLine) - Bash inspired readline implementation for PowerShell. Keeps history between sessions, adds reverse-history search and makes the commandline experience much better overall. * [TabExpansionPlusPlus](https://github.com/lzybkr/TabExpansionPlusPlus) - PowerShell module to make customizing tab completion easier and add a library of custom argument completers. -* [Jump-Location](https://github.com/tkellogg/Jump-Location) - Powershell `cd` that reads your mind. [Autojump](https://github.com/wting/autojump) implementation for powershell. +* [Jump-Location](https://github.com/tkellogg/Jump-Location) - PowerShell `cd` that reads your mind. [Autojump](https://github.com/wting/autojump) implementation for PowerShell. * [Zlocation](https://github.com/vors/ZLocation) * [z.sh](https://github.com/rupa/z) implementation for PowerShell. Similar to Jump-Location. * [thefuck](https://github.com/nvbn/thefuck) - Magnificent app which corrects your previous console command (by typing `fuck`). -* [pslinq](https://github.com/manojlds/pslinq) - LINQ (LINQ2Objects) for Powershell. +* [pslinq](https://github.com/manojlds/pslinq) - LINQ (LINQ2Objects) for PowerShell. * [posh-with](https://github.com/JanJoris/posh-with) - Command prefixing for continuous workflow using a single tool. * [poco](https://gist.github.com/yumura/8df37c22ae1b7942dec7)* [peco](https://github.com/peco/peco) implementation. Interactive filtering tool. -* [PSDirTag](https://github.com/wtjones/PSDirTag) - DirTags are relative paths that appear as variables in the Powershell prompt that update as you navigate. Saves keystrokes when navigating folder structures. -* [PSUtil](https://github.com/PowershellFrameworkCollective/PSUtil) - Designed to make the user's console life more convenient. It includes shortcuts, aliases, keybindings and convenience functions geared towards greater efficiency and less typing. +* [PSDirTag](https://github.com/wtjones/PSDirTag) - DirTags are relative paths that appear as variables in the PowerShell prompt that update as you navigate. Saves keystrokes when navigating folder structures. +* [PSUtil](https://github.com/PowershellFrameworkCollective/PSUtil) - Designed to make the user's console life more convenient. It includes shortcuts, aliases, key bindings and convenience functions geared towards greater efficiency and less typing. ## Communities @@ -136,20 +136,20 @@ It includes a command-line shell and an associated scripting language. ## Frameworks * [Carbon](http://get-carbon.org/) - DevOps for automating the configuration of Windows computers. -* [PowerShell PowerUp](https://github.com/janikvonrotz/PowerShell-PowerUp) - Powerfull server management framework. +* [PowerShell PowerUp](https://github.com/janikvonrotz/PowerShell-PowerUp) - Powerful server management framework. * [PSCX](https://github.com/Pscx/Pscx) - PowerShell Community Extensions - Useful set of additional cmdlets. * [PSFramework](https://github.com/PowershellFrameworkCollective/psframework) - Easily add configurations, logging and more to your own PowerShell module. ## Package Managers -* [PowershellGet](https://github.com/powershell/powershellget) - PowerShellGet is the Package Manager for PowerShell. Packages are available on [PowerShellGallery](https://www.PowerShellGallery.com). +* [PowerShellGet](https://github.com/powershell/powershellget) - PowerShellGet is the Package Manager for PowerShell. Packages are available on [PowerShellGallery](https://www.PowerShellGallery.com). * [PsGet](http://psget.net/) - Set of commands to install modules from central directory, local file or from the web. * [Chocolatey](https://chocolatey.org/) - The package manager for Windows. The sane way to manage software on Windows. * [GitLab](https://github.com/akamac/GitLabProvider) - Use a GitLab server as Package Provider. ## Parallel Processing -* [PoshRSJob](https://github.com/proxb/PoshRSJob) - Provides an alternative to PSjobs with greater performance and less overhead to run commands in the background. +* [PoshRSJob](https://github.com/proxb/PoshRSJob) - Provides an alternative to PSJobs with greater performance and less overhead to run commands in the background. * [Invoke-Parallel](https://github.com/RamblingCookieMonster/Invoke-Parallel) - This function will take in a script or scriptblock, and run it against specified objects(s) in parallel. ## Podcasts @@ -171,8 +171,8 @@ It includes a command-line shell and an associated scripting language. ## Testing -* [Pester](https://github.com/pester/Pester) - Powershell BDD style testing framework. -* [Format-Pester](https://github.com/equelin/format-pester) - Powershell module for documenting Pester's results - exports Pester results to HTML, Word, text files using [PScribo](https://github.com/iainbrighton/PScribo). +* [Pester](https://github.com/pester/Pester) - PowerShell BDD style testing framework. +* [Format-Pester](https://github.com/equelin/format-pester) - PowerShell module for documenting Pester's results - exports Pester results to HTML, Word, text files using [PScribo](https://github.com/iainbrighton/PScribo). ## Themes @@ -187,7 +187,7 @@ It includes a command-line shell and an associated scripting language. * [Advanced Tools & Scripting with PowerShell 3.0](https://channel9.msdn.com/Series/advpowershell3) - IT pros, take this advanced PowerShell course to find out how to turn your real time management and automation scripts into useful reusable tools and cmdlets. * [What's New in PowerShell v5](https://mva.microsoft.com/en-US/training-courses/whats-new-in-powershell-v5-16434) - Through description on some of the exciting new features in PowerShell version 5.0. * [PowerShell Open Source Project](https://channel9.msdn.com/series/PowerShell-Open-Source-Project) - Collection of videos thoroughly demonstrate how PowerShell open source project runs on Linux. -* [PowerShell on Linux and Open Source](https://channel9.msdn.com/Blogs/hybrid-it-management/PowerShell-on-Linux-and-Open-Source) - Brief introduction to PowerShell open source project and how it runs on linux. +* [PowerShell on Linux and Open Source](https://channel9.msdn.com/Blogs/hybrid-it-management/PowerShell-on-Linux-and-Open-Source) - Brief introduction to PowerShell open source project and how it runs on Linux. * [PowerShell](https://channel9.msdn.com/Shows/MsftPowerShell) - This show will include videos talking about the PowerShell automation platform, Desired State Configuration (DSC), infrastructure as code, and related concepts!! These videos are created by Trevor Sullivan, a Microsoft MVP for Windows PowerShell. * [Learn Windows PowerShell in a Month of Lunches - Don Jones](https://www.youtube.com/watch?v=6CRTahGYnws&list=PL6D474E721138865A) - Video companion to the book of the same title. * [Best Practices for Script Design - Don Jones](https://www.youtube.com/watch?v=Lni4KjGMgu4) - Don Jones discusses script design principles and best practices. @@ -220,7 +220,7 @@ It includes a command-line shell and an associated scripting language. ## Misc * [DbgShell](https://github.com/Microsoft/DbgShell) - A PowerShell front-end for the Windows debugger engine. -* [poke](https://github.com/oising/poke) - Crazy cool reflection module for powershell. +* [poke](https://github.com/oising/poke) - Crazy cool reflection module for PowerShell. Explore and invoke private APIs like nobody is watching. Useful for security research, testing and quick hacks. * [psInlineProgress](https://github.com/gravejester/psInlineProgress) - Write inline progress bars in PowerShell. From 99f3fdbe4b16ba1e089379ed3514c6e056ee77f0 Mon Sep 17 00:00:00 2001 From: Frederik Hjorslev Poulsen Date: Sat, 4 Apr 2020 22:01:33 +0200 Subject: [PATCH 3/7] :sparkles: (Dead links analyzer): Add dead links analyzer --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ DeadLinksAnalyzer.ps1 | 27 +++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 DeadLinksAnalyzer.ps1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..bf67971 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + schedule: + # * is a special character in YAML so you have to quote this string + - cron: '0 0 * * 0' + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: pester tests + shell: pwsh + run: | + ./DeadLinksAnalyzer.ps1 \ No newline at end of file diff --git a/DeadLinksAnalyzer.ps1 b/DeadLinksAnalyzer.ps1 new file mode 100644 index 0000000..9971e0b --- /dev/null +++ b/DeadLinksAnalyzer.ps1 @@ -0,0 +1,27 @@ +function Test-MarkdownLinks([String]$Path) { + $unreachable = @() + # Get markdown files recursively + $files = Get-ChildItem -Path $path -Recurse -Include "*.md" + + $files | ForEach-Object { + $fileName = $_.Name + Write-Host "Analyzing $fileName" + + $urls = Select-String -Path $_ -Pattern "\[.+\]\((http.*?)\)" | ForEach-Object { $_.matches.Groups[1] } | Select-Object + + $urls | ForEach-Object { + $url = $_.Value + Write-Host "Requesting url $url" + + try { + $request = Invoke-WebRequest -Uri $url + } catch { + Write-Error "Found dead url $url in $fileName" + $unreachable += $url + } + } + } + # Output urls + return $unreachable +} +$deadlinks = Test-MarkdownLinks -Path ".\readme.md" \ No newline at end of file From 3cfa9b3be67f39e644ec9cc31ab9b0c9637999da Mon Sep 17 00:00:00 2001 From: Frederik Hjorslev Poulsen Date: Sat, 4 Apr 2020 22:10:45 +0200 Subject: [PATCH 4/7] :bug: Dead links analyzer --- .github/workflows/ci.yml | 9 +++++---- DeadLinksAnalyzer.ps1 | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf67971..e6ad0d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,7 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: + analyze-readme: # The type of runner that the job will run on runs-on: ubuntu-latest @@ -25,7 +24,9 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - - name: pester tests + - name: Analyze Links shell: pwsh run: | - ./DeadLinksAnalyzer.ps1 \ No newline at end of file + ./DeadLinksAnalyzer.ps1 + $deadlinks = Test-MarkdownLinks -Path ".\readme.md" + continue-on-error: true \ No newline at end of file diff --git a/DeadLinksAnalyzer.ps1 b/DeadLinksAnalyzer.ps1 index 9971e0b..53c83fa 100644 --- a/DeadLinksAnalyzer.ps1 +++ b/DeadLinksAnalyzer.ps1 @@ -23,5 +23,4 @@ } # Output urls return $unreachable -} -$deadlinks = Test-MarkdownLinks -Path ".\readme.md" \ No newline at end of file +} \ No newline at end of file From 422066f863e2b70e228403aa56f205b8b443c80c Mon Sep 17 00:00:00 2001 From: Frederik Hjorslev Poulsen Date: Sat, 4 Apr 2020 22:19:26 +0200 Subject: [PATCH 5/7] :bug: Analyze dead links --- .github/workflows/ci.yml | 14 ++++++-------- DeadLinksAnalyzer.ps1 | 3 ++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6ad0d2..5217c59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,12 +21,10 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 - - name: Analyze Links - shell: pwsh - run: | - ./DeadLinksAnalyzer.ps1 - $deadlinks = Test-MarkdownLinks -Path ".\readme.md" - continue-on-error: true \ No newline at end of file + - name: Analyze Links + shell: pwsh + run: | + ./DeadLinksAnalyzer.ps1 \ No newline at end of file diff --git a/DeadLinksAnalyzer.ps1 b/DeadLinksAnalyzer.ps1 index 53c83fa..aa14654 100644 --- a/DeadLinksAnalyzer.ps1 +++ b/DeadLinksAnalyzer.ps1 @@ -16,11 +16,12 @@ try { $request = Invoke-WebRequest -Uri $url } catch { - Write-Error "Found dead url $url in $fileName" + Write-Warning -Message "Found dead url $url in $fileName" $unreachable += $url } } } # Output urls return $unreachable + Write-Error -Message 'Dead links found' } \ No newline at end of file From 686849d2529c54a560a20febdd83b7f20ce2bab7 Mon Sep 17 00:00:00 2001 From: Frederik Hjorslev Poulsen Date: Sat, 4 Apr 2020 22:21:45 +0200 Subject: [PATCH 6/7] :bug: Analyze dead links forgot to call the function... --- DeadLinksAnalyzer.ps1 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/DeadLinksAnalyzer.ps1 b/DeadLinksAnalyzer.ps1 index aa14654..5dc3048 100644 --- a/DeadLinksAnalyzer.ps1 +++ b/DeadLinksAnalyzer.ps1 @@ -21,7 +21,12 @@ } } } - # Output urls - return $unreachable - Write-Error -Message 'Dead links found' -} \ No newline at end of file + + if ($unreachable) { + # Output urls + return $unreachable + Write-Error -Message 'Dead links found' + } +} + +$deadlinks = Test-MarkdownLinks -Path ".\readme.md" \ No newline at end of file From 0935599c30c87406b5059e792690f9b206063ca7 Mon Sep 17 00:00:00 2001 From: Frederik Hjorslev Poulsen Date: Sat, 4 Apr 2020 22:46:43 +0200 Subject: [PATCH 7/7] :sparkles: Dead links analyzer --- DeadLinksAnalyzer.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DeadLinksAnalyzer.ps1 b/DeadLinksAnalyzer.ps1 index 5dc3048..ec4c08c 100644 --- a/DeadLinksAnalyzer.ps1 +++ b/DeadLinksAnalyzer.ps1 @@ -22,11 +22,11 @@ } } - if ($unreachable) { - # Output urls - return $unreachable - Write-Error -Message 'Dead links found' - } + # Output urls + return $unreachable } -$deadlinks = Test-MarkdownLinks -Path ".\readme.md" \ No newline at end of file +$deadlinks = Test-MarkdownLinks -Path ".\readme.md" +if ($deadlinks) { + Write-Error -Message 'Dead links found' -Category ObjectNotFound +} \ No newline at end of file