'Powershell write-out actual matching strings instead of the whole line

I'm about to rewrite a bunch of css files. (px to rem). Therefore I've written a oneliner, that searches for numbers followed by the string"px" and writes them out to a txt-file. Yet my script "select-string -path ".\media\scss\2022-04-24-customScreen-v1.scss" -Pattern '[0-9]*px' | select line | out-file outputfile.txt -append" always gives me back the whole line (because I use select line) and I get something like "Line "
$fs-2: 14px;
$lh-1: 22px;
$mw: 1260px; ..." How do I write-out only the entry itself without the rst of its line like "14px 22px 1260px" and so on. What is the equivalent to "select line" if I do only want the entry itself?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source