Closed skest3qc closed 7 years ago
That makes sense. This is definitely a scenario we should support, since it's a common configuration. Currently the -ReferenceConfiguration
takes a single .MOF, but since Test-DSCConfiguration
without -ReferenceConfiguration
just uses a path of MOF files for each system, we should support that. I'll start looking into it. Thanks!
Made a -Path
parameter for Start-DSCEAScan
which looks into a path and uses each named MOF against it's respective system. The changes are on the live on the dev branch, if you want to download them and play with it.
Hi,
thanks I just tested it, it works.
However when I start Start-DSCEAScan I get this error: `Get-Item : Cannot find path 'C:\DSC\localhost.mof' because it does not exist. At C:\Program Files\WindowsPowerShell\Modules\DSCEA\1.1.0.1\Functions\Start-DSCEAscan.ps1:128 char:17
+ CategoryInfo : ObjectNotFound: (C:\DSC\localhost.mof:String) [
Get-Item], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand
The variable cannot be validated because the value is not a valid value for the MofFile variable. At C:\Program Files\WindowsPowerShell\Modules\DSCEA\1.1.0.1\Functions\Start-DSCEAscan.ps1:128 char:5
+ CategoryInfo : MetadataError: (:) [], ValidationMetadataException
+ FullyQualifiedErrorId : ValidateSetFailure`
The scan works and I can create a HTML file from it
When you run Start-DSCEAScan
it assumes there's a .\localhost.mof file, otherwise you need to run Start-DSCEAScan -MofFile C:\location\whatever.mof
, but it should probably have a better error message/test for it's existence. I'll have to mark that as an issue.
Made a -Path parameter for Start-DSCEAScan which looks into a path and uses each named MOF against it's respective system. The changes are on the live on the dev branch, if you want to download them and play with it
I thought the -Path parameter was made to look into this directory and process all named MOF files. There is no need for a localhost.mof?
Thanks
I see it now. It looks like we started with the Get-Item
for the MOF full path because it was either passed in as a parameter (or assumed .\localhost.mof) and when I added the -Path
parameter, the -MofFile
defaulted to it's .\localhost.mof
which didn't necessarily exist on the system calling the function in order for the function to work (because it properly processed the MOFs specified by -Path
).
I added the the -MofFile
parameter to a parameterset so that it can't be specified in conjunction with -Path
and I moved $MofFile = (Get-Item $MofFile).FullName
into the parts of the code that support the parametersets that actually use them.
Thanks!
Thanks
Tried the dev branch and get this error when running Start-DSCEAScan -Path SomePath: `Cannot find an overload for ".ctor" and the argument count: "2". At C:\Program Files\WindowsPowerShell\Modules\DSCEA\Functions\Start-DSCEAscan.ps1:99 char:9
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
Import-Clixml : Cannot bind argument to parameter 'Path' because it is an empty string. At C:\Program Files\WindowsPowerShell\Modules\DSCEA\Functions\Get-DSCEAreport.ps1:88 char:30
+ CategoryInfo : InvalidData: (:) [Import-Clixml], ParameterBindingValidationExceptio
n
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.Powe
rShell.Commands.ImportClixmlCommand`
I am able to repro the "Cannot find an overload for ".ctor" and the argument count" issue when I test the following command: Start-DSCEAscan -MofFile .\localhost.mof -ComputerName dsctest-1, dsctest-2, dsctest-3
We will take a look into this
This issue should be resolved in the next release
Hi,
first thanks for this great module.
Each node in my environment has a separate mof file.
Start-DSCEAscan -ComputerName node1 -OutputPath "$OutputPath" -MofFile "node1.mof"
Start-DSCEAscan -ComputerName node2 -OutputPath "$OutputPath" -MofFile "node2.mof"
So this produces me a XML file for each node.I would like to know if it is somehow possible to create a detailed or compliance report from a collection of xml files?
So that I have one HTML of the compliance of all servers?
Thanks