Skip to content

Instantly share code, notes, and snippets.

@pjmagee
Created April 17, 2024 19:15
Show Gist options
  • Save pjmagee/3bf2ac18f67eedb39d199eea7be0ddd5 to your computer and use it in GitHub Desktop.
Save pjmagee/3bf2ac18f67eedb39d199eea7be0ddd5 to your computer and use it in GitHub Desktop.
function Open-Exercise {
param(
[Parameter(ValueFromPipeline = $true, Mandatory = $false)]
[string]$outputFromCommand
)
Process {
$goLandPath = "goland"
Write-Host $outputFromCommand
$path = $outputFromCommand -split "`n" | Select-Object -Last 1
$path = $path.Replace("Downloaded to", "").Trim()
& $goLandPath "$path"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment