I've been grabbing my hair on this one (not much left).
I'm trying get the last characters on a powershell output.
Here's my basic code as example
$VLCVersion = winget search --exact VideoLAN.VLC --source winget
Foreach($line in $VLCVersion){ If($line -like “VLC”) { Write-host $line} }
$line
Example:
- winget search --exact VideoLAN.VLC --source winget
Result: It gives me the following result
Name Id Version VLC media player VideoLAN.VLC 3.0.17.4
I remove all the lines except the one related to 'VLC' to get to this
VLC media player VideoLAN.VLC 3.0.17.4
How do I get the version number in it's own string
I only want 3.0.17.4 to show.