Home > Blockchain >  Read installed Ubuntu version in Powershell script
Read installed Ubuntu version in Powershell script

Time:01-12

how can I get the installed Ubuntu version in a PowerShell script like this command "lsb_release -d" do?

CodePudding user response:

Have a try if this works for you:

$output = lsb_release -d
$version = $output -replace 'Description:',''
$version = $version.Trim()
Write-Output "The installed version of Ubuntu is: $version"
  • Related