This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Get a GitHub user's BlueSky | |
| .DESCRIPTION | |
| Gets an At Protocol Handle / BlueSky profile link for a GitHub user | |
| .EXAMPLE | |
| ./GitHubBlueSky StartAutomating | |
| #> | |
| param([string]$UserName) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .Synopsis | |
| How Old Is PowerShell? | |
| .Description | |
| How Old Is PowerShell? | |
| .Example | |
| ./HowOldIsPowerShell | |
| #> | |
| [Math]::Round( | |
| ([DateTime]::Now - [DateTime]"11/14/2006").TotalDays / 365, 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Get common mime types | |
| .DESCRIPTION | |
| Gets the common mime types according to MDN | |
| .LINK | |
| https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types/Common_types | |
| #> | |
| if (-not $script:CommonMimeTypes) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function DocRatio { | |
| <# | |
| .SYNOPSIS | |
| DocRatio | |
| .DESCRIPTION | |
| Gets the ratio of comments to non-comments in a script | |
| .EXAMPLE | |
| docratio docratio | |
| #> | |
| $allInputAndArgs = @($input) + $args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| filter Get-Fibonacci { | |
| <# | |
| .SYNOPSIS | |
| Gets the fibonacci sequence | |
| .DESCRIPTION | |
| Gets the fibonacci sequence or ratio sequence using a bit of function state magic. | |
| .NOTES | |
| Stores the fibonacci sequence in the function definition. | |
| By keeping state between calls, we perform a very fast iterative implementation of the fibonacci sequence. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Just get the excel function list from Microsoft support, and return only the names and links | |
| if (-not $script:ExcelFunctionList) { | |
| $excelFunctionPage = | |
| Invoke-WebRequest https://support.microsoft.com/en-us/office/excel-functions-alphabetical-b3944572-255d-4efb-bb96-c6d90033e188 | |
| $script:ExcelFunctionList = | |
| $excelFunctionPage.Links | | |
| Where-Object Href -match '-function-' | | |
| ForEach-Object { | |
| $_.OuterHTML -as [xml] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #requires -Module ugit | |
| # https://github.com/StartAutomating/ugit | |
| $changelog = Get-Content ./CHANGELOG.md -Raw | |
| $issuesNumbers = git log -CurrentBranch | Select-Object -ExpandProperty ReferenceNumbers -Unique | |
| $issuesNumbers | Where-Object { $changelog -notmatch "$_"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| filter looksLikeMarkdown { | |
| if ( | |
| # If it's got a markdown-like link | |
| $_ -match '\[[^\]]+\]\(' -or | |
| # Or any of the lines start with markdown special characters | |
| $_ -split '(?>\r\n|\n)' -match '\s{0,3}[\#*~`]' | |
| ) { | |
| # it's probably markdown | |
| $_ | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Get the SVG Elements | |
| .DESCRIPTION | |
| Get the SVG Elements, as defined by the Mozilla Developer Network | |
| .LINK | |
| https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element | |
| #> | |
| $elementRoot = "https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element" | |
| Invoke-WebRequest $elementRoot | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Small file server | |
| .DESCRIPTION | |
| A small file server to help test this website. | |
| .NOTES | |
| This will only serve get requests for existing files. | |
| This is also not anywhere near the fastest static server in existence. | |
NewerOlder