supress write-host on import

Dec 3, 2013 at 3:16 AM
Is there a way we can change the behaviors so on an import the instructional screen can be hidden? perhaps where i can pipe import-module to out-null or cast the import to [void] or similar.
with write-hosts there is no getting around it.

I am trying to use poshwsus inside of ruby, and each execution i need to call powershell, import, then run the cmdlet. with the instructions the output becomes a parse mess.

let me know if i can help or if this is just a trivial matter to fix.
Dec 3, 2013 at 5:59 AM
Hi, please open PoshWSUS module folder. Then edit PoshWSUS.psm1 file. You can try to comment lines from 29 to 38.

Image
Dec 3, 2013 at 3:13 PM
Edited Dec 3, 2013 at 3:14 PM
obviously - i could do that :) i wanted to have my code work on anyone's system though without having to patch source. is codeplex or github the source of truth for this project? I guess I will need to make a Pull Request. I'd like to perhaps switch this from write-host.
Dec 3, 2013 at 6:18 PM
This module based on wsus api and dotNet, so output is object. Why u use ruby?

P. S. I don't know how to help you.
Dec 4, 2013 at 12:49 AM
ruby is cool :) - Seriously - I am working on a puppet provider to leverage wsus here https://github.com/rismoney/puppet-wsus

I submitted a Pull Req on github to remove the write-hosts. Ideally I would think these tidbits from write-host should be in a \en-US\about_PoshWSUS.help.txt file, so the help get-help about_poshwsus would work. I am not all that familiar with Mercurial or I would try to do it on here.

Anyway I tried to simply add the about text file on a Win2012 server and I was getting weird issues with get-help, and it complaining about a windows update .net library...
Coordinator
Dec 4, 2013 at 1:52 AM
Sorry, I meant to reply earlier, but I have been busy with other things. It's fine to do a pull request from Github if you want. Really that was more of an experiment while testing another person's module to install other modules but I will keep it out there. Codeplex is really where I put my latest things at, so anything that is added with GitHub will be pushed to Codeplex. I'll also look into your issue with the corrupt source code as well (I'm still pretty new to GitHub and haven't used it a whole lot, so I could have easily messed something up in the upload).

The back story on the initial display was that I wanted to use the same idea as the PowerCLI guys when I was first working on this module. But now I think it is probably a good time to do away with the initial display. I honestly will probably not get around to posting an update (I already merged your pull request on GitHub) to this until either the end of the year as I am actually working on doing away with comment-based help in favor of XML dedicated help files and can add some about_* help files where needed.

Not sure about the issue that you are seeing with Get-Help and windows update .net library, but will keep my eyes open for it when I start working on the about* files.