locked
Publishing Refresh via WMI or command line (not powershell) RRS feed

  • Question

  • Good Afternoon:

    I'm writing a small utility to manage App-V 5 for my environment.  I'm looking for something in WMI or a command line that I can use to initiate a publishing refresh.  Unfortunately, I'm not able to use the powershell command.

    I've explored the WMI classes and I can get the publishing servers, but I'm unable to find a way to trigger the refresh.  Unfortunately, none of the WMI objects have a refresh method (that would be too easy!).

    I'm trying to trigger the refresh from a Visual Studio 2013 project.

    Thanks for any help you can offer!

    Friday, August 28, 2015 9:30 PM

Answers

  • Hi Joe,

    It is possible to execute PowerShell commands trough C#, please see the following page: http://blogs.msdn.com/b/kebab/archive/2014/04/28/executing-powershell-scripts-from-c.aspx

    Regards,

    Ryan


    Saturday, August 29, 2015 10:59 PM

All replies

  • Hi Joe,

    It is possible to execute PowerShell commands trough C#, please see the following page: http://blogs.msdn.com/b/kebab/archive/2014/04/28/executing-powershell-scripts-from-c.aspx

    Regards,

    Ryan


    Saturday, August 29, 2015 10:59 PM
  • Ryan,

    Thanks for making me look at this again.  I've looked at trying to run powershell through .net before, and I couldn't get it to work.  In fact, I'd looked at this exact page before!  However, this time things clicked and I managed to get my vb.net code together to get things working, and it only took a couple of minutes!

    I have a feeling I'll be moving my calls to powershell for the other functions, too -- it actually seems faster to get at some of the data compared to WMI.

    Monday, August 31, 2015 7:32 PM