Created
December 16, 2024 15:53
-
-
Save Rugby-Ball/16194b9924e11fa4395d461b3d59cbcc to your computer and use it in GitHub Desktop.
Used to get Fabric AI Version from Github. You can use in your PowerShell $Profile #Utility #PowerShell #Fabric #AI #Public
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
| #Used to get Fabric AI Version from Github. You can use in your PowerShell $Profile | |
| Function fabricv { | |
| # Clear the console screen | |
| Clear-Host | |
| # Define the repository details | |
| $owner = "danielmiessler" | |
| $repository = "fabric" | |
| # Construct the API URL for the latest release | |
| $apiUrl = "https://api.github.com/repos/$owner/$repository/releases/latest" | |
| # Send a GET request to the API with appropriate headers | |
| $response = Invoke-WebRequest -Uri $apiUrl -Headers @{ "Accept" = "application/vnd.github.v3+json" } | |
| # Parse the JSON response | |
| $jsonResponse = $response.Content | ConvertFrom-Json | |
| # Get the latest version installed | |
| $installedversion = & fabric --version | |
| # Extract the latest version and release date | |
| $latestVersion = $jsonResponse.tag_name | |
| $releaseDate = $jsonResponse.published_at | |
| # Display the results | |
| Write-Host "Installed Version: $InstalledVersion" | |
| Write-Host "Latest Version: $latestVersion" | |
| Write-Host "Release Date: $releaseDate" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment