This is most likely going to be a very simple fix but its something I am trying to get my head around when it comes to the select
keyword. How do I simply return the value 'On' from the below script:
$bitlockerStatus = Invoke-Command -ComputerName $computer {Get-BitLockerVolume | select ProtectionStatus -First 1}
$bitlockerStatus
It returns:
ProtectionStatus PSComputerName RunspaceId
---------------- -------------- ----------
On MKC-06981 *confidential*
I have used the select
statement before to return the value but I cant understand why in this case it isn't working. I need it to return 'on' or 'off' so I can use it in a String comparison.
Thanks