Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Rugby-Ball/16194b9924e11fa4395d461b3d59cbcc to your computer and use it in GitHub Desktop.

Select an option

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
#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