Need some assistance

Welcome Forums General PowerShell Q&A Need some assistance

This topic contains 4 replies, has 4 voices, and was last updated by

5 years, 9 months ago.

  • Author
  • #4775

    Points: 0
    Rank: Member

    I have a powershell script that installs the IIS features the application I am using needs. the script is very basic and works great except I need it to log the features that were installed or removed. The log I am generating is getting cut off and I have not been able to figure out how to format it so this does not happen.

    I am just running the add-windowsfeature cmdlet and piping the results to format-list then out to a text file. This causes the feature result line to get cut off. Seems pretty basic any help?


  • #4779

    Points: 0
    Rank: Member

    Format-List is what's doing the truncating; try removing that from your script and see what you get. If you need format-list to get entries that aren't returned by default, try replacing it with "Select-Object *".

  • #4811

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    You can also try adding -Wrap to Format-Table.

  • #4816

    Points: 0
    Rank: Member

    Thanks for the replies I have tried both and still do not have the results I am looking for.

    Here are the commands I am running I removed the format-list as suggested.


    Import-Module servermanager
    Add-Windowsfeature Web-Server,web-webserver,web-common-http,web-default-doc,web-static-content,web-health,web-http-logging,web-request-monitor,web-http-tracing,web-stat-compression,web-net-ext,web-net-ext45,web-asp-net,web-asp-net45,web-mgmt-tools,web-mgmt-console,web-mgmt-compat,web-metabase,web-lgcy-mgmt-console,web-lgcy-scripting,web-wmi,web-scripting-tools,web-mgmt-service | write-output > c:\rs_ps\LT_IIS_Features_Installed_Log.txt



    This is the output I get ....

    Success Restart Needed Exit Code Feature Result
    ——- ————– ——— ————–
    True No Success {Application Development, ASP.NET 3.5, ASP...


    As suggested I tried the -wrap but had to use format-table instead this outputs a bit more but not all of them. I tried both -auto -wrap and just -wrap

    Import-Module servermanager
    Add-Windowsfeature Web-Server,web-webserver,web-common-http,web-default-doc,web-static-content,web-health,web-http-logging,web-request-monitor,web-http-tracing,web-stat-compression,web-net-ext,web-net-ext45,web-asp-net,web-asp-net45,web-mgmt-tools,web-mgmt-console,web-mgmt-compat,web-metabase,web-lgcy-mgmt-console,web-lgcy-scripting,web-wmi,web-scripting-tools,web-mgmt-service | Ft * -auto -wrap | write-output > c:\rs_ps\LT_IIS_Features_Installed_Log.txt



    This is the output I get....

    Success RestartNeeded FeatureResult
    ——- ————- ————-
    True Yes {Application Development, ASP.NET 3.5, ASP.NET 4.5, Common
    HTTP Features...}


    Overall it is just not a big deal I can live without the full list it would just be nice to know how to do this in case I need to in the future.


    thanks again

  • #4832

    Points: 1
    Rank: Member

    This blog post will show you how to get the format you need:

The topic ‘Need some assistance’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort