I have created the PowerShell script for list creation. Also added the custom column into the list .if I run this script through PowerShell command it automatically returns the column name when created the columns.

for adding content type code returns huge line of output lines in Powershell window. Added the script is :

$ctToAdd = $spWeb.ContentTypes["Link"]

how to restrict the output lines when adding content type code ? please suggest an idea restrict the huge lines in the output.

  • 1
    [void]$list.ContentTypes.Add($ctToAdd) – Bunzab Nov 5 '16 at 20:43
  • 1
    or pipe it to an Out-Null, $list.ContentTypes.Add($ctToAdd) | Out-Null – Eric Alexander Nov 5 '16 at 22:17
  • This helps to hide all the outputs. I need to remove only the particular output from "$list.ContentTypes.Add($ctToAdd)" execution . – PGP Nov 6 '16 at 6:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.