none
Remove Runspace ID object in Powershell output RRS feed

  • Question

  • Hi Team,

    I am try to get the D word value using below script.Result is coming as excepted but I am seeing  RunspaceId  object also coming in the result.is there any way to exclude RunspaceId..belwo the script

    ################################################################

    $res = {(Get-ItemProperty "hklm:System\CurrentControlSet\Services\LanManServer\Parameters" -name SMBServerNameHardeningLevel)| Select-Object PSComputerName,SMBServerNameHardeningLevel }

    Invoke-Command -ComputerName server1 -ScriptBlock $res

    Output
    smbservernamehardeninglevel PSComputerName RunspaceId                         
    --------------------------- -------------- ----------                         
                              0 server1  1df33774-1d2e-45be-b7ba-f82ad3be0241

    #################################################################

    Friday, September 8, 2017 9:19 AM

Answers

  • Your select statement must be outside of the Invoke command to filter that from the result.


    \_(ツ)_/

    Friday, September 8, 2017 9:42 AM

All replies

  • Your select statement must be outside of the Invoke command to filter that from the result.


    \_(ツ)_/

    Friday, September 8, 2017 9:42 AM
  • Its working Thanks Jrv
    Saturday, September 9, 2017 2:14 PM