Sorry this is old but as came up in my search for state outputs
$x=(Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol).State
Or
$x=Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol | Select -ExpandProperty State
Or
If you want multiple selections
$x = Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
$x.State
$x.RestartRequired
If you wanted to return more functions
I like to use two possible ways when checking what a variable holds
$x | GM
$x | Select *
Both outputs will show information on what the variable holds.
hth