Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    Limit Debug info logging from Powershell scritpts

    Scheduled Pinned Locked Moved Support
    buildmasterpowershell
    6 Posts 2 Posters 27 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jstarbird_7831
      last edited by

      When running any Powershell scripts where an Import of a module occurs the BuildMaster execution will output the entire loading of each cmdlet from the import step.
      I'm wondering if there is someway to suppress this at the script level and if not there then a way to do so globally?
      At times this can add thousands of lines to the logs and unless you are debugging the import it's useless data.
      I know you can un-check the Debug option when viewing the log but that turns it off for everything. I just want to make it so the Powershell scripts do not log this extra data at least not unless I need it to.

      Product: BuildMaster
      Version: 6.1.1

      1 Reply Last reply Reply Quote 0
      • jjonesJ Offline
        jjones inedo-engineer
        last edited by

        Was the -verbose attribute specified in the script? I don't know of any way to suppress this off-hand, perhaps you can try -Verbose:$false or pipe to Out-Null

        1 Reply Last reply Reply Quote 0
        • J Offline
          jstarbird_7831
          last edited by

          No, i'm not using the -verbose flag and I did try:
          import-module modulename 1>$null which does work outside BuildMaster.
          I did not try piping to Out-Null so I'll try that.
          I'll also try the -verbose:$false even though I'm not implicitly calling it.

          1 Reply Last reply Reply Quote 0
          • jjonesJ Offline
            jjones inedo-engineer
            last edited by

            Jon,

            Did using the Out-Null help to limit the logging?

            1 Reply Last reply Reply Quote 0
            • J Offline
              jstarbird_7831
              last edited by

              No, neither method works, -verbose:$false nor Out-Null.
              It does seem to work with some commands but import-module specifically it does not.

              1 Reply Last reply Reply Quote 0
              • jjonesJ Offline
                jjones inedo-engineer
                last edited by

                Jon,

                I haven't found too much on this besides what we already recommended. I did find this option specifically for Import-module : https://stackoverflow.com/a/28512164

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post
                Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation