Skip to content

Instantly share code, notes, and snippets.

@arash-bizcover
arash-bizcover / versions.ps1
Created October 18, 2022 02:37
asp-versions
# Get the text from github
$url = "https://raw.githubusercontent.com/dotnet/docs/master/docs/framework/migration-guide/how-to-determine-which-versions-are-installed.md"
$md = Invoke-WebRequest $url -UseBasicParsing
$OFS = "`n"
# Replace the weird text in the tables, and the padding
# Then trim the | off the front and end of lines
$map = $md -split "`n" -replace " installed [^|]+" -replace "\s+\|" -replace "\|$" |
# Then we can build the table by looking for unique lines that start with ".NET Framework"
Select-String "^.NET" | Select-Object -Unique |
# And flip it so it's key = value
[
{
"text": "*Use this button for deployment of one microservice.*",
"fallback": "Upgrade your Slack client to use messages like these.",
"attachment_type": "default",
"callback_id": "modal",
"color": "#32CD32",
"actions": [
{
"name": "single-deployment",