All,
This is a dumb question I know but its bugging me that I cant figure out why this is happening. So I have the below line that returns the 3 columns I have selected and works as I want it to…for a local machine:
Get-BitLockerVolume | Select -Property ComputerName, VolumeStatus, ProtectionStatus | Export-Csv -Path "$env:USERPROFILE\Desktop\VolumeStatus.csv" -NoTypeInformation -Append -Force
However…when I try to run this against a list of servers in a script block, it returns my 3 fields but also adds a PSShowComputerName, RunspaceId, and PSComputerName.
Foreach ($Server in $Servers) {
$VolumeStatus = Invoke-Command -computername $Server -scriptblock { Get-BitLockerVolume | Select -Property ComputerName, VolumeStatus, ProtectionStatus | Export-Csv -Path "$env:USERPROFILE\Desktop\VolumeStatus.csv" -NoTypeInformation -Append -Force }
}
Can someone tell me what I am missing to stop it from adding those unnecessary fields?