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



  • 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


  • inedo-engineer

    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



  • 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.


  • inedo-engineer

    Jon,

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



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


  • inedo-engineer

    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



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation