none
New-Asset Report - awesome, but can't get it to run? RRS feed

  • Question

  • Howdy - I am trying to run the awesome new-asset report that Zachary Loeber shared with the technet community.

    The script is here:  http://gallery.technet.microsoft.com/Excel-and-HTML-Asset-0ffbf569

    However I can't get it to run against 1 server or multiple servers.

    I followed this information someone else asked and I get back many errors, all related to the parameters.

    Can someone help me out with this?

    A. Should this be saved as a function? And then I've read conflicting or maybe different ways to run a function.  Should I do import-module or just run the script as a single command line, and I've had this issue with other functions.  Should they be put in a specific location on my system?  I'm newbie, so thanks for the help!

    B.  When I run this, I've tried using this simple command:  .\New-AssetReport.ps1 -Computers testserver1.domain.local -PromptForCredentials -Verbose

    C.  Then I tried this example as well from a single line or creating another ps1 script, fails either way.

    D.  What variables are required to be filled in, and what parameters are available such as report type, include memory, but not disk, etc?

    Here's the error if I enter the command like this:  .\New-AssetReport.ps1 -Computers testserver1 -PromptForCredentials -Verbose

    New-AssetReport : Cannot process argument transformation on parameter 'SaveDataFile'. Cannot convert value
    "System.String" to type "System.Management.Automation.SwitchParameter". Boolean parameters accept only Boolean values
    and numbers, such as $True, $False, 1 or 0.

    Here is the error if I use the other example which is below.  I get many errors, all tied to the parameters such as -verbose, etc.
    $Servers = @('Server1','Server2')
            .\New-AssetReport.ps1 -Computers $Servers -PromptForCredentials -Verbose

    New-AssetReport : The term 'New-AssetReport' is not recognized as the name of a cmdlet, function, script file, or
    operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
    again.

    -ReportContainer : The term '-ReportContainer' is not recognized as the name of a cmdlet, function, script file, or
    operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
    again.

    Wednesday, February 19, 2014 10:23 PM

Answers