Automation

 View Only
  • 1.  Getting file size of report file on PowerCLI server?

    Posted Apr 06, 2011 05:35 PM

    Hi all:

    I am trying to find out if there is a way to list the size of a file thats local to the powercli server.  The background is that I have a script that runs daily and emails out the report of what it finds during the audit.  What I am trying to update the script to do is only send the report if the audit actually found anything; and not an empty file attachment...

    Thanks in advance for any help you can provide, and please let me know if more information is needed.

    thanks!

    Jade



  • 2.  RE: Getting file size of report file on PowerCLI server?
    Best Answer

    Posted Apr 06, 2011 05:39 PM

    Hi Jade,

    you can do the following to check the size of a file called vmware.log:

    if ((Get-ChildItem vmware.log).Length -gt 0) { # E-mail logfile}


    Regards,Robert



  • 3.  RE: Getting file size of report file on PowerCLI server?

    Posted Apr 06, 2011 05:56 PM

    That was exactly what I was looking for!  Thank you for the lightning fast (and correct!) answer!

    Jade